Skip to content

Commit f4b828e

Browse files
committed
Add iro-chromaticity
**Why:** Establishes the foundational functionality for the `iro-chromaticity` gem, focusing on chromaticity models and transforms, aligned with Iro's ecosystem. Sets up workflows, tooling, and file structure for streamlined development. **What was changed:** - Core models and transforms: `XY`, `XYToXYZ`, `XYZToXY`. - Configured shell scripts for tasks (`lint`, `build`, `setup`, etc.). - Added RSpec testing with SimpleCov for coverage. - Integrated RuboCop for linting and Dependabot for dependency updates. - Implemented CI/CD via GitHub Actions workflows (linting, testing, packaging). - Added gemspec, Gemfile, and `.gitignore` for dependency and file management. - Provided type-signature files for Steep and documentation with Yard. - Introduced `mise.toml` for task orchestration. These additions define the structure and capabilities for chromaticity transformations in Iro. No side effects expected.
1 parent 5b365db commit f4b828e

File tree

36 files changed

+544
-3
lines changed

36 files changed

+544
-3
lines changed

Gemfile.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ PATH
66
iro-runtime (~> 0.1)
77
iro-support (~> 0.1)
88

9+
PATH
10+
remote: iro-chromaticity-rb
11+
specs:
12+
iro-chromaticity (0.1.0)
13+
iro-core (~> 0.1)
14+
iro-runtime (~> 0.1)
15+
iro-support (~> 0.1)
16+
917
PATH
1018
remote: iro-core-rb
1119
specs:
@@ -110,6 +118,7 @@ PLATFORMS
110118
DEPENDENCIES
111119
github-markup
112120
iro-chromatic_adaptation-transform!
121+
iro-chromaticity!
113122
iro-core!
114123
iro-runtime!
115124
iro-support!
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
labels:
9+
- dependabot
10+
- dependencies
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Setup project
18+
uses: actions/checkout@v4
19+
- name: Setup ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
bundler-cache: true
23+
ruby-version: 3.2
24+
- name: Lint ruby
25+
run: bundle exec rubocop
26+
27+
test:
28+
name: Test (ruby ${{ matrix.ruby_version }})
29+
env:
30+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Setup project
34+
uses: actions/checkout@v4
35+
- name: Setup ruby
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
bundler-cache: true
39+
ruby-version: ${{ matrix.ruby_version }}
40+
- name: Run RSpec
41+
run: bundle exec rspec
42+
- name: Report Coverage
43+
if: env.CODACY_PROJECT_TOKEN != ''
44+
shell: bash
45+
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
46+
strategy:
47+
matrix:
48+
ruby_version:
49+
- 3.2
50+
- 3.3
51+
- 3.4
52+
53+
package:
54+
name: Package
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Setup project
58+
uses: actions/checkout@v4
59+
- name: Setup ruby
60+
uses: ruby/setup-ruby@v1
61+
with:
62+
bundler-cache: true
63+
ruby-version: 3.2
64+
- name: Package gem
65+
run: bin/build

iro-chromaticity-rb/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
*.gem
2+
*.rbc
3+
/.config
4+
/coverage/
5+
/InstalledFiles
6+
/logs/
7+
/pkg/
8+
/spec/reports/
9+
/spec/examples.txt
10+
/test/tmp/
11+
/test/version_tmp/
12+
/tmp/
13+
14+
# Used by dotenv library to load environment variables.
15+
# .env
16+
17+
# Ignore Byebug command history file.
18+
.byebug_history
19+
20+
## Documentation cache and generated files:
21+
/.yardoc/
22+
/_yardoc/
23+
/doc/
24+
/rdoc/
25+
26+
## Environment normalization:
27+
/.bundle/
28+
/vendor/bundle
29+
/lib/bundler/man/
30+
31+
# for a library or gem, you might want to ignore these files since the code is
32+
# intended to run in multiple environments; otherwise, check them in:
33+
Gemfile.lock
34+
# .ruby-version
35+
# .ruby-gemset
36+
37+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
38+
.rvmrc
39+
40+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
41+
.rubocop-https?--*

iro-chromaticity-rb/.rspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--require spec_helper
2+
--format documentation
3+
--order rand
4+
--color

iro-chromaticity-rb/.rubocop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
inherit_from:
2+
# TODO: change this to a remote url
3+
- ../.rubocop.yml
4+
5+
Naming/FileName:
6+
Exclude:
7+
- lib/iro-chromaticity.rb

iro-chromaticity-rb/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.8

iro-chromaticity-rb/.yardopts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lib/**/*.rb
2+
--title Iro::Chromaticity
3+
--readme README.md
4+
--no-private
5+
--protected
6+
--markup markdown
7+
--markup-provider redcarpet
8+
--embed-mixins
9+
--tag rbs:"Signature"
10+
--hide-tag rbs
11+
--files LICENSE

iro-chromaticity-rb/Gemfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# frozen_string_literal: true
2+
3+
require 'yaml'
4+
5+
source 'https://rubygems.org'
6+
gemspec
7+
8+
ruby '~> 3.2'
9+
10+
group :iro do
11+
YAML.load_file(File.expand_path('iro-gems.yml', File.dirname(__FILE__)))&.each_pair do |gem_name, config|
12+
gem gem_name, path: config['path'] if Dir.exist?(config['path'])
13+
end
14+
end
15+
16+
group :doc do
17+
gem 'github-markup', require: false
18+
gem 'redcarpet', require: false
19+
gem 'webrick', require: false
20+
gem 'yard', require: false
21+
gem 'yard-sitemap', require: false
22+
end
23+
24+
group :lint do
25+
gem 'rubocop', require: false
26+
gem 'rubocop-ordered_methods', require: false
27+
gem 'rubocop-performance', require: false
28+
gem 'rubocop-rspec', require: false
29+
gem 'rubocop-thread_safety', require: false
30+
gem 'rubocop-yard', require: false
31+
end
32+
33+
group :signatures do
34+
gem 'rbs', require: false
35+
gem 'rbs-inline', require: false
36+
gem 'steep', require: false
37+
end
38+
39+
group :test do
40+
gem 'rspec', require: false
41+
gem 'simplecov', require: false
42+
gem 'simplecov-lcov', require: false
43+
end

iro-chromaticity-rb/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2025 Aaron Allen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)