steppy 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/steppy/class_methods.rb +5 -5
- data/lib/steppy/instance_methods.rb +6 -6
- data/lib/steppy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7cfb710dfbb840665b8980fbec49ec54e57b365b9ae2d57362921e08bc6d469
|
4
|
+
data.tar.gz: 2db3a03835c9e31a9b7027e539bb1b9da3578af5adb0fdfce8b95016f2191654
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 074f8fb7ce46be4b67ca8ffb1f0c0fe6e3d2e671469bbdbed66669da880aa1b22363a6bc66c7fa4210b1135a9d856b739d9585840fc28c1cf63d03f041f3f3ec
|
7
|
+
data.tar.gz: d83b0a8fdd0806d5a43a64a4be6e722661157380a3477c610d83323a016762acd425cb694bb5488beec60d98cfcf577034c967508d985d70417a79a01179f2a5
|
data/Gemfile.lock
CHANGED
data/lib/steppy/class_methods.rb
CHANGED
@@ -54,22 +54,22 @@ module Steppy
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def step_after(key = nil, &block)
|
57
|
-
step_add_callback(:after,
|
57
|
+
step_add_callback(:after, key, block)
|
58
58
|
end
|
59
59
|
|
60
60
|
def step_after_all(&block)
|
61
|
-
step_add_callback(:after,
|
61
|
+
step_add_callback(:after, :all, block)
|
62
62
|
end
|
63
63
|
|
64
64
|
def step_before(key = nil, &block)
|
65
|
-
step_add_callback(:before,
|
65
|
+
step_add_callback(:before, key, block)
|
66
66
|
end
|
67
67
|
|
68
68
|
def step_before_all(&block)
|
69
|
-
step_add_callback(:before,
|
69
|
+
step_add_callback(:before, :all, block)
|
70
70
|
end
|
71
71
|
|
72
|
-
def step_add_callback(type,
|
72
|
+
def step_add_callback(type, key, block)
|
73
73
|
callback_key = key ? key.to_sym : :each
|
74
74
|
callbacks = step_callbacks[type][callback_key] ||= []
|
75
75
|
callbacks.push(block)
|
@@ -16,7 +16,7 @@ module Steppy
|
|
16
16
|
steppy_run(steppy_cache)
|
17
17
|
end
|
18
18
|
|
19
|
-
step_run_callbacks(:after, :all, attributes)
|
19
|
+
step_run_callbacks(:after, :all, attributes, result)
|
20
20
|
|
21
21
|
result
|
22
22
|
rescue StandardError => exception
|
@@ -126,7 +126,7 @@ module Steppy
|
|
126
126
|
return steppy_result
|
127
127
|
end
|
128
128
|
|
129
|
-
step_run_callbacks(:before, method, args
|
129
|
+
step_run_callbacks(:before, method, args)
|
130
130
|
|
131
131
|
result = if block
|
132
132
|
instance_exec(steppy_attributes, &block)
|
@@ -134,25 +134,25 @@ module Steppy
|
|
134
134
|
steppy_run_method(method, steppy_attributes)
|
135
135
|
end
|
136
136
|
|
137
|
-
step_run_callbacks(:after, method,
|
137
|
+
step_run_callbacks(:after, method, args, result)
|
138
138
|
|
139
139
|
steppy_set(args[:set], result)
|
140
140
|
|
141
141
|
result
|
142
142
|
end
|
143
143
|
|
144
|
-
def step_run_callbacks(type, method,
|
144
|
+
def step_run_callbacks(type, method, args, result = nil)
|
145
145
|
callbacks = step_callbacks[type]
|
146
146
|
method_callbacks = callbacks[method] || []
|
147
147
|
|
148
148
|
if method != :all
|
149
149
|
callbacks[:each].each do |callback|
|
150
|
-
instance_exec(
|
150
|
+
instance_exec(args, result, &callback)
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
154
154
|
method_callbacks.each do |callback|
|
155
|
-
instance_exec(
|
155
|
+
instance_exec(args, result, &callback)
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
data/lib/steppy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steppy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|