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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06bbbf8061978cb442a6dbd96a98c07bf4c856866674b7bd8719b76f3593ccef
4
- data.tar.gz: 64c95196b0f8217622cf027d25b036987dbf0f82b86da162f94043bf36235aeb
3
+ metadata.gz: f7cfb710dfbb840665b8980fbec49ec54e57b365b9ae2d57362921e08bc6d469
4
+ data.tar.gz: 2db3a03835c9e31a9b7027e539bb1b9da3578af5adb0fdfce8b95016f2191654
5
5
  SHA512:
6
- metadata.gz: db545b9c0870ada505a73f5b4420e534f702ebfc4f950c158e64f7bf55d32b51e526fcef3c428dda9e7d2818998431bb7d0fd7fd6c7ba1898d355bd9e8b8461c
7
- data.tar.gz: d8505d24ce6978a85043fa27a4ba2149ac86be5061819aff27377cb067a9cfb6edc2388a35c7015092603e4b4b0ff784c990807a729829137e8d3922b1627fcd
6
+ metadata.gz: 074f8fb7ce46be4b67ca8ffb1f0c0fe6e3d2e671469bbdbed66669da880aa1b22363a6bc66c7fa4210b1135a9d856b739d9585840fc28c1cf63d03f041f3f3ec
7
+ data.tar.gz: d83b0a8fdd0806d5a43a64a4be6e722661157380a3477c610d83323a016762acd425cb694bb5488beec60d98cfcf577034c967508d985d70417a79a01179f2a5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- steppy (1.0.3)
4
+ steppy (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -54,22 +54,22 @@ module Steppy
54
54
  end
55
55
 
56
56
  def step_after(key = nil, &block)
57
- step_add_callback(:after, block, key)
57
+ step_add_callback(:after, key, block)
58
58
  end
59
59
 
60
60
  def step_after_all(&block)
61
- step_add_callback(:after, block, :all)
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, block, key)
65
+ step_add_callback(:before, key, block)
66
66
  end
67
67
 
68
68
  def step_before_all(&block)
69
- step_add_callback(:before, block, :all)
69
+ step_add_callback(:before, :all, block)
70
70
  end
71
71
 
72
- def step_add_callback(type, block, key)
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, 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, result, args)
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, result, args = result)
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(result, args, &callback)
150
+ instance_exec(args, result, &callback)
151
151
  end
152
152
  end
153
153
 
154
154
  method_callbacks.each do |callback|
155
- instance_exec(result, args, &callback)
155
+ instance_exec(args, result, &callback)
156
156
  end
157
157
  end
158
158
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Steppy
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.4'
5
5
  end
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.3
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-02-28 00:00:00.000000000 Z
11
+ date: 2020-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler