whyvalidationssuckin96 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +22 -0
- data/LICENSE +20 -0
- data/README.md +121 -0
- data/Rakefile +45 -0
- data/VERSION +1 -0
- data/doc/ActiveRecord/RecordInvalid.html +258 -0
- data/doc/ActiveRecord.html +93 -0
- data/doc/FalseClass.html +87 -0
- data/doc/NilClass.html +87 -0
- data/doc/Numeric.html +87 -0
- data/doc/Object.html +79 -0
- data/doc/String.html +87 -0
- data/doc/TrueClass.html +87 -0
- data/doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html +156 -0
- data/doc/WhyValidationsSuckIn96/ActiveRecord.html +192 -0
- data/doc/WhyValidationsSuckIn96/AttributeBasedValidation.html +464 -0
- data/doc/WhyValidationsSuckIn96/SkippableValidation.html +194 -0
- data/doc/WhyValidationsSuckIn96/ValidatesAcceptance.html +254 -0
- data/doc/WhyValidationsSuckIn96/ValidatesAssociated.html +250 -0
- data/doc/WhyValidationsSuckIn96/ValidatesConfirmation.html +251 -0
- data/doc/WhyValidationsSuckIn96/ValidatesExclusion.html +388 -0
- data/doc/WhyValidationsSuckIn96/ValidatesFormat.html +387 -0
- data/doc/WhyValidationsSuckIn96/ValidatesInclusion.html +388 -0
- data/doc/WhyValidationsSuckIn96/ValidatesLength.html +469 -0
- data/doc/WhyValidationsSuckIn96/ValidatesNumericality.html +267 -0
- data/doc/WhyValidationsSuckIn96/ValidatesPresence.html +244 -0
- data/doc/WhyValidationsSuckIn96/ValidatesUniqueness.html +289 -0
- data/doc/WhyValidationsSuckIn96/Validation.html +934 -0
- data/doc/WhyValidationsSuckIn96/ValidationBuilder.html +391 -0
- data/doc/WhyValidationsSuckIn96/ValidationSupport/ClassMethods.html +249 -0
- data/doc/WhyValidationsSuckIn96/ValidationSupport/InstanceMethods.html +484 -0
- data/doc/WhyValidationsSuckIn96/ValidationSupport.html +168 -0
- data/doc/WhyValidationsSuckIn96.html +97 -0
- data/doc/_index.html +346 -0
- data/doc/class_list.html +293 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +23 -0
- data/doc/css/style.css +263 -0
- data/doc/file.README.html +173 -0
- data/doc/file_list.html +29 -0
- data/doc/index.html +173 -0
- data/doc/js/app.js +91 -0
- data/doc/js/full_list.js +39 -0
- data/doc/js/jquery.js +19 -0
- data/doc/method_list.html +462 -0
- data/doc/top-level-namespace.html +81 -0
- data/lib/whyvalidationssuckin96/attribute_based_validation.rb +46 -0
- data/lib/whyvalidationssuckin96/constants.rb +3 -0
- data/lib/whyvalidationssuckin96/ext/blank.rb +47 -0
- data/lib/whyvalidationssuckin96/macros/validates_acceptance.rb +36 -0
- data/lib/whyvalidationssuckin96/macros/validates_associated.rb +33 -0
- data/lib/whyvalidationssuckin96/macros/validates_confirmation.rb +40 -0
- data/lib/whyvalidationssuckin96/macros/validates_exclusion.rb +38 -0
- data/lib/whyvalidationssuckin96/macros/validates_format.rb +38 -0
- data/lib/whyvalidationssuckin96/macros/validates_inclusion.rb +38 -0
- data/lib/whyvalidationssuckin96/macros/validates_length.rb +98 -0
- data/lib/whyvalidationssuckin96/macros/validates_numericality.rb +56 -0
- data/lib/whyvalidationssuckin96/macros/validates_presence.rb +30 -0
- data/lib/whyvalidationssuckin96/macros.rb +9 -0
- data/lib/whyvalidationssuckin96/rails/active_record.rb +94 -0
- data/lib/whyvalidationssuckin96/rails/macros/validates_uniqueness.rb +87 -0
- data/lib/whyvalidationssuckin96/rails/macros.rb +1 -0
- data/lib/whyvalidationssuckin96/skippable_validation.rb +59 -0
- data/lib/whyvalidationssuckin96/validation.rb +88 -0
- data/lib/whyvalidationssuckin96/validation_builder.rb +56 -0
- data/lib/whyvalidationssuckin96/validation_support.rb +74 -0
- data/lib/whyvalidationssuckin96.rb +4 -0
- data/test/attribute_based_validation_test.rb +58 -0
- data/test/macros/validates_acceptance_test.rb +64 -0
- data/test/macros/validates_associated_test.rb +60 -0
- data/test/macros/validates_confirmation_test.rb +63 -0
- data/test/macros/validates_exclusion_test.rb +37 -0
- data/test/macros/validates_format_test.rb +43 -0
- data/test/macros/validates_inclusion_test.rb +37 -0
- data/test/macros/validates_length_test.rb +179 -0
- data/test/macros/validates_numericality_test.rb +129 -0
- data/test/macros/validates_presence_test.rb +31 -0
- data/test/rails/active_record_test.rb +187 -0
- data/test/rails/active_record_test_helper.rb +90 -0
- data/test/rails/macros/validates_uniqueness_test.rb +153 -0
- data/test/skippable_validation_test.rb +102 -0
- data/test/teststrap.rb +4 -0
- data/test/validation_builder_test.rb +62 -0
- data/test/validation_support_test.rb +209 -0
- data/test/validation_test.rb +101 -0
- data/whyvalidationssuckin96.gemspec +153 -0
- metadata +189 -0
@@ -0,0 +1,209 @@
|
|
1
|
+
require 'teststrap'
|
2
|
+
|
3
|
+
context "validation_support" do
|
4
|
+
context "when mixed into a class" do
|
5
|
+
setup do
|
6
|
+
Class.new { include WhyValidationsSuckIn96::ValidationSupport }
|
7
|
+
end
|
8
|
+
|
9
|
+
should "add a 'validation_collection' method" do
|
10
|
+
topic
|
11
|
+
end.respond_to(:validation_collection)
|
12
|
+
|
13
|
+
should "add a 'setup_validations' method" do
|
14
|
+
topic
|
15
|
+
end.respond_to(:setup_validations)
|
16
|
+
|
17
|
+
should "add a 'valid?' instance method" do
|
18
|
+
topic.new
|
19
|
+
end.respond_to(:valid?)
|
20
|
+
|
21
|
+
should "add a 'invalid?' instance method" do
|
22
|
+
topic.new
|
23
|
+
end.respond_to(:invalid?)
|
24
|
+
|
25
|
+
should "add a 'failed_validations' instance method" do
|
26
|
+
topic.new
|
27
|
+
end.respond_to(:failed_validations)
|
28
|
+
|
29
|
+
should "add a 'passed_validations' instance method" do
|
30
|
+
topic.new
|
31
|
+
end.respond_to(:passed_validations)
|
32
|
+
|
33
|
+
should "add a 'all_validations' instance method" do
|
34
|
+
topic.new
|
35
|
+
end.respond_to(:all_validations)
|
36
|
+
|
37
|
+
should "have an empty validation collection" do
|
38
|
+
topic.validation_collection.size
|
39
|
+
end.equals(0)
|
40
|
+
|
41
|
+
should "be valid when no validations have been defined" do
|
42
|
+
topic.new.valid?
|
43
|
+
end
|
44
|
+
|
45
|
+
should "not be invalid when no validations have been defined" do
|
46
|
+
!topic.new.invalid?
|
47
|
+
end
|
48
|
+
end # mixed into a class
|
49
|
+
|
50
|
+
context "when mixed into a class and used to add a simple validation" do
|
51
|
+
setup do
|
52
|
+
Class.new do
|
53
|
+
attr_accessor :title
|
54
|
+
include WhyValidationsSuckIn96::ValidationSupport
|
55
|
+
setup_validations do
|
56
|
+
validate :title_is_present, :example => "the number song", :message => "title must be present" do
|
57
|
+
pass if validatable.title && !validatable.title.empty?
|
58
|
+
fail
|
59
|
+
end
|
60
|
+
end # setup_validations
|
61
|
+
end # Class.new
|
62
|
+
end # setup
|
63
|
+
|
64
|
+
should "have one validation in the validation_collection" do
|
65
|
+
topic.validation_collection.size
|
66
|
+
end.equals(1)
|
67
|
+
|
68
|
+
should "be able to reflect on the validation and find its name" do
|
69
|
+
topic.validation_collection.first.first.name
|
70
|
+
end.equals(:title_is_present)
|
71
|
+
|
72
|
+
should "be able to reflect on the validation and find its options" do
|
73
|
+
topic.validation_collection.first.last
|
74
|
+
end.equals(:example => "the number song", :message => "title must be present")
|
75
|
+
|
76
|
+
context "given an instance of the class" do
|
77
|
+
setup { topic.new }
|
78
|
+
|
79
|
+
should "have one entry for all validations" do
|
80
|
+
topic.all_validations.size
|
81
|
+
end.equals(1)
|
82
|
+
|
83
|
+
should "have all the entries for all validations be validation instances" do
|
84
|
+
topic.all_validations.all? { |validation| validation.kind_of?(WhyValidationsSuckIn96::Validation) }
|
85
|
+
end
|
86
|
+
|
87
|
+
should "not be valid without a title" do
|
88
|
+
topic.title = nil
|
89
|
+
!topic.valid?
|
90
|
+
end
|
91
|
+
|
92
|
+
should "be valid with a title" do
|
93
|
+
topic.title = "building steam with a grain of salt"
|
94
|
+
topic.valid?
|
95
|
+
end
|
96
|
+
|
97
|
+
should "have one passed validation with a title" do
|
98
|
+
topic.title = "building steam with a grain of salt"
|
99
|
+
topic.valid?
|
100
|
+
topic.passed_validations.size
|
101
|
+
end.equals(1)
|
102
|
+
|
103
|
+
should "have one failed validation without a title" do
|
104
|
+
topic.title = nil
|
105
|
+
topic.valid?
|
106
|
+
topic.failed_validations.size
|
107
|
+
end.equals(1)
|
108
|
+
end # given an instance of the class
|
109
|
+
end # when mixed into a class and used to add a simple validation
|
110
|
+
|
111
|
+
context "when extending a class with existing validations and adding new validations" do
|
112
|
+
parent_class = child_class = nil
|
113
|
+
|
114
|
+
setup do
|
115
|
+
parent_class = Class.new do
|
116
|
+
attr_accessor :artist
|
117
|
+
include WhyValidationsSuckIn96::ValidationSupport
|
118
|
+
setup_validations do
|
119
|
+
validate :artist_is_present, :example => "dj shadow", :message => "artist must be present" do
|
120
|
+
pass if validatable.artist && !validatable.artist.empty?
|
121
|
+
fail
|
122
|
+
end
|
123
|
+
end # setup_validations
|
124
|
+
end # parent_class
|
125
|
+
|
126
|
+
child_class = Class.new(parent_class) do
|
127
|
+
attr_accessor :title
|
128
|
+
setup_validations do
|
129
|
+
validate :title_is_present, :example => "the number song", :message => "title must be present" do
|
130
|
+
pass if validatable.title && !validatable.title.empty?
|
131
|
+
fail
|
132
|
+
end
|
133
|
+
end # setup_validations
|
134
|
+
end # child_class
|
135
|
+
end # setup
|
136
|
+
|
137
|
+
should "have only one validation in the collection for the base class" do
|
138
|
+
parent_class.validation_collection.size
|
139
|
+
end.equals(1)
|
140
|
+
|
141
|
+
should "have a validation for the artist in the base class" do
|
142
|
+
parent_class.validation_collection.detect {|(validation, opts)| validation.name == :artist_is_present }
|
143
|
+
end
|
144
|
+
|
145
|
+
should "have two validations in the collection for the child class" do
|
146
|
+
child_class.validation_collection.size
|
147
|
+
end.equals(2)
|
148
|
+
|
149
|
+
should "have a validation for the artist in the child class" do
|
150
|
+
child_class.validation_collection.detect {|(validation, opts)| validation.name == :artist_is_present }
|
151
|
+
end
|
152
|
+
|
153
|
+
should "have a validation for the title in the child class" do
|
154
|
+
child_class.validation_collection.detect {|(validation, opts)| validation.name == :title_is_present }
|
155
|
+
end
|
156
|
+
|
157
|
+
end # when extending a class with existing validations
|
158
|
+
|
159
|
+
context "when extending a class with existing validations and not adding new validations" do
|
160
|
+
parent_class = child_class = nil
|
161
|
+
|
162
|
+
setup do
|
163
|
+
parent_class = Class.new do
|
164
|
+
attr_accessor :artist
|
165
|
+
include WhyValidationsSuckIn96::ValidationSupport
|
166
|
+
setup_validations do
|
167
|
+
validate :artist_is_present, :example => "dj shadow", :message => "artist must be present" do
|
168
|
+
pass if validatable.artist && !validatable.artist.empty?
|
169
|
+
fail
|
170
|
+
end
|
171
|
+
end # setup_validations
|
172
|
+
end # parent_class
|
173
|
+
|
174
|
+
child_class = Class.new(parent_class)
|
175
|
+
end # setup
|
176
|
+
|
177
|
+
should "have the parent class' validations by default" do
|
178
|
+
child_class.validation_collection.size
|
179
|
+
end.equals(1)
|
180
|
+
|
181
|
+
end # when extending a class with existing validations and not adding new validations
|
182
|
+
|
183
|
+
context "when calling setup_validations twice in a class" do
|
184
|
+
setup do
|
185
|
+
Class.new do
|
186
|
+
include WhyValidationsSuckIn96::ValidationSupport
|
187
|
+
setup_validations do
|
188
|
+
validate(:first_validation) {}
|
189
|
+
end
|
190
|
+
setup_validations do
|
191
|
+
validate(:second_validation) {}
|
192
|
+
end
|
193
|
+
end # Class.new
|
194
|
+
end # setup
|
195
|
+
|
196
|
+
should "add two validations to the class" do
|
197
|
+
topic.validation_collection.size
|
198
|
+
end.equals(2)
|
199
|
+
|
200
|
+
should "have the first validation" do
|
201
|
+
topic.validation_collection.detect { |(validation, opts)| validation.name == :first_validation }
|
202
|
+
end
|
203
|
+
|
204
|
+
should "have the second validation" do
|
205
|
+
topic.validation_collection.detect { |(validation, opts)| validation.name == :second_validation }
|
206
|
+
end
|
207
|
+
|
208
|
+
end # when calling setup_validations twice in a class
|
209
|
+
end # validation_support
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'teststrap'
|
2
|
+
|
3
|
+
context "validation" do
|
4
|
+
context "creating a new subclass" do
|
5
|
+
setup do
|
6
|
+
WhyValidationsSuckIn96::Validation.new_subclass(:validates_rockingness, lambda {})
|
7
|
+
end
|
8
|
+
|
9
|
+
should "have a readable string returned by inspect" do
|
10
|
+
topic.new(Object.new).inspect
|
11
|
+
end.equals(/^#<WhyValidationsSuckIn96::Validation subclass for validating 'validates_rockingness'>/)
|
12
|
+
|
13
|
+
should "have a name on the new subclass" do
|
14
|
+
topic.name
|
15
|
+
end.equals(:validates_rockingness)
|
16
|
+
|
17
|
+
should "define validate as private on the new subclass" do
|
18
|
+
topic.private_instance_methods
|
19
|
+
end.includes("validate")
|
20
|
+
end # creating a new subclass
|
21
|
+
|
22
|
+
context "an instance of a subclass" do
|
23
|
+
setup do
|
24
|
+
WhyValidationsSuckIn96::Validation.new_subclass(:validates_rockingness, lambda {})
|
25
|
+
end
|
26
|
+
|
27
|
+
should "allow accessing the options via an instance method" do
|
28
|
+
topic.new(Object.new, :example => "stuff").options
|
29
|
+
end.equals(:example => "stuff")
|
30
|
+
|
31
|
+
should "return a true by default when pass/fail aren't called in the validation definition" do
|
32
|
+
topic.new(Object.new).validates?
|
33
|
+
end.equals(true)
|
34
|
+
|
35
|
+
should "be passed by default when pass/fail aren't called in the validation definition" do
|
36
|
+
validation = topic.new(Object.new)
|
37
|
+
validation.validates?
|
38
|
+
validation.passed?
|
39
|
+
end.equals(true)
|
40
|
+
|
41
|
+
should "not be passed if the validation hasn't run yet" do
|
42
|
+
topic.new(Object.new).passed?
|
43
|
+
end.equals(false)
|
44
|
+
|
45
|
+
should "not be failed if the validation hasn't run yet" do
|
46
|
+
topic.new(Object.new).failed?
|
47
|
+
end.equals(false)
|
48
|
+
|
49
|
+
should "not return true for has_run? if the validation hasn't run yet" do
|
50
|
+
topic.new(Object.new).has_run?
|
51
|
+
end.equals(false)
|
52
|
+
|
53
|
+
end # an instance of a subclass
|
54
|
+
|
55
|
+
context "an instance of a subclass with an actual validation definition" do
|
56
|
+
setup do
|
57
|
+
validation = lambda { validatable ? pass : fail }
|
58
|
+
WhyValidationsSuckIn96::Validation.new_subclass(:validates_rockingness, validation)
|
59
|
+
end
|
60
|
+
|
61
|
+
should "have validates? return true if the validation passes" do
|
62
|
+
validation = topic.new(true)
|
63
|
+
validation.validates?
|
64
|
+
end.equals(true)
|
65
|
+
|
66
|
+
should "be passed when run and pass is called" do
|
67
|
+
validation = topic.new(true)
|
68
|
+
validation.validates?
|
69
|
+
validation.passed?
|
70
|
+
end
|
71
|
+
|
72
|
+
should "have has_run? return true when the validation runs" do
|
73
|
+
validation = topic.new(true)
|
74
|
+
validation.validates?
|
75
|
+
validation.has_run?
|
76
|
+
end
|
77
|
+
|
78
|
+
should "have validates? return false if the validation fails" do
|
79
|
+
validation = topic.new(false)
|
80
|
+
validation.validates?
|
81
|
+
end.equals(false)
|
82
|
+
|
83
|
+
should "be failed when run and fail is called" do
|
84
|
+
validation = topic.new(false)
|
85
|
+
validation.validates?
|
86
|
+
validation.failed?
|
87
|
+
end
|
88
|
+
end # an instance of a subclass with an actual validation definition
|
89
|
+
|
90
|
+
context "an instance of a subclass with a validation definition that raises" do
|
91
|
+
setup do
|
92
|
+
validation = lambda { raise "hell" }
|
93
|
+
WhyValidationsSuckIn96::Validation.new_subclass(:validates_rockingness, validation)
|
94
|
+
end
|
95
|
+
|
96
|
+
should "raise an exception when validating" do
|
97
|
+
topic.new(Object.new).validates?
|
98
|
+
end.raises(RuntimeError, "hell")
|
99
|
+
|
100
|
+
end # an instance of a subclass with a validation definition that raises
|
101
|
+
end # validation
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{whyvalidationssuckin96}
|
8
|
+
s.version = "1.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["gabrielg", "douglasmeyer"]
|
12
|
+
s.date = %q{2009-12-20}
|
13
|
+
s.description = %q{A library for setting up model validations, such as in ActiveRecord.}
|
14
|
+
s.email = %q{gabriel.gironda@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.md",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"doc/ActiveRecord.html",
|
27
|
+
"doc/ActiveRecord/RecordInvalid.html",
|
28
|
+
"doc/FalseClass.html",
|
29
|
+
"doc/NilClass.html",
|
30
|
+
"doc/Numeric.html",
|
31
|
+
"doc/Object.html",
|
32
|
+
"doc/String.html",
|
33
|
+
"doc/TrueClass.html",
|
34
|
+
"doc/WhyValidationsSuckIn96.html",
|
35
|
+
"doc/WhyValidationsSuckIn96/ActiveRecord.html",
|
36
|
+
"doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html",
|
37
|
+
"doc/WhyValidationsSuckIn96/AttributeBasedValidation.html",
|
38
|
+
"doc/WhyValidationsSuckIn96/SkippableValidation.html",
|
39
|
+
"doc/WhyValidationsSuckIn96/ValidatesAcceptance.html",
|
40
|
+
"doc/WhyValidationsSuckIn96/ValidatesAssociated.html",
|
41
|
+
"doc/WhyValidationsSuckIn96/ValidatesConfirmation.html",
|
42
|
+
"doc/WhyValidationsSuckIn96/ValidatesExclusion.html",
|
43
|
+
"doc/WhyValidationsSuckIn96/ValidatesFormat.html",
|
44
|
+
"doc/WhyValidationsSuckIn96/ValidatesInclusion.html",
|
45
|
+
"doc/WhyValidationsSuckIn96/ValidatesLength.html",
|
46
|
+
"doc/WhyValidationsSuckIn96/ValidatesNumericality.html",
|
47
|
+
"doc/WhyValidationsSuckIn96/ValidatesPresence.html",
|
48
|
+
"doc/WhyValidationsSuckIn96/ValidatesUniqueness.html",
|
49
|
+
"doc/WhyValidationsSuckIn96/Validation.html",
|
50
|
+
"doc/WhyValidationsSuckIn96/ValidationBuilder.html",
|
51
|
+
"doc/WhyValidationsSuckIn96/ValidationSupport.html",
|
52
|
+
"doc/WhyValidationsSuckIn96/ValidationSupport/ClassMethods.html",
|
53
|
+
"doc/WhyValidationsSuckIn96/ValidationSupport/InstanceMethods.html",
|
54
|
+
"doc/_index.html",
|
55
|
+
"doc/class_list.html",
|
56
|
+
"doc/css/common.css",
|
57
|
+
"doc/css/full_list.css",
|
58
|
+
"doc/css/style.css",
|
59
|
+
"doc/file.README.html",
|
60
|
+
"doc/file_list.html",
|
61
|
+
"doc/index.html",
|
62
|
+
"doc/js/app.js",
|
63
|
+
"doc/js/full_list.js",
|
64
|
+
"doc/js/jquery.js",
|
65
|
+
"doc/method_list.html",
|
66
|
+
"doc/top-level-namespace.html",
|
67
|
+
"lib/whyvalidationssuckin96.rb",
|
68
|
+
"lib/whyvalidationssuckin96/attribute_based_validation.rb",
|
69
|
+
"lib/whyvalidationssuckin96/constants.rb",
|
70
|
+
"lib/whyvalidationssuckin96/ext/blank.rb",
|
71
|
+
"lib/whyvalidationssuckin96/macros.rb",
|
72
|
+
"lib/whyvalidationssuckin96/macros/validates_acceptance.rb",
|
73
|
+
"lib/whyvalidationssuckin96/macros/validates_associated.rb",
|
74
|
+
"lib/whyvalidationssuckin96/macros/validates_confirmation.rb",
|
75
|
+
"lib/whyvalidationssuckin96/macros/validates_exclusion.rb",
|
76
|
+
"lib/whyvalidationssuckin96/macros/validates_format.rb",
|
77
|
+
"lib/whyvalidationssuckin96/macros/validates_inclusion.rb",
|
78
|
+
"lib/whyvalidationssuckin96/macros/validates_length.rb",
|
79
|
+
"lib/whyvalidationssuckin96/macros/validates_numericality.rb",
|
80
|
+
"lib/whyvalidationssuckin96/macros/validates_presence.rb",
|
81
|
+
"lib/whyvalidationssuckin96/rails/active_record.rb",
|
82
|
+
"lib/whyvalidationssuckin96/rails/macros.rb",
|
83
|
+
"lib/whyvalidationssuckin96/rails/macros/validates_uniqueness.rb",
|
84
|
+
"lib/whyvalidationssuckin96/skippable_validation.rb",
|
85
|
+
"lib/whyvalidationssuckin96/validation.rb",
|
86
|
+
"lib/whyvalidationssuckin96/validation_builder.rb",
|
87
|
+
"lib/whyvalidationssuckin96/validation_support.rb",
|
88
|
+
"test/attribute_based_validation_test.rb",
|
89
|
+
"test/macros/validates_acceptance_test.rb",
|
90
|
+
"test/macros/validates_associated_test.rb",
|
91
|
+
"test/macros/validates_confirmation_test.rb",
|
92
|
+
"test/macros/validates_exclusion_test.rb",
|
93
|
+
"test/macros/validates_format_test.rb",
|
94
|
+
"test/macros/validates_inclusion_test.rb",
|
95
|
+
"test/macros/validates_length_test.rb",
|
96
|
+
"test/macros/validates_numericality_test.rb",
|
97
|
+
"test/macros/validates_presence_test.rb",
|
98
|
+
"test/rails/active_record_test.rb",
|
99
|
+
"test/rails/active_record_test_helper.rb",
|
100
|
+
"test/rails/macros/validates_uniqueness_test.rb",
|
101
|
+
"test/skippable_validation_test.rb",
|
102
|
+
"test/teststrap.rb",
|
103
|
+
"test/validation_builder_test.rb",
|
104
|
+
"test/validation_support_test.rb",
|
105
|
+
"test/validation_test.rb",
|
106
|
+
"whyvalidationssuckin96.gemspec"
|
107
|
+
]
|
108
|
+
s.homepage = %q{http://github.com/thumblemonks/whyvalidationssuckin96}
|
109
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
110
|
+
s.require_paths = ["lib"]
|
111
|
+
s.rubygems_version = %q{1.3.5}
|
112
|
+
s.summary = %q{An alternative implementation of object validations.}
|
113
|
+
s.test_files = [
|
114
|
+
"test/attribute_based_validation_test.rb",
|
115
|
+
"test/macros/validates_acceptance_test.rb",
|
116
|
+
"test/macros/validates_associated_test.rb",
|
117
|
+
"test/macros/validates_confirmation_test.rb",
|
118
|
+
"test/macros/validates_exclusion_test.rb",
|
119
|
+
"test/macros/validates_format_test.rb",
|
120
|
+
"test/macros/validates_inclusion_test.rb",
|
121
|
+
"test/macros/validates_length_test.rb",
|
122
|
+
"test/macros/validates_numericality_test.rb",
|
123
|
+
"test/macros/validates_presence_test.rb",
|
124
|
+
"test/rails/active_record_test.rb",
|
125
|
+
"test/rails/active_record_test_helper.rb",
|
126
|
+
"test/rails/macros/validates_uniqueness_test.rb",
|
127
|
+
"test/skippable_validation_test.rb",
|
128
|
+
"test/teststrap.rb",
|
129
|
+
"test/validation_builder_test.rb",
|
130
|
+
"test/validation_support_test.rb",
|
131
|
+
"test/validation_test.rb"
|
132
|
+
]
|
133
|
+
|
134
|
+
if s.respond_to? :specification_version then
|
135
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
136
|
+
s.specification_version = 3
|
137
|
+
|
138
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
139
|
+
s.add_development_dependency(%q<riot>, [">= 0"])
|
140
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
141
|
+
s.add_development_dependency(%q<activerecord>, [">= 2.3.0"])
|
142
|
+
else
|
143
|
+
s.add_dependency(%q<riot>, [">= 0"])
|
144
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
145
|
+
s.add_dependency(%q<activerecord>, [">= 2.3.0"])
|
146
|
+
end
|
147
|
+
else
|
148
|
+
s.add_dependency(%q<riot>, [">= 0"])
|
149
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
150
|
+
s.add_dependency(%q<activerecord>, [">= 2.3.0"])
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
metadata
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: whyvalidationssuckin96
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- gabrielg
|
8
|
+
- douglasmeyer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2009-12-20 00:00:00 -06:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: riot
|
18
|
+
type: :development
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: yard
|
28
|
+
type: :development
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: activerecord
|
38
|
+
type: :development
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.3.0
|
45
|
+
version:
|
46
|
+
description: A library for setting up model validations, such as in ActiveRecord.
|
47
|
+
email: gabriel.gironda@gmail.com
|
48
|
+
executables: []
|
49
|
+
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- LICENSE
|
54
|
+
- README.md
|
55
|
+
files:
|
56
|
+
- .document
|
57
|
+
- .gitignore
|
58
|
+
- LICENSE
|
59
|
+
- README.md
|
60
|
+
- Rakefile
|
61
|
+
- VERSION
|
62
|
+
- doc/ActiveRecord.html
|
63
|
+
- doc/ActiveRecord/RecordInvalid.html
|
64
|
+
- doc/FalseClass.html
|
65
|
+
- doc/NilClass.html
|
66
|
+
- doc/Numeric.html
|
67
|
+
- doc/Object.html
|
68
|
+
- doc/String.html
|
69
|
+
- doc/TrueClass.html
|
70
|
+
- doc/WhyValidationsSuckIn96.html
|
71
|
+
- doc/WhyValidationsSuckIn96/ActiveRecord.html
|
72
|
+
- doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html
|
73
|
+
- doc/WhyValidationsSuckIn96/AttributeBasedValidation.html
|
74
|
+
- doc/WhyValidationsSuckIn96/SkippableValidation.html
|
75
|
+
- doc/WhyValidationsSuckIn96/ValidatesAcceptance.html
|
76
|
+
- doc/WhyValidationsSuckIn96/ValidatesAssociated.html
|
77
|
+
- doc/WhyValidationsSuckIn96/ValidatesConfirmation.html
|
78
|
+
- doc/WhyValidationsSuckIn96/ValidatesExclusion.html
|
79
|
+
- doc/WhyValidationsSuckIn96/ValidatesFormat.html
|
80
|
+
- doc/WhyValidationsSuckIn96/ValidatesInclusion.html
|
81
|
+
- doc/WhyValidationsSuckIn96/ValidatesLength.html
|
82
|
+
- doc/WhyValidationsSuckIn96/ValidatesNumericality.html
|
83
|
+
- doc/WhyValidationsSuckIn96/ValidatesPresence.html
|
84
|
+
- doc/WhyValidationsSuckIn96/ValidatesUniqueness.html
|
85
|
+
- doc/WhyValidationsSuckIn96/Validation.html
|
86
|
+
- doc/WhyValidationsSuckIn96/ValidationBuilder.html
|
87
|
+
- doc/WhyValidationsSuckIn96/ValidationSupport.html
|
88
|
+
- doc/WhyValidationsSuckIn96/ValidationSupport/ClassMethods.html
|
89
|
+
- doc/WhyValidationsSuckIn96/ValidationSupport/InstanceMethods.html
|
90
|
+
- doc/_index.html
|
91
|
+
- doc/class_list.html
|
92
|
+
- doc/css/common.css
|
93
|
+
- doc/css/full_list.css
|
94
|
+
- doc/css/style.css
|
95
|
+
- doc/file.README.html
|
96
|
+
- doc/file_list.html
|
97
|
+
- doc/index.html
|
98
|
+
- doc/js/app.js
|
99
|
+
- doc/js/full_list.js
|
100
|
+
- doc/js/jquery.js
|
101
|
+
- doc/method_list.html
|
102
|
+
- doc/top-level-namespace.html
|
103
|
+
- lib/whyvalidationssuckin96.rb
|
104
|
+
- lib/whyvalidationssuckin96/attribute_based_validation.rb
|
105
|
+
- lib/whyvalidationssuckin96/constants.rb
|
106
|
+
- lib/whyvalidationssuckin96/ext/blank.rb
|
107
|
+
- lib/whyvalidationssuckin96/macros.rb
|
108
|
+
- lib/whyvalidationssuckin96/macros/validates_acceptance.rb
|
109
|
+
- lib/whyvalidationssuckin96/macros/validates_associated.rb
|
110
|
+
- lib/whyvalidationssuckin96/macros/validates_confirmation.rb
|
111
|
+
- lib/whyvalidationssuckin96/macros/validates_exclusion.rb
|
112
|
+
- lib/whyvalidationssuckin96/macros/validates_format.rb
|
113
|
+
- lib/whyvalidationssuckin96/macros/validates_inclusion.rb
|
114
|
+
- lib/whyvalidationssuckin96/macros/validates_length.rb
|
115
|
+
- lib/whyvalidationssuckin96/macros/validates_numericality.rb
|
116
|
+
- lib/whyvalidationssuckin96/macros/validates_presence.rb
|
117
|
+
- lib/whyvalidationssuckin96/rails/active_record.rb
|
118
|
+
- lib/whyvalidationssuckin96/rails/macros.rb
|
119
|
+
- lib/whyvalidationssuckin96/rails/macros/validates_uniqueness.rb
|
120
|
+
- lib/whyvalidationssuckin96/skippable_validation.rb
|
121
|
+
- lib/whyvalidationssuckin96/validation.rb
|
122
|
+
- lib/whyvalidationssuckin96/validation_builder.rb
|
123
|
+
- lib/whyvalidationssuckin96/validation_support.rb
|
124
|
+
- test/attribute_based_validation_test.rb
|
125
|
+
- test/macros/validates_acceptance_test.rb
|
126
|
+
- test/macros/validates_associated_test.rb
|
127
|
+
- test/macros/validates_confirmation_test.rb
|
128
|
+
- test/macros/validates_exclusion_test.rb
|
129
|
+
- test/macros/validates_format_test.rb
|
130
|
+
- test/macros/validates_inclusion_test.rb
|
131
|
+
- test/macros/validates_length_test.rb
|
132
|
+
- test/macros/validates_numericality_test.rb
|
133
|
+
- test/macros/validates_presence_test.rb
|
134
|
+
- test/rails/active_record_test.rb
|
135
|
+
- test/rails/active_record_test_helper.rb
|
136
|
+
- test/rails/macros/validates_uniqueness_test.rb
|
137
|
+
- test/skippable_validation_test.rb
|
138
|
+
- test/teststrap.rb
|
139
|
+
- test/validation_builder_test.rb
|
140
|
+
- test/validation_support_test.rb
|
141
|
+
- test/validation_test.rb
|
142
|
+
- whyvalidationssuckin96.gemspec
|
143
|
+
has_rdoc: true
|
144
|
+
homepage: http://github.com/thumblemonks/whyvalidationssuckin96
|
145
|
+
licenses: []
|
146
|
+
|
147
|
+
post_install_message:
|
148
|
+
rdoc_options:
|
149
|
+
- --charset=UTF-8
|
150
|
+
require_paths:
|
151
|
+
- lib
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: "0"
|
157
|
+
version:
|
158
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: "0"
|
163
|
+
version:
|
164
|
+
requirements: []
|
165
|
+
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 1.3.5
|
168
|
+
signing_key:
|
169
|
+
specification_version: 3
|
170
|
+
summary: An alternative implementation of object validations.
|
171
|
+
test_files:
|
172
|
+
- test/attribute_based_validation_test.rb
|
173
|
+
- test/macros/validates_acceptance_test.rb
|
174
|
+
- test/macros/validates_associated_test.rb
|
175
|
+
- test/macros/validates_confirmation_test.rb
|
176
|
+
- test/macros/validates_exclusion_test.rb
|
177
|
+
- test/macros/validates_format_test.rb
|
178
|
+
- test/macros/validates_inclusion_test.rb
|
179
|
+
- test/macros/validates_length_test.rb
|
180
|
+
- test/macros/validates_numericality_test.rb
|
181
|
+
- test/macros/validates_presence_test.rb
|
182
|
+
- test/rails/active_record_test.rb
|
183
|
+
- test/rails/active_record_test_helper.rb
|
184
|
+
- test/rails/macros/validates_uniqueness_test.rb
|
185
|
+
- test/skippable_validation_test.rb
|
186
|
+
- test/teststrap.rb
|
187
|
+
- test/validation_builder_test.rb
|
188
|
+
- test/validation_support_test.rb
|
189
|
+
- test/validation_test.rb
|