use_case 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/use_case.rb +1 -1
- data/lib/use_case/outcome.rb +2 -3
- data/lib/use_case/version.rb +1 -1
- data/use_case.gemspec +0 -2
- metadata +63 -47
data/Gemfile.lock
CHANGED
data/lib/use_case.rb
CHANGED
@@ -98,7 +98,7 @@ module UseCase
|
|
98
98
|
def validate_params(input, validators)
|
99
99
|
validators.each do |validator|
|
100
100
|
result = validator.call(input)
|
101
|
-
return FailedOutcome.new(result
|
101
|
+
return FailedOutcome.new(result) if !result.valid?
|
102
102
|
end
|
103
103
|
nil
|
104
104
|
end
|
data/lib/use_case/outcome.rb
CHANGED
@@ -97,13 +97,12 @@ module UseCase
|
|
97
97
|
class FailedOutcome < Outcome
|
98
98
|
attr_reader :input
|
99
99
|
|
100
|
-
def initialize(errors = nil
|
100
|
+
def initialize(errors = nil)
|
101
101
|
@errors = errors
|
102
|
-
@input = input
|
103
102
|
end
|
104
103
|
|
105
104
|
def failure
|
106
|
-
yield @errors
|
105
|
+
yield @errors if block_given?
|
107
106
|
@errors
|
108
107
|
end
|
109
108
|
|
data/lib/use_case/version.rb
CHANGED
data/use_case.gemspec
CHANGED
metadata
CHANGED
@@ -1,54 +1,60 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_case
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 47
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 12
|
9
|
+
- 0
|
10
|
+
version: 0.12.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Christian Johansen
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-04-09 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: minitest
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '4'
|
22
|
-
type: :development
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
|
-
requirements:
|
26
|
+
requirements:
|
27
27
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 11
|
30
|
+
segments:
|
31
|
+
- 4
|
32
|
+
version: "4"
|
38
33
|
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rake
|
39
37
|
prerelease: false
|
40
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
description: ""
|
47
50
|
email: christian@gitorious.com
|
48
51
|
executables: []
|
52
|
+
|
49
53
|
extensions: []
|
54
|
+
|
50
55
|
extra_rdoc_files: []
|
51
|
-
|
56
|
+
|
57
|
+
files:
|
52
58
|
- Gemfile
|
53
59
|
- Gemfile.lock
|
54
60
|
- LICENSE
|
@@ -65,31 +71,41 @@ files:
|
|
65
71
|
- test/use_case/validator_test.rb
|
66
72
|
- test/use_case_test.rb
|
67
73
|
- use_case.gemspec
|
74
|
+
has_rdoc: true
|
68
75
|
homepage: http://gitorious.org/gitorious/use_case
|
69
76
|
licenses: []
|
77
|
+
|
70
78
|
post_install_message:
|
71
79
|
rdoc_options: []
|
72
|
-
|
80
|
+
|
81
|
+
require_paths:
|
73
82
|
- lib
|
74
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
84
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 3
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
93
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
hash: 3
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
86
101
|
requirements: []
|
102
|
+
|
87
103
|
rubyforge_project:
|
88
|
-
rubygems_version: 1.
|
104
|
+
rubygems_version: 1.4.2
|
89
105
|
signing_key:
|
90
106
|
specification_version: 3
|
91
|
-
summary:
|
92
|
-
test_files:
|
107
|
+
summary: ""
|
108
|
+
test_files:
|
93
109
|
- test/sample_use_case.rb
|
94
110
|
- test/test_helper.rb
|
95
111
|
- test/use_case/outcome_test.rb
|