course 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/course.gemspec +1 -1
- data/lib/course/operation.rb +5 -5
- data/lib/course/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad44f95dc208533bb7e0c4dc183c9070e7773462
|
4
|
+
data.tar.gz: b0156df1ac01ccd9e49caedcc34824a5209a43fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 263b7fad2e80335b7683743da255a102619ece21d024569963ac397bec4e67d22ae9471a979881c1de41171948ea8242089b8722a08e77c877d44fe2391968d6
|
7
|
+
data.tar.gz: a7eab10d41e43aa1f0f5246a6d01b8f321b02dafe00c7bcb0b59bf8e81e66816d60a0d41933380414f250d611d019afec03b789109d801638ce91da2ee4fe366
|
data/course.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
27
|
spec.add_development_dependency 'awesome_print', '~> 1.7'
|
28
|
-
spec.add_development_dependency '
|
28
|
+
spec.add_development_dependency 'pry', '~> 0.11.3'
|
29
29
|
spec.add_development_dependency 'codecov', '~> 0'
|
30
30
|
spec.add_development_dependency 'bundler', '~> 1.14'
|
31
31
|
spec.add_development_dependency 'guard', '~> 2.14'
|
data/lib/course/operation.rb
CHANGED
@@ -21,7 +21,7 @@ module Course
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def call(*input, &block)
|
24
|
-
execute_steps(input, &block)
|
24
|
+
execute_steps(*input, &block)
|
25
25
|
return yield result if block_given?
|
26
26
|
result
|
27
27
|
end
|
@@ -37,22 +37,22 @@ module Course
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def execute_steps(*input)
|
40
|
-
@output = self.class.steps.inject(
|
40
|
+
@output = self.class.steps.inject(input, &method(:execute))
|
41
41
|
rescue FailureError => e
|
42
42
|
@failure = e.failure
|
43
43
|
end
|
44
44
|
|
45
45
|
def execute(next_input, step)
|
46
46
|
if step.method?
|
47
|
-
execute_step(method(step.target), next_input)
|
47
|
+
execute_step(method(step.target), *next_input)
|
48
48
|
elsif step.block?
|
49
|
-
execute_step(step.block, next_input)
|
49
|
+
execute_step(step.block, *next_input)
|
50
50
|
else
|
51
51
|
execute_operation(step.target, *next_input)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
def execute_step(next_step, input)
|
55
|
+
def execute_step(next_step, *input)
|
56
56
|
if input.is_a?(Array) && (next_step.arity == input.count || next_step.arity == -1)
|
57
57
|
next_step.call(*input)
|
58
58
|
else
|
data/lib/course/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: course
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arturo Guzman
|
@@ -26,19 +26,19 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.7'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: pry
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 0.11.3
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 0.11.3
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: codecov
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|