interactor-initializer 1.0 → 1.1.1

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: 2a7524207f17039e7eda3b4e2ceb0a3f406c70da99c7776be2a3d042dd6dc474
4
- data.tar.gz: 23377afbee95423b6cab13e9d58137c1319e24bcefb7754b32a225308b28c09f
3
+ metadata.gz: 9dbb1b3df8198f7a2cf0dd09be4313c875d6ff41cd5dc4f2924becc9ca891002
4
+ data.tar.gz: 428648c94139a36bdc625ac7a442801fe200fff722ad6614c16c12372308a6ff
5
5
  SHA512:
6
- metadata.gz: 9533cbdd913a94086ec11affcb130704ac4f7603468aa5881f2dd1c0c2aa87132dda21e13f2ceedd8fccf993d006cf6fd8af0d89b34331ae691e467b4201b8ba
7
- data.tar.gz: 26f239fb44ac1a598cfe05eff32a0ba53ff8ac25c4dd1b06398ace36e38613e4d239c0fa800fa02d74158912d835639b51399d0a8b2687deb4b0db1226a860d1
6
+ metadata.gz: 8aac43874ea1b6e9b1f5a2e90c0f8bfa5e65a3efba9a3568cdc3c864d20ac423f1dfdff2f4afc24d245b26083bcf1ae8bafb6de83defaaa274e62f271796d9d8
7
+ data.tar.gz: e5613dde388af09f4a7fb0f4985cbd8b6441ada98cb9163599f8a69c72a11788e9be186b9dbd4f695e13886b6fcf07dcf1708d876f9da0011a51ce4c0716234d
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.2
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
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'interactor/initializer/version'
@@ -1,5 +1,5 @@
1
1
  module Interactor
2
2
  module Initializer
3
- VERSION = '1.0'.freeze
3
+ VERSION = '1.1.1'.freeze
4
4
  end
5
5
  end
@@ -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: '1.0'
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-01-21 00:00:00.000000000 Z
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