usecasing_validations 0.5.0
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 +15 -0
- data/.gitignore +19 -0
- data/.rspec +3 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +40 -0
- data/LICENSE.txt +22 -0
- data/README.md +1 -0
- data/Rakefile +6 -0
- data/lib/usecasing/depends_all.rb +21 -0
- data/lib/usecasing/validator.rb +31 -0
- data/lib/usecasing_validations/custom_validator.rb +21 -0
- data/lib/usecasing_validations/each_validator.rb +32 -0
- data/lib/usecasing_validations/errors.rb +364 -0
- data/lib/usecasing_validations/helpers.rb +50 -0
- data/lib/usecasing_validations/target.rb +44 -0
- data/lib/usecasing_validations/validations/format.rb +116 -0
- data/lib/usecasing_validations/validations/helper_methods.rb +16 -0
- data/lib/usecasing_validations/validations/length.rb +126 -0
- data/lib/usecasing_validations/validations/presence.rb +17 -0
- data/lib/usecasing_validations/validations/uniqueness.rb +56 -0
- data/lib/usecasing_validations/validator.rb +20 -0
- data/lib/usecasing_validations/version.rb +3 -0
- data/lib/usecasing_validations.rb +122 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/models/ruby_post.rb +9 -0
- data/spec/support/models/ruby_post_with_comments.rb +28 -0
- data/spec/support/usecases/validate_comments.rb +34 -0
- data/spec/support/usecases/validate_comments_custom_target.rb +14 -0
- data/spec/support/usecases/validate_depends_all.rb +24 -0
- data/spec/support/usecases/validate_post.rb +18 -0
- data/spec/support/usecases/validate_post_clear_errors.rb +9 -0
- data/spec/support/usecases/validate_uniq_comments.rb +77 -0
- data/spec/usecasing/validate_comments_custom_target_spec.rb +36 -0
- data/spec/usecasing/validate_comments_spec.rb +77 -0
- data/spec/usecasing/validate_depends_all_spec.rb +22 -0
- data/spec/usecasing/validate_post_clear_errors_spec.rb +48 -0
- data/spec/usecasing/validates_uniqueness_of_spec.rb +124 -0
- data/usecasing_validations.gemspec +29 -0
- metadata +166 -0
@@ -0,0 +1,77 @@
|
|
1
|
+
module ValidateUniqComments
|
2
|
+
|
3
|
+
class Basic < UseCase::Validator
|
4
|
+
|
5
|
+
target :comments, in: :post
|
6
|
+
|
7
|
+
validates_uniqueness_of :title
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
class CustomConditions < UseCase::Validator
|
12
|
+
|
13
|
+
target :comments, in: :post
|
14
|
+
|
15
|
+
validates_uniqueness_of :title, conditions: :similar_conditions
|
16
|
+
|
17
|
+
|
18
|
+
protected ##################### PROTECTED #######################
|
19
|
+
|
20
|
+
def similar_conditions(comment, other_comment)
|
21
|
+
comment.title == other_comment.title && comment.email == other_comment.email
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
class CustomScope < UseCase::Validator
|
27
|
+
|
28
|
+
target :comments, in: :post
|
29
|
+
|
30
|
+
validates_uniqueness_of :title, scope: :belongs_to_post_id1
|
31
|
+
|
32
|
+
|
33
|
+
protected ##################### PROTECTED #######################
|
34
|
+
|
35
|
+
def belongs_to_post_id1(comment)
|
36
|
+
comment.post_id == 1
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
class CustomScopeAndTarget < UseCase::Validator
|
42
|
+
|
43
|
+
def target
|
44
|
+
context.post.first_two_comments
|
45
|
+
end
|
46
|
+
|
47
|
+
validates_uniqueness_of :title, scope: :last_two_comments
|
48
|
+
|
49
|
+
|
50
|
+
protected ##################### PROTECTED #######################
|
51
|
+
|
52
|
+
def last_two_comments(comment)
|
53
|
+
[context.post.comments[-1], context.post.comments[-2]].include?(comment)
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
class CustomScopeAndConditions < UseCase::Validator
|
59
|
+
|
60
|
+
target :comments, in: :post
|
61
|
+
|
62
|
+
validates_uniqueness_of :title, scope: :belongs_to_post_id1, conditions: :similar_conditions
|
63
|
+
|
64
|
+
|
65
|
+
protected ##################### PROTECTED #######################
|
66
|
+
|
67
|
+
def similar_conditions(comment, other_comment)
|
68
|
+
comment.title == other_comment.title && comment.email == other_comment.email
|
69
|
+
end
|
70
|
+
|
71
|
+
def belongs_to_post_id1(comment)
|
72
|
+
comment.post_id == 1
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ValidateCommentsCustomTarget do
|
4
|
+
|
5
|
+
it "validations on a scoped set of instances of 'RubyComment' inside a 'RubyPost'" do
|
6
|
+
|
7
|
+
post = RubyPostWithComments.new([{ title: "title1", email: "teste1@gmail.com" }, { title: 'title2', email: 'teste2@gmail.com' }, { email: "fakemail" }])
|
8
|
+
context = ValidateCommentsCustomTarget.perform(post: post)
|
9
|
+
|
10
|
+
context.success?.should == true
|
11
|
+
|
12
|
+
comment1 = post.comments[0]
|
13
|
+
comment1.errors.empty?.should == true
|
14
|
+
comment2 = post.comments[1]
|
15
|
+
comment2.errors.empty?.should == true
|
16
|
+
|
17
|
+
|
18
|
+
post = RubyPostWithComments.new([{ email: "teste1@gmail.com" }, { title: 'title2', email: 'fakemail' }, { email: 'teste3@gmail.com' }])
|
19
|
+
context = ValidateCommentsCustomTarget.perform(post: post)
|
20
|
+
|
21
|
+
context.success?.should == false
|
22
|
+
|
23
|
+
comment1 = post.comments[0]
|
24
|
+
comment1.errors.added?(:title, :blank).should == true
|
25
|
+
comment1.errors.size.should == 1
|
26
|
+
|
27
|
+
comment2 = post.comments[1]
|
28
|
+
comment2.errors.added?(:email, :invalid).should == true
|
29
|
+
comment2.errors.size.should == 1
|
30
|
+
|
31
|
+
comment3 = post.comments[2]
|
32
|
+
comment3.respond_to?(:errors).should == false
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ValidateComments do
|
4
|
+
|
5
|
+
it "#validates_presence_of and #validates_format_of on multiple instances of 'RubyComment' inside a 'RubyPost'" do
|
6
|
+
|
7
|
+
post = RubyPostWithComments.new([{ title: "title1", email: "teste1@gmail.com" }, { title: 'title2', email: 'teste2@gmail.com' }])
|
8
|
+
context = ValidateComments.perform(post: post)
|
9
|
+
|
10
|
+
context.success?.should == true
|
11
|
+
|
12
|
+
comment1 = post.comments[0]
|
13
|
+
comment1.errors.empty?.should == true
|
14
|
+
comment2 = post.comments[1]
|
15
|
+
comment2.errors.empty?.should == true
|
16
|
+
|
17
|
+
|
18
|
+
post = RubyPostWithComments.new([{ title: "title1", email: "teste1@gmail.com" }, { title: 'title2', email: 'fakemail' }, { email: 'teste3@gmail.com' }])
|
19
|
+
context = ValidateComments.perform(post: post)
|
20
|
+
|
21
|
+
context.success?.should == false
|
22
|
+
|
23
|
+
comment1 = post.comments[0]
|
24
|
+
comment1.errors.empty?.should == true
|
25
|
+
|
26
|
+
comment2 = post.comments[1]
|
27
|
+
comment2.errors.added?(:email, "invalid format!").should == true
|
28
|
+
comment2.errors.size.should == 1
|
29
|
+
|
30
|
+
comment3 = post.comments[2]
|
31
|
+
comment3.errors.added?(:title, "can't be blank!").should == true
|
32
|
+
comment3.errors.size.should == 1
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
it "#validates_length_of on multiple instances of 'RubyComment' inside a 'RubyPost'" do
|
37
|
+
|
38
|
+
post = RubyPostWithComments.new([{ title: 'small', email: 'teste4@gmail.com' }])
|
39
|
+
context = ValidateComments.perform(post: post)
|
40
|
+
|
41
|
+
context.success?.should == false
|
42
|
+
|
43
|
+
comment1 = post.comments[0]
|
44
|
+
comment1.errors.added?(:title, :too_short).should == true
|
45
|
+
comment1.errors.size.should == 1
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
it "#validate on multiple instances of 'RubyComment' inside a 'RubyPost'" do
|
50
|
+
|
51
|
+
post = RubyPostWithComments.new([{ title: 'force_error1', email: 'teste4@gmail.com' }, { title: 'force_error2', email: 'force_error@gmail.com' }])
|
52
|
+
context = ValidateComments.perform(post: post)
|
53
|
+
|
54
|
+
context.success?.should == false
|
55
|
+
|
56
|
+
comment1 = post.comments[0]
|
57
|
+
comment1.errors.added?(:title, 'custom_validation1').should == true
|
58
|
+
comment1.errors.size.should == 1
|
59
|
+
|
60
|
+
comment2 = post.comments[1]
|
61
|
+
comment2.errors.added?(:title, 'custom_validation1').should == true
|
62
|
+
comment2.errors.added?(:email, 'custom_validation2').should == true
|
63
|
+
comment2.errors.size.should == 2
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
it "validating a empty target" do
|
68
|
+
|
69
|
+
post = RubyPostWithComments.new
|
70
|
+
context = ValidateComments.perform(post: post)
|
71
|
+
|
72
|
+
context.success?.should == true
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Group::ValidateDependsAll do
|
4
|
+
|
5
|
+
it "Validating multiple UseCase:Validators at the same time without one interrupting the other" do
|
6
|
+
|
7
|
+
post = RubyPost.new
|
8
|
+
context = Group::ValidateDependsAll.perform(post: post)
|
9
|
+
context.success?.should == false
|
10
|
+
post.errors.added?(:title, :blank).should == true
|
11
|
+
post.errors.added?(:body, :blank).should == true
|
12
|
+
post.errors.size.should == 2
|
13
|
+
|
14
|
+
post2 = RubyPost.new(title: 'title', body: 'body')
|
15
|
+
context = Group::ValidateDependsAll.perform(post: post2)
|
16
|
+
context.success?.should == true
|
17
|
+
post2.errors.empty?.should == true
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ValidatePostClearErrors do
|
4
|
+
|
5
|
+
it "#clean_Errors! will force the #valid? method to clear the target's errors at the start" do
|
6
|
+
|
7
|
+
post = RubyPost.new(body: 'body')
|
8
|
+
context = ValidatePostClearErrors.perform(post: post)
|
9
|
+
context.success?.should == false
|
10
|
+
post.errors.added?(:title, :blank).should == true
|
11
|
+
post.errors.size.should == 1
|
12
|
+
|
13
|
+
post.title = 'title'
|
14
|
+
post.body = ''
|
15
|
+
context = ValidatePostClearErrors.perform(post: post)
|
16
|
+
context.success?.should == false
|
17
|
+
post.errors.added?(:body, :blank).should == true
|
18
|
+
post.errors.size.should == 1
|
19
|
+
|
20
|
+
post.title = ''
|
21
|
+
context = ValidatePostClearErrors.perform(post: post)
|
22
|
+
context.success?.should == false
|
23
|
+
post.errors.added?(:title, :blank).should == true
|
24
|
+
post.errors.added?(:body, :blank).should == true
|
25
|
+
post.errors.size.should == 2
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
it "By default a Validator Class should not clean the target's errors" do
|
30
|
+
|
31
|
+
post = RubyPost.new(body: 'body')
|
32
|
+
context = ValidatePost.perform(post: post)
|
33
|
+
context.success?.should == false
|
34
|
+
post.errors.added?(:title, "can't be blank!").should == true
|
35
|
+
post.errors.size.should == 1
|
36
|
+
|
37
|
+
post.title = 'title'
|
38
|
+
post.body = ''
|
39
|
+
context = ValidatePost.perform(post: post)
|
40
|
+
context.success?.should == false
|
41
|
+
post.errors.added?(:title, "can't be blank!").should == true
|
42
|
+
post.errors.added?(:body, "can't be blank!").should == true
|
43
|
+
post.errors.size.should == 2
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1,124 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Several tests to the #validates_uniqueness_of' do
|
4
|
+
|
5
|
+
it "#validates_uniqueness_of basic usage" do
|
6
|
+
|
7
|
+
post = RubyPostWithComments.new([{ title: 'title1', email: 'teste1@gmail.com' }, { title: 'title1', email: 'teste2@gmail.com' }])
|
8
|
+
context = ValidateUniqComments::Basic.perform(post: post)
|
9
|
+
|
10
|
+
context.success?.should == false
|
11
|
+
|
12
|
+
comment1 = post.comments[0]
|
13
|
+
comment1.errors.added?(:title, :taken).should == true
|
14
|
+
comment1.errors.size.should == 1
|
15
|
+
|
16
|
+
comment2 = post.comments[1]
|
17
|
+
comment2.errors.added?(:title, :taken).should == true
|
18
|
+
comment2.errors.size.should == 1
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
it "#validates_uniqueness_of with a custom conditions" do
|
23
|
+
|
24
|
+
post = RubyPostWithComments.new([{ title: 'title1', email: 'teste1@gmail.com' }, { title: 'title1', email: 'teste1@gmail.com' }, { title: 'title1', email: 'teste2@gmail.com' }])
|
25
|
+
context = ValidateUniqComments::CustomConditions.perform(post: post)
|
26
|
+
|
27
|
+
context.success?.should == false
|
28
|
+
|
29
|
+
comment1 = post.comments[0]
|
30
|
+
comment1.errors.added?(:title, :taken).should == true
|
31
|
+
comment1.errors.size.should == 1
|
32
|
+
|
33
|
+
comment2 = post.comments[1]
|
34
|
+
comment2.errors.added?(:title, :taken).should == true
|
35
|
+
comment2.errors.size.should == 1
|
36
|
+
|
37
|
+
comment3 = post.comments[2]
|
38
|
+
comment3.errors.empty?.should == true
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
it "#validates_uniqueness_of with a custom scope" do
|
43
|
+
|
44
|
+
post = RubyPostWithComments.new([{ title: 'title1', post_id: 1 }, { title: 'title1' }])
|
45
|
+
context = ValidateUniqComments::CustomScope.perform(post: post)
|
46
|
+
|
47
|
+
context.success?.should == true
|
48
|
+
|
49
|
+
comment1 = post.comments[0]
|
50
|
+
comment1.errors.empty?.should == true
|
51
|
+
|
52
|
+
comment2 = post.comments[1]
|
53
|
+
comment2.errors.empty?.should == true
|
54
|
+
|
55
|
+
|
56
|
+
post = RubyPostWithComments.new([{ title: 'title1', post_id: 1 }, { title: 'title1' }, { title: 'title1', post_id: 1 }])
|
57
|
+
context = ValidateUniqComments::CustomScope.perform(post: post)
|
58
|
+
|
59
|
+
context.success?.should == false
|
60
|
+
|
61
|
+
comment1 = post.comments[0]
|
62
|
+
comment1.errors.added?(:title, :taken).should == true
|
63
|
+
comment1.errors.size.should == 1
|
64
|
+
|
65
|
+
comment2 = post.comments[1]
|
66
|
+
comment2.errors.empty?.should == true
|
67
|
+
|
68
|
+
comment3 = post.comments[0]
|
69
|
+
comment3.errors.added?(:title, :taken).should == true
|
70
|
+
comment3.errors.size.should == 1
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
it "#validates_uniqueness_of with a custom scope and custom target" do
|
75
|
+
|
76
|
+
post = RubyPostWithComments.new([{ title: 'title1' }, { title: 'title2' }, { title: 'title1' }, { title: 'title3' }, { title: 'title4' }])
|
77
|
+
context = ValidateUniqComments::CustomScopeAndTarget.perform(post: post)
|
78
|
+
|
79
|
+
context.success?.should == true
|
80
|
+
|
81
|
+
comment1 = post.comments[0]
|
82
|
+
comment1.errors.empty?.should == true
|
83
|
+
|
84
|
+
comment2 = post.comments[1]
|
85
|
+
comment2.errors.empty?.should == true
|
86
|
+
|
87
|
+
comment3 = post.comments[2]
|
88
|
+
comment3.respond_to?(:errors)
|
89
|
+
|
90
|
+
comment4 = post.comments[3]
|
91
|
+
comment3.respond_to?(:errors)
|
92
|
+
|
93
|
+
comment5 = post.comments[4]
|
94
|
+
comment3.respond_to?(:errors)
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
it "#validates_uniqueness_of with a custom scope and custom conditions" do
|
99
|
+
|
100
|
+
post = RubyPostWithComments.new([{ title: 'title1', email: 'teste1@gmail.com', post_id: 1 }, { title: 'title1', email: 'teste1@gmail.com', post_id: 2 }, { title: 'title2', email: 'teste2@gmail.com', post_id: 1 }, { title: 'title2', email: 'teste2@gmail.com', post_id: 2 }, { title: 'title2', email: 'teste2@gmail.com', post_id: 1 }])
|
101
|
+
context = ValidateUniqComments::CustomScopeAndConditions.perform(post: post)
|
102
|
+
|
103
|
+
context.success?.should == false
|
104
|
+
|
105
|
+
comment1 = post.comments[0]
|
106
|
+
comment1.errors.empty?.should == true
|
107
|
+
|
108
|
+
comment2 = post.comments[1]
|
109
|
+
comment2.errors.empty?.should == true
|
110
|
+
|
111
|
+
comment3 = post.comments[2]
|
112
|
+
comment3.errors.added?(:title, :taken).should == true
|
113
|
+
comment3.errors.size.should == 1
|
114
|
+
|
115
|
+
comment4 = post.comments[3]
|
116
|
+
comment4.errors.empty?.should == true
|
117
|
+
|
118
|
+
comment5 = post.comments[4]
|
119
|
+
comment5.errors.added?(:title, :taken).should == true
|
120
|
+
comment5.errors.size.should == 1
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'usecasing_validations/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "usecasing_validations"
|
8
|
+
gem.version = UseCaseValidations::VERSION
|
9
|
+
gem.authors = ["João Gonçalves"]
|
10
|
+
gem.email = ["goncalves.joao@gmail.com"]
|
11
|
+
gem.description = %q{UseCase Gem Extention to add Rails like validations}
|
12
|
+
gem.summary = %q{UseCase Gem Extention to add Rails like validations}
|
13
|
+
gem.homepage = "https://github.com/goncalvesjoao/usecasing-validations"
|
14
|
+
gem.license = "MIT"
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
|
21
|
+
#development dependecy
|
22
|
+
gem.add_development_dependency "rspec"
|
23
|
+
gem.add_development_dependency "rake"
|
24
|
+
gem.add_development_dependency "mocha"
|
25
|
+
gem.add_development_dependency "pry"
|
26
|
+
|
27
|
+
gem.add_runtime_dependency 'usecasing', '0.1.4'
|
28
|
+
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: usecasing_validations
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- João Gonçalves
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mocha
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: usecasing
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.4
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.4
|
83
|
+
description: UseCase Gem Extention to add Rails like validations
|
84
|
+
email:
|
85
|
+
- goncalves.joao@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- .rspec
|
92
|
+
- .rvmrc
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- lib/usecasing/depends_all.rb
|
99
|
+
- lib/usecasing/validator.rb
|
100
|
+
- lib/usecasing_validations.rb
|
101
|
+
- lib/usecasing_validations/custom_validator.rb
|
102
|
+
- lib/usecasing_validations/each_validator.rb
|
103
|
+
- lib/usecasing_validations/errors.rb
|
104
|
+
- lib/usecasing_validations/helpers.rb
|
105
|
+
- lib/usecasing_validations/target.rb
|
106
|
+
- lib/usecasing_validations/validations/format.rb
|
107
|
+
- lib/usecasing_validations/validations/helper_methods.rb
|
108
|
+
- lib/usecasing_validations/validations/length.rb
|
109
|
+
- lib/usecasing_validations/validations/presence.rb
|
110
|
+
- lib/usecasing_validations/validations/uniqueness.rb
|
111
|
+
- lib/usecasing_validations/validator.rb
|
112
|
+
- lib/usecasing_validations/version.rb
|
113
|
+
- spec/spec_helper.rb
|
114
|
+
- spec/support/models/ruby_post.rb
|
115
|
+
- spec/support/models/ruby_post_with_comments.rb
|
116
|
+
- spec/support/usecases/validate_comments.rb
|
117
|
+
- spec/support/usecases/validate_comments_custom_target.rb
|
118
|
+
- spec/support/usecases/validate_depends_all.rb
|
119
|
+
- spec/support/usecases/validate_post.rb
|
120
|
+
- spec/support/usecases/validate_post_clear_errors.rb
|
121
|
+
- spec/support/usecases/validate_uniq_comments.rb
|
122
|
+
- spec/usecasing/validate_comments_custom_target_spec.rb
|
123
|
+
- spec/usecasing/validate_comments_spec.rb
|
124
|
+
- spec/usecasing/validate_depends_all_spec.rb
|
125
|
+
- spec/usecasing/validate_post_clear_errors_spec.rb
|
126
|
+
- spec/usecasing/validates_uniqueness_of_spec.rb
|
127
|
+
- usecasing_validations.gemspec
|
128
|
+
homepage: https://github.com/goncalvesjoao/usecasing-validations
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ! '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.1.10
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: UseCase Gem Extention to add Rails like validations
|
152
|
+
test_files:
|
153
|
+
- spec/spec_helper.rb
|
154
|
+
- spec/support/models/ruby_post.rb
|
155
|
+
- spec/support/models/ruby_post_with_comments.rb
|
156
|
+
- spec/support/usecases/validate_comments.rb
|
157
|
+
- spec/support/usecases/validate_comments_custom_target.rb
|
158
|
+
- spec/support/usecases/validate_depends_all.rb
|
159
|
+
- spec/support/usecases/validate_post.rb
|
160
|
+
- spec/support/usecases/validate_post_clear_errors.rb
|
161
|
+
- spec/support/usecases/validate_uniq_comments.rb
|
162
|
+
- spec/usecasing/validate_comments_custom_target_spec.rb
|
163
|
+
- spec/usecasing/validate_comments_spec.rb
|
164
|
+
- spec/usecasing/validate_depends_all_spec.rb
|
165
|
+
- spec/usecasing/validate_post_clear_errors_spec.rb
|
166
|
+
- spec/usecasing/validates_uniqueness_of_spec.rb
|