interactor-initializer 1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +35 -0
- data/interactor-initializer.gemspec +1 -0
- data/lib/interactor/initializer/version.rb +1 -1
- data/lib/interactor/initializer.rb +3 -0
- data/spec/interactor/initializer_spec.rb +48 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dbb1b3df8198f7a2cf0dd09be4313c875d6ff41cd5dc4f2924becc9ca891002
|
4
|
+
data.tar.gz: 428648c94139a36bdc625ac7a442801fe200fff722ad6614c16c12372308a6ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aac43874ea1b6e9b1f5a2e90c0f8bfa5e65a3efba9a3568cdc3c864d20ac423f1dfdff2f4afc24d245b26083bcf1ae8bafb6de83defaaa274e62f271796d9d8
|
7
|
+
data.tar.gz: e5613dde388af09f4a7fb0f4985cbd8b6441ada98cb9163599f8a69c72a11788e9be186b9dbd4f695e13886b6fcf07dcf1708d876f9da0011a51ce4c0716234d
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.4
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
interactor-initializer (1.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.5.0)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.11.0)
|
12
|
+
rspec-core (~> 3.11.0)
|
13
|
+
rspec-expectations (~> 3.11.0)
|
14
|
+
rspec-mocks (~> 3.11.0)
|
15
|
+
rspec-core (3.11.0)
|
16
|
+
rspec-support (~> 3.11.0)
|
17
|
+
rspec-expectations (3.11.0)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.11.0)
|
20
|
+
rspec-mocks (3.11.0)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.11.0)
|
23
|
+
rspec-support (3.11.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler
|
30
|
+
interactor-initializer!
|
31
|
+
rake (~> 10.0)
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
2.2.33
|
@@ -7,6 +7,9 @@ module Interactor
|
|
7
7
|
module Initializer
|
8
8
|
def self.included(target_class)
|
9
9
|
target_class.extend ClassMethods
|
10
|
+
|
11
|
+
class_methods = Interactor::Initializer::Helper.methods_with_params
|
12
|
+
Interactor::Initializer::Helper.modify_class(target_class, '', [], class_methods)
|
10
13
|
end
|
11
14
|
|
12
15
|
module ClassMethods
|
@@ -106,4 +106,52 @@ describe Interactor::Initializer do
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
109
|
+
|
110
|
+
context 'with bare inclusion' do
|
111
|
+
let(:interactor) do
|
112
|
+
Class.new do
|
113
|
+
include Interactor::Initializer
|
114
|
+
|
115
|
+
def run
|
116
|
+
:result
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '.run' do
|
122
|
+
subject { interactor.run }
|
123
|
+
|
124
|
+
it { is_expected.to eq(:result) }
|
125
|
+
end
|
126
|
+
|
127
|
+
describe '.for' do
|
128
|
+
subject { interactor.for }
|
129
|
+
|
130
|
+
it { is_expected.to eq(:result) }
|
131
|
+
end
|
132
|
+
|
133
|
+
describe '.with' do
|
134
|
+
subject { interactor.with }
|
135
|
+
|
136
|
+
it { is_expected.to eq(:result) }
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'when class is not including interactor initializer' do
|
140
|
+
let(:interactor) do
|
141
|
+
Class.new do
|
142
|
+
def run
|
143
|
+
:result
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '.run' do
|
149
|
+
subject { interactor.run }
|
150
|
+
|
151
|
+
it 'cannot call interactor' do
|
152
|
+
expect { subject }.to raise_error(/undefined method/)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
109
157
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interactor-initializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Šarūnas Kūjalis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- ".rubocop.yml"
|
66
66
|
- ".ruby-version"
|
67
67
|
- Gemfile
|
68
|
+
- Gemfile.lock
|
68
69
|
- LICENSE
|
69
70
|
- README.md
|
70
71
|
- Rakefile
|