u-case 4.5.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e548c5eca296db7c02caeba9bd5a05962959f68dd4a7024518c3ec00c1349cc7
4
- data.tar.gz: c02d785e60c995a6f088df9ff1b33e16c73deaa4a3c4c727410140eb198b1a7b
3
+ metadata.gz: d654bd6a59c3920ef02a3fa0c2b82fb32ff5f695cfe1f4d4565a84c53bf1d86c
4
+ data.tar.gz: e42a81c72ad2f49d01f2464e220e72bd201ca0adce6be06f14defa4ee84f67fe
5
5
  SHA512:
6
- metadata.gz: b1319dcfd0e2139a21b7d38831d0920a17a8fa4fbe0824f19e6f2245e007dbd7546b49e2aad70bded0c118f502e80e303ce69fee36ea10ada746ee71ffa8f021
7
- data.tar.gz: 9ba626fd38078d07179f1b7e261a4a26bb0a8eee565b2a5a013b50778206c4bbfcb34cf34231df1dc3c3b99c994745e23a78dc64d1c37c7ad444cf5725645906
6
+ metadata.gz: '090c4536a5205ed89e0cf2e76b163ca127455f90df793980bd33cdc28efecabd35736e543dc2f003954b8131367672dea79319382412dd7ce6ae25121847eab6'
7
+ data.tar.gz: 0a9f2345b82957003238137fcd5a4ca081205f3b83c1f8f092d92f153ef3b57dd7d726abef600cdd1b76b7e6983b222931d8903edf984573cf8dd4696851a7cd
@@ -1,27 +1,67 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ pull_request:
1
9
 
2
- name: build
3
- on: [push, pull_request]
4
10
  jobs:
5
11
  test:
6
12
  runs-on: ubuntu-latest
13
+ name: Ruby ${{ matrix.ruby }} (transitions=${{ matrix.transitions }})
14
+ permissions:
15
+ contents: read
7
16
  strategy:
17
+ fail-fast: false
8
18
  matrix:
9
- ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 3.0, 3.1]
19
+ ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0", head]
20
+ transitions: ["true", "false"]
21
+ env:
22
+ ENABLE_TRANSITIONS: ${{ matrix.transitions }}
10
23
  steps:
11
- - uses: actions/checkout@v2
12
- - uses: ruby/setup-ruby@v1
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ persist-credentials: false
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
13
29
  with:
14
30
  ruby-version: ${{ matrix.ruby }}
15
- bundler-cache: true
16
- - name: Test and generate coverage
17
- run: bin/test
18
- - name: Format coverage
19
- if: ${{ matrix.ruby >= 3 }}
20
- run: bin/prepare_coverage
21
- - uses: paambaati/codeclimate-action@v2.7.5
22
- if: ${{ matrix.ruby >= 3 }}
23
- env:
24
- CC_TEST_REPORTER_ID: 0377ece62be9c7042557d76e4e38b867e51c51b2a42d10ef5102b613ac077eab
31
+ - name: Install bundler
32
+ run: gem install bundler -v 2.4.22
33
+ if: ${{ matrix.ruby == '2.7' || matrix.ruby == '3.0' }}
34
+ - name: Bundle install
35
+ run: bundle install
36
+ - name: Setup project
37
+ run: bundle exec appraisal install
38
+ - name: Run tests for Rails 6.0
39
+ run: bundle exec appraisal rails-6-0 rake test
40
+ if: ${{ matrix.ruby == '2.7' || matrix.ruby == '3.0' }}
41
+ - name: Run tests for Rails 6.1
42
+ run: bundle exec appraisal rails-6-1 rake test
43
+ if: ${{ matrix.ruby == '2.7' || matrix.ruby == '3.0' }}
44
+ - name: Run tests for Rails 7.0
45
+ run: bundle exec appraisal rails-7-0 rake test
46
+ if: ${{ matrix.ruby == '2.7' || matrix.ruby == '3.0' || matrix.ruby == '3.1' || matrix.ruby == '3.2' || matrix.ruby == '3.3' }}
47
+ - name: Run tests for Rails 7.1
48
+ run: bundle exec appraisal rails-7-1 rake test
49
+ if: ${{ matrix.ruby == '2.7' || matrix.ruby == '3.0' || matrix.ruby == '3.1' || matrix.ruby == '3.2' || matrix.ruby == '3.3' }}
50
+ - name: Run tests for Rails 7.2
51
+ run: bundle exec appraisal rails-7-2 rake test
52
+ if: ${{ matrix.ruby == '3.1' || matrix.ruby == '3.2' || matrix.ruby == '3.3' || matrix.ruby == '3.4' }}
53
+ - name: Run tests for Rails 8.0
54
+ run: bundle exec appraisal rails-8-0 rake test
55
+ if: ${{ matrix.ruby == '3.2' || matrix.ruby == '3.3' || matrix.ruby == '3.4' }}
56
+ - name: Run tests for Rails 8.1
57
+ run: bundle exec appraisal rails-8-1 rake test
58
+ if: ${{ matrix.ruby == '3.3' || matrix.ruby == '3.4' || matrix.ruby == '4.0' }}
59
+ - name: Run tests for Rails edge
60
+ run: bundle exec appraisal rails-edge rake test
61
+ if: ${{ matrix.ruby == '4.0' || matrix.ruby == 'head' }}
62
+ - name: Upload coverage to Qlty
63
+ uses: qltysh/qlty-action/coverage@v2
64
+ if: ${{ matrix.ruby == '3.4' && matrix.transitions == 'true' && !github.base_ref }}
25
65
  with:
26
- debug: true
27
- coverageLocations: coverage/.resultset.json:simplecov
66
+ token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
67
+ files: coverage/.resultset.json
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
+ .DS_Store
2
+
1
3
  /.bundle/
2
4
  /.yardoc
3
5
  /_yardoc/
@@ -6,5 +8,10 @@
6
8
  /pkg/
7
9
  /spec/reports/
8
10
  /tmp/
11
+
9
12
  Gemfile.lock
13
+
14
+ gemfiles/*.lock
15
+ gemfiles/.bundle/
16
+
10
17
  tags
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.6.5
1
+ ruby 4.0.1
data/Appraisals ADDED
@@ -0,0 +1,92 @@
1
+ if RUBY_VERSION < "3.1"
2
+ appraise "rails-6-0" do
3
+ group :test do
4
+ gem "logger", "~> 1.6", ">= 1.6.6"
5
+ gem "stringio", "~> 3.2"
6
+
7
+ gem "sqlite3", "~> 1.7"
8
+ gem "minitest", "5.26.1"
9
+ gem "activerecord", "~> 6.0.0", require: "active_record"
10
+ end
11
+ end
12
+
13
+ appraise "rails-6-1" do
14
+ group :test do
15
+ gem "logger", "~> 1.6", ">= 1.6.6"
16
+ gem "stringio", "~> 3.2"
17
+
18
+ gem "sqlite3", "~> 1.7"
19
+ gem "minitest", "5.26.1"
20
+ gem "activerecord", "~> 6.1.0", require: "active_record"
21
+ end
22
+ end
23
+ end
24
+
25
+ if RUBY_VERSION >= "2.7" && RUBY_VERSION < "3.4"
26
+ appraise "rails-7-0" do
27
+ group :test do
28
+ gem "logger", "~> 1.6", ">= 1.6.6"
29
+ gem "stringio", "~> 3.2"
30
+ gem "securerandom", "~> 0.3.2"
31
+
32
+ gem "sqlite3", "~> 1.7"
33
+ gem "minitest", "5.26.1"
34
+ gem "activerecord", "~> 7.0.0", require: "active_record"
35
+ end
36
+ end
37
+
38
+ appraise "rails-7-1" do
39
+ group :test do
40
+ gem "logger", "~> 1.6", ">= 1.6.6"
41
+ gem "stringio", "~> 3.2"
42
+ gem "securerandom", "~> 0.3.2"
43
+
44
+ gem "sqlite3", "~> 1.7"
45
+ gem "minitest", "5.26.1"
46
+ gem "activerecord", "~> 7.1.0", require: "active_record"
47
+ end
48
+ end
49
+ end
50
+
51
+ if RUBY_VERSION >= "3.1" && RUBY_VERSION < "4.0"
52
+ appraise "rails-7-2" do
53
+ group :test do
54
+ gem "sqlite3", "~> 2.8", ">= 2.8.1"
55
+ gem "minitest", "~> 5.27"
56
+ gem "activerecord", "~> 7.2.0", require: "active_record"
57
+ end
58
+ end
59
+ end
60
+
61
+ if RUBY_VERSION >= "3.2" && RUBY_VERSION < "4.0"
62
+ appraise "rails-8-0" do
63
+ group :test do
64
+ gem "sqlite3", "~> 2.9"
65
+ gem "ostruct", "~> 0.6.3"
66
+ gem "minitest", "~> 5.27"
67
+ gem "activerecord", "~> 8.0.0", require: "active_record"
68
+ end
69
+ end
70
+ end
71
+
72
+ if RUBY_VERSION >= "3.3.0"
73
+ minitest_version = (RUBY_VERSION >= "4.0.0") ? "~> 6.0" : "~> 5.27"
74
+
75
+ appraise "rails-8-1" do
76
+ group :test do
77
+ gem "sqlite3", "~> 2.9"
78
+ gem "ostruct", "~> 0.6.3"
79
+ gem "minitest", minitest_version
80
+ gem "activerecord", "~> 8.1.0", require: "active_record"
81
+ end
82
+ end
83
+
84
+ appraise "rails-edge" do
85
+ group :test do
86
+ gem "sqlite3", "~> 2.9"
87
+ gem "ostruct", "~> 0.6.3"
88
+ gem "minitest", minitest_version
89
+ gem "activerecord", github: "rails/rails", branch: "main", require: "active_record"
90
+ end
91
+ end
92
+ end
data/Gemfile CHANGED
@@ -1,67 +1,16 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- activerecord_version = ENV.fetch('ACTIVERECORD_VERSION', '7')
6
-
7
- activerecord =
8
- case activerecord_version
9
- when '3.2' then '3.2.22'
10
- when '4.0' then '4.0.13'
11
- when '4.1' then '4.1.16'
12
- when '4.2' then '4.2.11'
13
- when '5.0' then '5.0.7'
14
- when '5.1' then '5.1.7'
15
- when '5.2' then '5.2.4'
16
- when '6.0' then '6.0.3.4'
17
- when '6.1' then '6.1.2'
18
- end
5
+ # Specify your gem's dependencies in u-case.gemspec
6
+ gemspec
19
7
 
20
- simplecov_version =
21
- case RUBY_VERSION
22
- when /\A2.[23]/ then '~> 0.17.1'
23
- when /\A2.4/ then '~> 0.18.5'
24
- else '~> 0.21.2'
25
- end
8
+ gem "rake", "~> 13.0"
26
9
 
27
10
  group :test do
28
- gem 'minitest', activerecord_version < '4.1' ? '~> 4.2' : '~> 5.0'
29
-
30
- gem 'simplecov', simplecov_version, require: false
31
-
32
- if activerecord
33
- sqlite3 =
34
- case activerecord
35
- when /\A6\.(0|1)/, nil then '~> 1.4.0'
36
- else '~> 1.3.0'
37
- end
38
-
39
- gem 'sqlite3', sqlite3
40
- gem 'activerecord', activerecord, require: 'active_record'
41
- end
11
+ gem "simplecov", "~> 0.22.0", require: false
42
12
  end
43
13
 
44
- pry_byebug_version =
45
- case RUBY_VERSION
46
- when /\A2.[23]/ then '3.6'
47
- else '3.9'
48
- end
49
-
50
- pry_version =
51
- case RUBY_VERSION
52
- when /\A2.2/ then '0.12.2'
53
- when /\A2.3/ then '0.12.2'
54
- else '0.13.1'
55
- end
56
-
57
14
  group :development, :test do
58
- gem 'awesome_print', '~> 1.8'
59
-
60
- gem 'byebug', '~> 10.0', '>= 10.0.2' if RUBY_VERSION =~ /\A2.[23]/
61
-
62
- gem 'pry', "~> #{pry_version}"
63
- gem 'pry-byebug', "~> #{pry_byebug_version}"
15
+ gem "awesome_print"
64
16
  end
65
-
66
- # Specify your gem's dependencies in u-case.gemspec
67
- gemspec
data/README.md CHANGED
@@ -1,28 +1,16 @@
1
1
  <p align="center">
2
- <img src="./assets/ucase_logo_v1.png" alt="u-case - Represent use cases in a simple and powerful way while writing modular, expressive and sequentially logical code.">
3
-
2
+ <h1 align="center" id="-case"><img src="./assets/ucase_logo_v1.png" alt="μ-case" height="150"></h1>
4
3
  <p align="center"><i>Represent use cases in a simple and powerful way while writing modular, expressive and sequentially logical code.</i></p>
5
- <br>
6
- </p>
7
-
8
- <p align="center">
9
- <img src="https://img.shields.io/badge/ruby->%3D%202.2.0-ruby.svg?colorA=99004d&colorB=cc0066" alt="Ruby">
10
-
11
- <a href="https://rubygems.org/gems/u-case">
12
- <img alt="Gem" src="https://img.shields.io/gem/v/u-case.svg?style=flat-square">
13
- </a>
14
-
15
- <a href="https://github.com/serradura/u-case/actions/workflows/ci.yml">
16
- <img alt="Build Status" src="https://github.com/serradura/u-case/actions/workflows/ci.yml/badge.svg">
17
- </a>
18
-
19
- <a href="https://codeclimate.com/github/serradura/u-case/maintainability">
20
- <img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/5c3c8ad1b0b943f88efd/maintainability">
21
- </a>
22
-
23
- <a href="https://codeclimate.com/github/serradura/u-case/test_coverage">
24
- <img alt="Test Coverage" src="https://api.codeclimate.com/v1/badges/5c3c8ad1b0b943f88efd/test_coverage">
25
- </a>
4
+ <p align="center">
5
+ <a href="https://badge.fury.io/rb/u-case"><img src="https://badge.fury.io/rb/u-case.svg" alt="Gem Version" height="18"></a>
6
+ <a href="https://github.com/serradura/u-case/actions/workflows/ci.yml"><img alt="Build Status" src="https://github.com/serradura/u-case/actions/workflows/ci.yml/badge.svg"></a>
7
+ <br/>
8
+ <a href="https://qlty.sh/gh/serradura/projects/u-case"><img src="https://qlty.sh/gh/serradura/projects/u-case/maintainability.svg" alt="Maintainability" /></a>
9
+ <a href="https://qlty.sh/gh/serradura/projects/u-case"><img src="https://qlty.sh/gh/serradura/projects/u-case/coverage.svg" alt="Code Coverage" /></a>
10
+ <br/>
11
+ <img src="https://img.shields.io/badge/Ruby%20%3E%3D%202.7%2C%20%3C%3D%20Head-ruby.svg?colorA=444&colorB=333" alt="Ruby">
12
+ <img src="https://img.shields.io/badge/Rails%20%3E%3D%206.0%2C%20%3C%3D%20Edge-rails.svg?colorA=444&colorB=333" alt="Rails">
13
+ </p>
26
14
  </p>
27
15
 
28
16
  The main project goals are:
@@ -39,10 +27,8 @@ The main project goals are:
39
27
  Version | Documentation
40
28
  --------- | -------------
41
29
  unreleased| https://github.com/serradura/u-case/blob/main/README.md
30
+ 5.0.0 | https://github.com/serradura/u-case/blob/v5.x/README.md
42
31
  4.5.1 | https://github.com/serradura/u-case/blob/v4.x/README.md
43
- 3.1.0 | https://github.com/serradura/u-case/blob/v3.x/README.md
44
- 2.6.0 | https://github.com/serradura/u-case/blob/v2.x/README.md
45
- 1.1.0 | https://github.com/serradura/u-case/blob/v1.x/README.md
46
32
 
47
33
  > **Note:** Você entende português? 🇧🇷&nbsp;🇵🇹 Verifique o [README traduzido em pt-BR](https://github.com/serradura/u-case/blob/main/README.pt-BR.md).
48
34
 
@@ -99,13 +85,24 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
99
85
 
100
86
  ## Compatibility
101
87
 
102
- | u-case | branch | ruby | activemodel | u-attributes |
103
- | -------------- | ------- | -------- | ------------- | ------------- |
104
- | unreleased | main | >= 2.2.0 | >= 3.2, < 7.0 | >= 2.7, < 3.0 |
105
- | 4.5.1 | v4.x | >= 2.2.0 | >= 3.2, < 7.0 | >= 2.7, < 3.0 |
106
- | 3.1.0 | v3.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
107
- | 2.6.0 | v2.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
108
- | 1.1.0 | v1.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
88
+ | u-case | branch | ruby | activemodel | u-attributes |
89
+ | ---------------- | ------ | -------- | -------------- | -------------- |
90
+ | unreleased | main | >= 2.7 | >= 6.0 | >= 2.7, < 4.0 |
91
+ | 5.0.0 | v5.x | >= 2.7 | >= 6.0 | >= 2.7, < 4.0 |
92
+ | 4.5.1 | v4.x | >= 2.2.0 | >= 3.2, <= 8.1 | >= 2.7, < 3.0 |
93
+
94
+ This library is tested (CI matrix) against:
95
+
96
+ | Ruby / Rails | 6.0 | 6.1 | 7.0 | 7.1 | 7.2 | 8.0 | 8.1 | Edge |
97
+ |--------------|-----|-----|-----|-----|-----|-----|-----|------|
98
+ | 2.7 | ✅ | ✅ | ✅ | ✅ | | | | |
99
+ | 3.0 | ✅ | ✅ | ✅ | ✅ | | | | |
100
+ | 3.1 | | | ✅ | ✅ | ✅ | | | |
101
+ | 3.2 | | | ✅ | ✅ | ✅ | ✅ | | |
102
+ | 3.3 | | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
103
+ | 3.4 | | | | | ✅ | ✅ | ✅ | ✅ |
104
+ | 4.x | | | | | | | ✅ | ✅ |
105
+ | Head | | | | | | | ✅ | ✅ |
109
106
 
110
107
  > Note: The activemodel is an optional dependency, this module [can be enabled](#u-casewith_activemodel_validation---how-to-validate-use-case-attributes) to validate the use cases' attributes.
111
108
 
@@ -126,7 +123,7 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
126
123
  Add this line to your application's Gemfile:
127
124
 
128
125
  ```ruby
129
- gem 'u-case', '~> 4.5.1'
126
+ gem 'u-case', '~> 5.0'
130
127
  ```
131
128
 
132
129
  And then execute:
data/README.pt-BR.md CHANGED
@@ -1,28 +1,16 @@
1
1
  <p align="center">
2
- <img src="./assets/ucase_logo_v1.png" alt="u-case - Represent use cases in a simple and powerful way while writing modular, expressive and sequentially logical code.">
3
-
4
- <p align="center"><i> Represente casos de uso de forma simples e poderosa ao escrever código modular, expressivo e sequencialmente lógico.</i></p>
5
- <br>
6
- </p>
7
-
8
- <p align="center">
9
- <img src="https://img.shields.io/badge/ruby-2.2+-ruby.svg?colorA=99004d&colorB=cc0066" alt="Ruby">
10
-
11
- <a href="https://rubygems.org/gems/u-case">
12
- <img alt="Gem" src="https://img.shields.io/gem/v/u-case.svg?style=flat-square">
13
- </a>
14
-
15
- <a href="https://github.com/serradura/u-case/actions/workflows/ci.yml">
16
- <img alt="Build Status" src="https://github.com/serradura/u-case/actions/workflows/ci.yml/badge.svg">
17
- </a>
18
-
19
- <a href="https://codeclimate.com/github/serradura/u-case/maintainability">
20
- <img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/5c3c8ad1b0b943f88efd/maintainability">
21
- </a>
22
-
23
- <a href="https://codeclimate.com/github/serradura/u-case/test_coverage">
24
- <img alt="Test Coverage" src="https://api.codeclimate.com/v1/badges/5c3c8ad1b0b943f88efd/test_coverage">
25
- </a>
2
+ <h1 align="center" id="-case"><img src="./assets/ucase_logo_v1.png" alt="μ-case" height="150"></h1>
3
+ <p align="center"><i>Represente casos de uso de forma simples e poderosa ao escrever código modular, expressivo e sequencialmente lógico.</i></p>
4
+ <p align="center">
5
+ <a href="https://badge.fury.io/rb/u-case"><img src="https://badge.fury.io/rb/u-case.svg" alt="Gem Version" height="18"></a>
6
+ <a href="https://github.com/serradura/u-case/actions/workflows/ci.yml"><img alt="Build Status" src="https://github.com/serradura/u-case/actions/workflows/ci.yml/badge.svg"></a>
7
+ <br/>
8
+ <a href="https://qlty.sh/gh/serradura/projects/u-case"><img src="https://qlty.sh/gh/serradura/projects/u-case/maintainability.svg" alt="Maintainability" /></a>
9
+ <a href="https://qlty.sh/gh/serradura/projects/u-case"><img src="https://qlty.sh/gh/serradura/projects/u-case/coverage.svg" alt="Code Coverage" /></a>
10
+ <br/>
11
+ <img src="https://img.shields.io/badge/Ruby%20%3E%3D%202.7%2C%20%3C%3D%20Head-ruby.svg?colorA=444&colorB=333" alt="Ruby">
12
+ <img src="https://img.shields.io/badge/Rails%20%3E%3D%206.0%2C%20%3C%3D%20Edge-rails.svg?colorA=444&colorB=333" alt="Rails">
13
+ </p>
26
14
  </p>
27
15
 
28
16
  Principais objetivos deste projeto:
@@ -39,10 +27,8 @@ Principais objetivos deste projeto:
39
27
  Versão | Documentação
40
28
  --------- | -------------
41
29
  unreleased| https://github.com/serradura/u-case/blob/main/README.md
30
+ 5.0.0 | https://github.com/serradura/u-case/blob/v5.x/README.md
42
31
  4.5.1 | https://github.com/serradura/u-case/blob/v4.x/README.md
43
- 3.1.0 | https://github.com/serradura/u-case/blob/v3.x/README.md
44
- 2.6.0 | https://github.com/serradura/u-case/blob/v2.x/README.md
45
- 1.1.0 | https://github.com/serradura/u-case/blob/v1.x/README.md
46
32
 
47
33
  ## Índice <!-- omit in toc -->
48
34
  - [Compatibilidade](#compatibilidade)
@@ -97,13 +83,24 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
97
83
 
98
84
  ## Compatibilidade
99
85
 
100
- | u-case | branch | ruby | activemodel | u-attributes- |
101
- | -------------- | ------- | -------- | ------------- | ------------- |
102
- | unreleased | main | >= 2.2.0 | >= 3.2, < 7.0 | >= 2.7, < 3.0 |
103
- | 4.5.1 | v4.x | >= 2.2.0 | >= 3.2, < 7.0 | >= 2.7, < 3.0 |
104
- | 3.1.0 | v3.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
105
- | 2.6.0 | v2.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
106
- | 1.1.0 | v1.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
86
+ | u-case | branch | ruby | activemodel | u-attributes |
87
+ | ---------------- | ------ | -------- | -------------- | -------------- |
88
+ | unreleased | main | >= 2.7 | >= 6.0 | >= 2.7, < 4.0 |
89
+ | 5.0.0 | v5.x | >= 2.7 | >= 6.0 | >= 2.7, < 4.0 |
90
+ | 4.5.1 | v4.x | >= 2.2.0 | >= 3.2, <= 8.1 | >= 2.7, < 3.0 |
91
+
92
+ Esta biblioteca é testada (matriz de CI) contra:
93
+
94
+ | Ruby / Rails | 6.0 | 6.1 | 7.0 | 7.1 | 7.2 | 8.0 | 8.1 | Edge |
95
+ |--------------|-----|-----|-----|-----|-----|-----|-----|------|
96
+ | 2.7 | ✅ | ✅ | ✅ | ✅ | | | | |
97
+ | 3.0 | ✅ | ✅ | ✅ | ✅ | | | | |
98
+ | 3.1 | | | ✅ | ✅ | ✅ | | | |
99
+ | 3.2 | | | ✅ | ✅ | ✅ | ✅ | | |
100
+ | 3.3 | | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
101
+ | 3.4 | | | | | ✅ | ✅ | ✅ | ✅ |
102
+ | 4.x | | | | | | | ✅ | ✅ |
103
+ | Head | | | | | | | ✅ | ✅ |
107
104
 
108
105
  > Nota: O activemodel é uma dependência opcional, esse módulo que [pode ser habilitado](#u-casewith_activemodel_validation---como-validar-os-atributos-do-caso-de-uso) para validar os atributos dos casos de uso.
109
106
 
@@ -124,7 +121,7 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
124
121
  Adicione essa linha ao Gemfile da sua aplicação:
125
122
 
126
123
  ```ruby
127
- gem 'u-case', '~> 4.5.1'
124
+ gem 'u-case', '~> 5.0'
128
125
  ```
129
126
 
130
127
  E então execute:
data/Rakefile CHANGED
@@ -7,4 +7,32 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList["test/**/*_test.rb"]
8
8
  end
9
9
 
10
- task :default => :test
10
+ require "appraisal/task"
11
+
12
+ Appraisal::Task.new
13
+
14
+ desc "Run the full test suite in all supported Rails versions (both transitions modes)"
15
+ task :matrix do
16
+ appraisals =
17
+ if RUBY_VERSION < "3.1"
18
+ ["rails-6-0", "rails-6-1"]
19
+ elsif RUBY_VERSION < "3.2"
20
+ ["rails-7-0", "rails-7-1", "rails-7-2"]
21
+ elsif RUBY_VERSION < "3.3"
22
+ ["rails-7-0", "rails-7-1", "rails-7-2", "rails-8-0"]
23
+ elsif RUBY_VERSION < "3.4"
24
+ ["rails-7-0", "rails-7-1", "rails-7-2", "rails-8-0", "rails-8-1", "rails-edge"]
25
+ elsif RUBY_VERSION < "4.0"
26
+ ["rails-7-2", "rails-8-0", "rails-8-1", "rails-edge"]
27
+ else
28
+ ["rails-8-1", "rails-edge"]
29
+ end
30
+
31
+ appraisals.each do |appraisal|
32
+ ["true", "false"].each do |transitions|
33
+ sh({"ENABLE_TRANSITIONS" => transitions}, "bundle exec appraisal #{appraisal} rake test")
34
+ end
35
+ end
36
+ end
37
+
38
+ task default: :test
data/bin/matrix ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ ruby -v
7
+
8
+ rm -f Gemfile.lock
9
+
10
+ bundle install
11
+
12
+ bundle exec appraisal update
13
+
14
+ bundle exec rake matrix
15
+
16
+ ruby -v
data/bin/setup CHANGED
@@ -3,6 +3,10 @@ set -euo pipefail
3
3
  IFS=$'\n\t'
4
4
  set -vx
5
5
 
6
+ rm -f Gemfile.lock
7
+
6
8
  bundle install
7
9
 
10
+ bundle exec appraisal install
11
+
8
12
  # Do any other automated setup that you need to do here
@@ -0,0 +1,19 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 13.0"
6
+
7
+ group :test do
8
+ gem "simplecov", "~> 0.22.0", require: false
9
+ gem "sqlite3", "~> 2.9"
10
+ gem "ostruct", "~> 0.6.3"
11
+ gem "minitest", "~> 6.0"
12
+ gem "activerecord", "~> 8.1.0", require: "active_record"
13
+ end
14
+
15
+ group :development, :test do
16
+ gem "awesome_print"
17
+ end
18
+
19
+ gemspec path: "../"
@@ -0,0 +1,19 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 13.0"
6
+
7
+ group :test do
8
+ gem "simplecov", "~> 0.22.0", require: false
9
+ gem "sqlite3", "~> 2.9"
10
+ gem "ostruct", "~> 0.6.3"
11
+ gem "minitest", "~> 6.0"
12
+ gem "activerecord", branch: "main", require: "active_record", git: "https://github.com/rails/rails"
13
+ end
14
+
15
+ group :development, :test do
16
+ gem "awesome_print"
17
+ end
18
+
19
+ gemspec path: "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Micro
4
4
  class Case
5
- VERSION = '4.5.2'.freeze
5
+ VERSION = '5.0.0'.freeze
6
6
  end
7
7
  end
data/u-case.gemspec CHANGED
@@ -23,11 +23,12 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.required_ruby_version = '>= 2.2.0'
26
+ spec.required_ruby_version = '>= 2.7.0'
27
27
 
28
- spec.add_runtime_dependency 'kind', '>= 5.6', '< 6.0'
29
- spec.add_runtime_dependency 'u-attributes', '>= 2.7', '< 3.0'
28
+ spec.add_runtime_dependency 'kind', '>= 5.6', '< 7.0'
29
+ spec.add_runtime_dependency 'u-attributes', '>= 2.7', '< 4.0'
30
30
 
31
+ spec.add_development_dependency 'appraisal', '~> 2.5'
31
32
  spec.add_development_dependency 'bundler'
32
33
  spec.add_development_dependency 'rake', '~> 13.0'
33
34
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: u-case
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.2
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serradura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: kind
@@ -19,7 +18,7 @@ dependencies:
19
18
  version: '5.6'
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '6.0'
21
+ version: '7.0'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +28,7 @@ dependencies:
29
28
  version: '5.6'
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '6.0'
31
+ version: '7.0'
33
32
  - !ruby/object:Gem::Dependency
34
33
  name: u-attributes
35
34
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +38,7 @@ dependencies:
39
38
  version: '2.7'
40
39
  - - "<"
41
40
  - !ruby/object:Gem::Version
42
- version: '3.0'
41
+ version: '4.0'
43
42
  type: :runtime
44
43
  prerelease: false
45
44
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +48,21 @@ dependencies:
49
48
  version: '2.7'
50
49
  - - "<"
51
50
  - !ruby/object:Gem::Version
52
- version: '3.0'
51
+ version: '4.0'
52
+ - !ruby/object:Gem::Dependency
53
+ name: appraisal
54
+ requirement: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "~>"
57
+ - !ruby/object:Gem::Version
58
+ version: '2.5'
59
+ type: :development
60
+ prerelease: false
61
+ version_requirements: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - "~>"
64
+ - !ruby/object:Gem::Version
65
+ version: '2.5'
53
66
  - !ruby/object:Gem::Dependency
54
67
  name: bundler
55
68
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +103,7 @@ files:
90
103
  - ".gitignore"
91
104
  - ".tool-versions"
92
105
  - ".vscode/settings.json"
106
+ - Appraisals
93
107
  - CODE_OF_CONDUCT.md
94
108
  - Gemfile
95
109
  - LICENSE.txt
@@ -97,9 +111,10 @@ files:
97
111
  - README.pt-BR.md
98
112
  - Rakefile
99
113
  - bin/console
100
- - bin/prepare_coverage
114
+ - bin/matrix
101
115
  - bin/setup
102
- - bin/test
116
+ - gemfiles/rails_8_1.gemfile
117
+ - gemfiles/rails_edge.gemfile
103
118
  - lib/micro/case.rb
104
119
  - lib/micro/case/config.rb
105
120
  - lib/micro/case/error.rb
@@ -124,7 +139,6 @@ homepage: https://github.com/serradura/u-case
124
139
  licenses:
125
140
  - MIT
126
141
  metadata: {}
127
- post_install_message:
128
142
  rdoc_options: []
129
143
  require_paths:
130
144
  - lib
@@ -132,15 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
146
  requirements:
133
147
  - - ">="
134
148
  - !ruby/object:Gem::Version
135
- version: 2.2.0
149
+ version: 2.7.0
136
150
  required_rubygems_version: !ruby/object:Gem::Requirement
137
151
  requirements:
138
152
  - - ">="
139
153
  - !ruby/object:Gem::Version
140
154
  version: '0'
141
155
  requirements: []
142
- rubygems_version: 3.3.22
143
- signing_key:
156
+ rubygems_version: 4.0.7
144
157
  specification_version: 4
145
158
  summary: Represent use cases in a simple and powerful way while writing modular, expressive
146
159
  and sequentially logical code.
data/bin/prepare_coverage DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
- # Borrowed from https://gist.github.com/qortex/7e7c49f3731391a91ee898336183acef
4
-
5
- # Temporary hack to get CodeClimate to work with SimpleCov 0.18 JSON format until issue is fixed
6
- # upstream: https://github.com/codeclimate/test-reporter/issues/413
7
-
8
- require "json"
9
-
10
- filename = "coverage/.resultset.json"
11
- contents = JSON.parse(File.read(filename))
12
-
13
- def remove_lines_key(obj)
14
- case obj
15
- when Hash
16
- obj.transform_values do |val|
17
- val.is_a?(Hash) && val.key?("lines") ? val["lines"] : remove_lines_key(val)
18
- end
19
- else
20
- obj
21
- end
22
- end
23
-
24
- # overwrite
25
- File.write(filename, JSON.generate(remove_lines_key(contents)))
26
-
27
- puts Dir['coverage/.*.json']
data/bin/test DELETED
@@ -1,53 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- RUBY_V=$(ruby -v)
6
-
7
- function reset_gemfile_and_test {
8
- rm Gemfile.lock
9
-
10
- eval "$1 bundle update"
11
- eval "$1 ENABLE_TRANSITIONS=true bundle exec rake test"
12
- eval "$1 ENABLE_TRANSITIONS=false bundle exec rake test"
13
- }
14
-
15
- function test_with_activerecord {
16
- reset_gemfile_and_test "ACTIVERECORD_VERSION=$1"
17
- }
18
-
19
- RUBY_2_2345="ruby 2.[2345]."
20
- RUBY_2_234="ruby 2.[234]."
21
- RUBY_2_567="ruby 2.[567]."
22
- RUBY_2_23="ruby 2.[23]."
23
- RUBY_2_2="ruby 2.2."
24
- RUBY_3_01="ruby 3.[01]."
25
-
26
- if [[ $RUBY_V =~ $RUBY_2_2345 ]]; then
27
- if [[ $RUBY_V =~ $RUBY_2_234 ]]; then
28
- reset_gemfile_and_test
29
- fi
30
-
31
- if [[ $RUBY_V =~ $RUBY_2_2 ]]; then
32
- test_with_activerecord "3.2"
33
- fi
34
-
35
- if [[ $RUBY_V =~ $RUBY_2_23 ]]; then
36
- test_with_activerecord "4.0"
37
- test_with_activerecord "4.1"
38
- test_with_activerecord "4.2"
39
- fi
40
-
41
- test_with_activerecord "5.0"
42
- test_with_activerecord "5.1"
43
- test_with_activerecord "5.2"
44
- fi
45
-
46
- if [[ $RUBY_V =~ $RUBY_2_567 ]] || [[ $RUBY_V =~ $RUBY_3_01 ]]; then
47
- gem install bundler -v ">= 2" --no-doc
48
-
49
- reset_gemfile_and_test
50
-
51
- test_with_activerecord "6.0"
52
- test_with_activerecord "6.1"
53
- fi