ii_interactor 2.3.0 → 2.4.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: c79c0121d27c8cad771bd23d536973d41104d55ee8a4b1abdaad5ebc1897e6ab
4
- data.tar.gz: 4b08ff80da16cd5f09862ed00ba37dcbd367150324d2b139dba6f5a26b7acd08
3
+ metadata.gz: 32e4ea9de0df4ef6b080ce031471796c332e57c307ff3899ee39e04da91a3fc8
4
+ data.tar.gz: b33e00ce1c7aaa1eed7753a2307f216fbc8bfeccb7dad2a6bf9467555eb0434e
5
5
  SHA512:
6
- metadata.gz: 714ad9fef43f166649520ca0bf3b03a6b8ad64ddde463e01e81da4ff804da3697809574a21f1ddd834619990735a158a3d70e36d37e68ff4ddbb5c1a1690655f
7
- data.tar.gz: 60026aa2fcec05c0ab74df69c853072c3aa90a8817b5bb926de2c87c02decfd76edc5865e90da78257b2aba82c4ffc65a51c30f25e706dc7af5030f3a9b692d7
6
+ metadata.gz: f0f17c787b82bd2ec3f83b502819c0dd97c7256b02efc5e54647fc0a871a01e8ddae41b18086ef1972117f239a7acbbf64816d399791b975173a2e6afab0aea5
7
+ data.tar.gz: '0594bac0ab5a4d91ea4de8d9c8458f9c7c87e1f1fca3b52923f4782276e886b42f7c422c8a1d97672bb12b3a99a5d514107f9f0bbebc88dff7477112ea42a519'
@@ -8,57 +8,19 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3]
12
- gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71']
11
+ ruby: ['3.0', 3.1, 3.2, 3.3, 3.4, '4.0']
12
+ gemfile: ['rails70', 'rails71', 'rails72', 'rails80', 'rails81']
13
13
  exclude:
14
- - ruby: 2.3
15
- gemfile: rails60
16
- - ruby: 2.3
17
- gemfile: rails61
18
- - ruby: 2.3
19
- gemfile: rails70
20
- - ruby: 2.3
21
- gemfile: rails71
22
- - ruby: 2.4
23
- gemfile: rails60
24
- - ruby: 2.4
25
- gemfile: rails61
26
- - ruby: 2.4
27
- gemfile: rails70
28
- - ruby: 2.4
29
- gemfile: rails71
30
- - ruby: 2.5
31
- gemfile: rails70
32
- - ruby: 2.5
33
- gemfile: rails71
34
- - ruby: 2.6
35
- gemfile: rails70
36
- - ruby: 2.6
37
- gemfile: rails71
38
14
  - ruby: 3.0
39
- gemfile: rails50
15
+ gemfile: rails72
40
16
  - ruby: 3.0
41
- gemfile: rails51
17
+ gemfile: rails80
42
18
  - ruby: 3.0
43
- gemfile: rails52
19
+ gemfile: rails81
44
20
  - ruby: 3.1
45
- gemfile: rails50
21
+ gemfile: rails80
46
22
  - ruby: 3.1
47
- gemfile: rails51
48
- - ruby: 3.1
49
- gemfile: rails52
50
- - ruby: 3.2
51
- gemfile: rails50
52
- - ruby: 3.2
53
- gemfile: rails51
54
- - ruby: 3.2
55
- gemfile: rails52
56
- - ruby: 3.3
57
- gemfile: rails50
58
- - ruby: 3.3
59
- gemfile: rails51
60
- - ruby: 3.3
61
- gemfile: rails52
23
+ gemfile: rails81
62
24
 
63
25
  name: ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
64
26
 
@@ -71,6 +33,9 @@ jobs:
71
33
  with:
72
34
  ruby-version: ${{ matrix.ruby }}
73
35
  bundler-cache: true
36
+ - name: Bundle list
37
+ run: |
38
+ bundle list
74
39
  - name: Run test
75
40
  run: |
76
41
  DEBUG=1 bundle exec rspec
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.4.0
4
+
5
+ * Drop support for ruby <= 2.7, rails <= 6.1.
6
+
7
+ ## 2.3.1
8
+
9
+ * Deprecate `context_in` and `context_out`. Use `context` instead.
10
+
3
11
  ## 2.3.0
4
12
 
5
13
  * Change name of instrumentation for rails 7.1.
data/Gemfile CHANGED
@@ -1,3 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem "rails", ">= 7.0"
6
+ gem "sqlite3"
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -6,8 +6,8 @@ This gem is inspired by [interactor](https://github.com/collectiveidea/interacto
6
6
 
7
7
  ## Dependencies
8
8
 
9
- * ruby 2.3+
10
- * activesupport 5.0+
9
+ * ruby 3.0+
10
+ * activesupport 7.0+
11
11
 
12
12
  ## Installation
13
13
 
@@ -27,8 +27,8 @@ Create interactor with `call` method and call it as follows:
27
27
 
28
28
  ```ruby
29
29
  class Interactor < IIInteractor::Base
30
- context_in :message
31
- context_out :result
30
+ context :message
31
+ context :result
32
32
 
33
33
  def call
34
34
  @context.result = "called by #{@context.message}"
@@ -36,15 +36,14 @@ class Interactor < IIInteractor::Base
36
36
  end
37
37
 
38
38
  Interactor.call(message: 'something')
39
- #=> #<IIInteractor::Context message="something", result="called by something">
39
+ #=> #<IIInteractor::Context @_data={:message=>"something", :result=>"called by something"}>
40
40
  ```
41
41
 
42
42
  The first argument of `Interactor.call` is set to `@context`.
43
43
  The return value of `Interactor.call` is the same as `@context`.
44
44
 
45
- You can define context variables used in interactor explicitly.
46
- `context_in` copies context to instance variables of interactor,
47
- while `context_out` copies instance variables of interactor to context.
45
+ You can define context variables used in interactor explicitly by using the `context` method.
46
+ `context` method copies the input variables to instance variables of the interactor.
48
47
 
49
48
  ### Context options
50
49
 
@@ -52,18 +51,18 @@ You can define required context as follows:
52
51
 
53
52
  ```ruby
54
53
  class Interactor < IIInteractor::Base
55
- context_in :input, required: true
54
+ context :input, required: true
56
55
  end
57
56
 
58
57
  Interactor.call
59
- #=> IIInteractor::RequiredContextError (missing required context: input2)
58
+ #=> missing required context: input (Coactive::MissingContextError)
60
59
  ```
61
60
 
62
61
  You can also define default value as follows:
63
62
 
64
63
  ```ruby
65
64
  class Interactor < IIInteractor::Base
66
- context_in :input, default: 'input'
65
+ context :input, default: 'input'
67
66
 
68
67
  def call
69
68
  puts @input
@@ -78,7 +77,7 @@ You can also set context from return value of `call` method:
78
77
 
79
78
  ```ruby
80
79
  class Interactor < IIInteractor::Base
81
- context_out :result, from_return: true
80
+ context :result, output: :return
82
81
 
83
82
  def call
84
83
  'returned value'
@@ -139,6 +138,8 @@ end
139
138
  class MainInteractor < IIInteractor::Base
140
139
  coact AInteractor
141
140
  coact BInteractor
141
+
142
+ context :message
142
143
  end
143
144
 
144
145
  context = MainInteractor.call
@@ -182,6 +183,8 @@ end
182
183
  class MainInteractor < IIInteractor::Base
183
184
  coact AInteractor
184
185
  coact BInteractor
186
+
187
+ context :message
185
188
  end
186
189
 
187
190
  context = MainInteractor.call
@@ -208,6 +211,8 @@ For example:
208
211
 
209
212
  ```ruby
210
213
  class Interactor < IIInteractor::Base
214
+ context :message
215
+
211
216
  before_all do
212
217
  puts "before_all"
213
218
  end
data/Rakefile CHANGED
File without changes
@@ -3,4 +3,13 @@ source 'https://rubygems.org'
3
3
  gem "rails", "~> 7.0.1"
4
4
  gem "sqlite3", "~> 1.4.0"
5
5
 
6
+ gem "concurrent-ruby", "<= 1.3.4"
7
+
8
+ if RUBY_VERSION >= "3.4"
9
+ gem "bigdecimal"
10
+ gem "base64"
11
+ gem "drb"
12
+ gem "mutex_m"
13
+ end
14
+
6
15
  gemspec path: "../"
File without changes
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem "rails", "~> 6.1.0"
4
- gem "sqlite3", "~> 1.4.0"
3
+ gem "rails", "~> 7.2.0"
4
+ gem "sqlite3"
5
5
 
6
6
  gemspec path: "../"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 8.0.0"
4
+ gem "sqlite3"
5
+
6
+ gemspec path: "../"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 8.1.0"
4
+ gem "sqlite3"
5
+
6
+ gemspec path: "../"
@@ -17,12 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "activesupport", ">= 5.0"
20
+ spec.required_ruby_version = ">= 3.0"
21
+
22
+ spec.add_dependency "activesupport", ">= 7.0"
21
23
  spec.add_dependency "coactive", ">= 0.3"
22
24
 
23
- spec.add_development_dependency "rails", ">= 5.0"
24
- spec.add_development_dependency "sqlite3"
25
25
  spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency "rspec-rails"
27
27
  spec.add_development_dependency "simplecov"
28
+ spec.add_development_dependency "logger"
28
29
  end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -13,6 +13,7 @@ module IIInteractor
13
13
 
14
14
  class_methods do
15
15
  def context_in(*names, **options)
16
+ warn "DEPRECATION WARNING: 'context_in' is deprecated. Use 'context :x' instead. (#{caller[0]})"
16
17
  context(*names, **options)
17
18
  end
18
19
 
@@ -20,6 +21,9 @@ module IIInteractor
20
21
  options[:output] = true
21
22
  if options.delete(:from_return)
22
23
  options[:output] = :return
24
+ warn "DEPRECATION WARNING: 'context_out' is deprecated. Use 'context :x, output: :return' instead. (#{caller[0]})"
25
+ else
26
+ warn "DEPRECATION WARNING: 'context_out' is deprecated. Use 'context :x, output: true' instead. (#{caller[0]})"
23
27
  end
24
28
  context(*names, **options)
25
29
  end
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IIInteractor
4
- VERSION = '2.3.0'
4
+ VERSION = '2.4.0'
5
5
  end
data/lib/ii_interactor.rb CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ii_interactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-06-27 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: activesupport
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '5.0'
18
+ version: '7.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '5.0'
25
+ version: '7.0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: coactive
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -39,21 +38,7 @@ dependencies:
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0.3'
41
40
  - !ruby/object:Gem::Dependency
42
- name: rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '5.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '5.0'
55
- - !ruby/object:Gem::Dependency
56
- name: sqlite3
41
+ name: rake
57
42
  requirement: !ruby/object:Gem::Requirement
58
43
  requirements:
59
44
  - - ">="
@@ -67,7 +52,7 @@ dependencies:
67
52
  - !ruby/object:Gem::Version
68
53
  version: '0'
69
54
  - !ruby/object:Gem::Dependency
70
- name: rake
55
+ name: rspec-rails
71
56
  requirement: !ruby/object:Gem::Requirement
72
57
  requirements:
73
58
  - - ">="
@@ -81,7 +66,7 @@ dependencies:
81
66
  - !ruby/object:Gem::Version
82
67
  version: '0'
83
68
  - !ruby/object:Gem::Dependency
84
- name: rspec-rails
69
+ name: simplecov
85
70
  requirement: !ruby/object:Gem::Requirement
86
71
  requirements:
87
72
  - - ">="
@@ -95,7 +80,7 @@ dependencies:
95
80
  - !ruby/object:Gem::Version
96
81
  version: '0'
97
82
  - !ruby/object:Gem::Dependency
98
- name: simplecov
83
+ name: logger
99
84
  requirement: !ruby/object:Gem::Requirement
100
85
  requirements:
101
86
  - - ">="
@@ -123,15 +108,11 @@ files:
123
108
  - LICENSE
124
109
  - README.md
125
110
  - Rakefile
126
- - bin/console
127
- - bin/setup
128
- - gemfiles/rails50.gemfile
129
- - gemfiles/rails51.gemfile
130
- - gemfiles/rails52.gemfile
131
- - gemfiles/rails60.gemfile
132
- - gemfiles/rails61.gemfile
133
111
  - gemfiles/rails70.gemfile
134
112
  - gemfiles/rails71.gemfile
113
+ - gemfiles/rails72.gemfile
114
+ - gemfiles/rails80.gemfile
115
+ - gemfiles/rails81.gemfile
135
116
  - ii_interactor.gemspec
136
117
  - lib/ii_interactor.rb
137
118
  - lib/ii_interactor/base.rb
@@ -148,7 +129,6 @@ files:
148
129
  homepage: https://github.com/kanety/ii_interactor
149
130
  licenses: []
150
131
  metadata: {}
151
- post_install_message:
152
132
  rdoc_options: []
153
133
  require_paths:
154
134
  - lib
@@ -156,15 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
136
  requirements:
157
137
  - - ">="
158
138
  - !ruby/object:Gem::Version
159
- version: '0'
139
+ version: '3.0'
160
140
  required_rubygems_version: !ruby/object:Gem::Requirement
161
141
  requirements:
162
142
  - - ">="
163
143
  - !ruby/object:Gem::Version
164
144
  version: '0'
165
145
  requirements: []
166
- rubygems_version: 3.3.3
167
- signing_key:
146
+ rubygems_version: 3.6.9
168
147
  specification_version: 4
169
148
  summary: A base interactor to support management of bussiness logic
170
149
  test_files: []
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ii_interactor"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem "rails", "~> 5.0.0"
4
- gem "sqlite3", "~> 1.3.6"
5
- gem "loofah", "~> 2.19.1"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem "rails", "~> 5.1.0"
4
- gem "sqlite3", "~> 1.3.6"
5
- gem "loofah", "~> 2.19.1"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem "rails", "~> 5.2.0"
4
- gem "sqlite3", "~> 1.3.6"
5
- gem "loofah", "~> 2.19.1"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem "rails", "~> 6.0.0"
4
- gem "sqlite3", "~> 1.4.0"
5
- gem "psych", "~> 3.3.0"
6
-
7
- gemspec path: "../"