whyvalidationssuckin96 1.0.0 → 1.1.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.
- data/README.md +5 -0
- data/VERSION +1 -1
- data/doc/ActiveRecord.html +2 -2
- data/doc/ActiveRecord/RecordInvalid.html +2 -2
- data/doc/FalseClass.html +2 -2
- data/doc/NilClass.html +2 -2
- data/doc/Numeric.html +2 -2
- data/doc/Object.html +2 -2
- data/doc/String.html +2 -2
- data/doc/TrueClass.html +2 -2
- data/doc/WhyValidationsSuckIn96.html +4 -4
- data/doc/WhyValidationsSuckIn96/ActiveRecord.html +2 -2
- data/doc/WhyValidationsSuckIn96/ActiveRecord/InstanceMethods.html +2 -2
- data/doc/WhyValidationsSuckIn96/AttributeBasedValidation.html +2 -2
- data/doc/WhyValidationsSuckIn96/SkippableValidation.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesAcceptance.html +4 -4
- data/doc/WhyValidationsSuckIn96/ValidatesAssociated.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesConfirmation.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesExclusion.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesFormat.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesInclusion.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesLength.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesNumericality.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesPresence.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesUniqueness.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidatesUrl.html +251 -0
- data/doc/WhyValidationsSuckIn96/Validation.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidationBuilder.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidationSupport.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidationSupport/ClassMethods.html +2 -2
- data/doc/WhyValidationsSuckIn96/ValidationSupport/InstanceMethods.html +2 -2
- data/doc/_index.html +15 -8
- data/doc/class_list.html +17 -7
- data/doc/file.README.html +9 -3
- data/doc/index.html +9 -3
- data/doc/method_list.html +51 -41
- data/doc/top-level-namespace.html +2 -2
- data/lib/whyvalidationssuckin96/macros.rb +2 -1
- data/lib/whyvalidationssuckin96/macros/validates_url.rb +35 -0
- data/test/macros/validates_url_test.rb +86 -0
- data/whyvalidationssuckin96.gemspec +6 -2
- metadata +6 -2
data/README.md
CHANGED
|
@@ -116,6 +116,11 @@ Then you can define validations as expected in your model classes:
|
|
|
116
116
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
117
117
|
* Send me a pull request.
|
|
118
118
|
|
|
119
|
+
## Todo
|
|
120
|
+
|
|
121
|
+
* Investigate moving to a model where single instances of validations are created and passed the object to validate,
|
|
122
|
+
rather than the per-object validation scheme right now which _may_ be a bottleneck.
|
|
123
|
+
|
|
119
124
|
## Copying
|
|
120
125
|
|
|
121
126
|
Copyright (c) 2009 gabrielg/thumblemonks. See LICENSE for details.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.1.0
|
data/doc/ActiveRecord.html
CHANGED
|
@@ -84,9 +84,9 @@ ActiveRecord
|
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
<div id="footer">
|
|
87
|
-
Generated on
|
|
87
|
+
Generated on Mon Dec 21 16:56:20 2009 by
|
|
88
88
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
89
|
-
0.5.
|
|
89
|
+
0.5.0 (ruby-1.8.7).
|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
92
|
</body>
|
|
@@ -249,9 +249,9 @@ Returns the value of attribute record
|
|
|
249
249
|
</div>
|
|
250
250
|
|
|
251
251
|
<div id="footer">
|
|
252
|
-
Generated on
|
|
252
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
253
253
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
254
|
-
0.5.
|
|
254
|
+
0.5.0 (ruby-1.8.7).
|
|
255
255
|
</div>
|
|
256
256
|
|
|
257
257
|
</body>
|
data/doc/FalseClass.html
CHANGED
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div id="footer">
|
|
81
|
-
Generated on
|
|
81
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
82
82
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
83
|
-
0.5.
|
|
83
|
+
0.5.0 (ruby-1.8.7).
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
</body>
|
data/doc/NilClass.html
CHANGED
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div id="footer">
|
|
81
|
-
Generated on
|
|
81
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
82
82
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
83
|
-
0.5.
|
|
83
|
+
0.5.0 (ruby-1.8.7).
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
</body>
|
data/doc/Numeric.html
CHANGED
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div id="footer">
|
|
81
|
-
Generated on
|
|
81
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
82
82
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
83
|
-
0.5.
|
|
83
|
+
0.5.0 (ruby-1.8.7).
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
</body>
|
data/doc/Object.html
CHANGED
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
</div>
|
|
71
71
|
|
|
72
72
|
<div id="footer">
|
|
73
|
-
Generated on
|
|
73
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
74
74
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
75
|
-
0.5.
|
|
75
|
+
0.5.0 (ruby-1.8.7).
|
|
76
76
|
</div>
|
|
77
77
|
|
|
78
78
|
</body>
|
data/doc/String.html
CHANGED
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div id="footer">
|
|
81
|
-
Generated on
|
|
81
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
82
82
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
83
|
-
0.5.
|
|
83
|
+
0.5.0 (ruby-1.8.7).
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
</body>
|
data/doc/TrueClass.html
CHANGED
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
|
|
80
80
|
<div id="footer">
|
|
81
|
-
Generated on
|
|
81
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
82
82
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
83
|
-
0.5.
|
|
83
|
+
0.5.0 (ruby-1.8.7).
|
|
84
84
|
</div>
|
|
85
85
|
|
|
86
86
|
</body>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
<dt class="r1 last">Defined in:</dt>
|
|
54
54
|
<dd class="r1 last">lib/whyvalidationssuckin96/validation.rb<span class="defines">,<br />
|
|
55
|
-
lib/whyvalidationssuckin96/constants.rb,<br /> lib/whyvalidationssuckin96/validation_support.rb,<br /> lib/whyvalidationssuckin96/validation_builder.rb,<br /> lib/whyvalidationssuckin96/rails/active_record.rb,<br /> lib/whyvalidationssuckin96/skippable_validation.rb,<br /> lib/whyvalidationssuckin96/macros/
|
|
55
|
+
lib/whyvalidationssuckin96/constants.rb,<br /> lib/whyvalidationssuckin96/validation_support.rb,<br /> lib/whyvalidationssuckin96/validation_builder.rb,<br /> lib/whyvalidationssuckin96/rails/active_record.rb,<br /> lib/whyvalidationssuckin96/macros/validates_url.rb,<br /> lib/whyvalidationssuckin96/skippable_validation.rb,<br /> lib/whyvalidationssuckin96/macros/validates_length.rb,<br /> lib/whyvalidationssuckin96/macros/validates_format.rb,<br /> lib/whyvalidationssuckin96/macros/validates_presence.rb,<br /> lib/whyvalidationssuckin96/attribute_based_validation.rb,<br /> lib/whyvalidationssuckin96/macros/validates_inclusion.rb,<br /> lib/whyvalidationssuckin96/macros/validates_exclusion.rb,<br /> lib/whyvalidationssuckin96/macros/validates_associated.rb,<br /> lib/whyvalidationssuckin96/macros/validates_acceptance.rb,<br /> lib/whyvalidationssuckin96/macros/validates_numericality.rb,<br /> lib/whyvalidationssuckin96/macros/validates_confirmation.rb,<br /> lib/whyvalidationssuckin96/rails/macros/validates_uniqueness.rb</span>
|
|
56
56
|
</dd>
|
|
57
57
|
|
|
58
58
|
</dl>
|
|
@@ -77,7 +77,7 @@ WhyValidationsSuckIn96
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
<strong class="classes">Classes:</strong> <a href="WhyValidationsSuckIn96/ValidatesAcceptance.html" title="ValidatesAcceptance">ValidatesAcceptance</a>, <a href="WhyValidationsSuckIn96/ValidatesAssociated.html" title="ValidatesAssociated">ValidatesAssociated</a>, <a href="WhyValidationsSuckIn96/ValidatesConfirmation.html" title="ValidatesConfirmation">ValidatesConfirmation</a>, <a href="WhyValidationsSuckIn96/ValidatesExclusion.html" title="ValidatesExclusion">ValidatesExclusion</a>, <a href="WhyValidationsSuckIn96/ValidatesFormat.html" title="ValidatesFormat">ValidatesFormat</a>, <a href="WhyValidationsSuckIn96/ValidatesInclusion.html" title="ValidatesInclusion">ValidatesInclusion</a>, <a href="WhyValidationsSuckIn96/ValidatesLength.html" title="ValidatesLength">ValidatesLength</a>, <a href="WhyValidationsSuckIn96/ValidatesNumericality.html" title="ValidatesNumericality">ValidatesNumericality</a>, <a href="WhyValidationsSuckIn96/ValidatesPresence.html" title="ValidatesPresence">ValidatesPresence</a>, <a href="WhyValidationsSuckIn96/ValidatesUniqueness.html" title="ValidatesUniqueness">ValidatesUniqueness</a>, <a href="WhyValidationsSuckIn96/Validation.html" title="Validation">Validation</a>, <a href="WhyValidationsSuckIn96/ValidationBuilder.html" title="ValidationBuilder">ValidationBuilder</a>
|
|
80
|
+
<strong class="classes">Classes:</strong> <a href="WhyValidationsSuckIn96/ValidatesAcceptance.html" title="ValidatesAcceptance">ValidatesAcceptance</a>, <a href="WhyValidationsSuckIn96/ValidatesAssociated.html" title="ValidatesAssociated">ValidatesAssociated</a>, <a href="WhyValidationsSuckIn96/ValidatesConfirmation.html" title="ValidatesConfirmation">ValidatesConfirmation</a>, <a href="WhyValidationsSuckIn96/ValidatesExclusion.html" title="ValidatesExclusion">ValidatesExclusion</a>, <a href="WhyValidationsSuckIn96/ValidatesFormat.html" title="ValidatesFormat">ValidatesFormat</a>, <a href="WhyValidationsSuckIn96/ValidatesInclusion.html" title="ValidatesInclusion">ValidatesInclusion</a>, <a href="WhyValidationsSuckIn96/ValidatesLength.html" title="ValidatesLength">ValidatesLength</a>, <a href="WhyValidationsSuckIn96/ValidatesNumericality.html" title="ValidatesNumericality">ValidatesNumericality</a>, <a href="WhyValidationsSuckIn96/ValidatesPresence.html" title="ValidatesPresence">ValidatesPresence</a>, <a href="WhyValidationsSuckIn96/ValidatesUniqueness.html" title="ValidatesUniqueness">ValidatesUniqueness</a>, <a href="WhyValidationsSuckIn96/ValidatesUrl.html" title="ValidatesUrl">ValidatesUrl</a>, <a href="WhyValidationsSuckIn96/Validation.html" title="Validation">Validation</a>, <a href="WhyValidationsSuckIn96/ValidationBuilder.html" title="ValidationBuilder">ValidationBuilder</a>
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
</p>
|
|
@@ -88,9 +88,9 @@ WhyValidationsSuckIn96
|
|
|
88
88
|
</div>
|
|
89
89
|
|
|
90
90
|
<div id="footer">
|
|
91
|
-
Generated on
|
|
91
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
92
92
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
93
|
-
0.5.
|
|
93
|
+
0.5.0 (ruby-1.8.7).
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
96
|
</body>
|
|
@@ -183,9 +183,9 @@ validates_numericality_of validates_presence_of validates_length_of]</span>
|
|
|
183
183
|
</div>
|
|
184
184
|
|
|
185
185
|
<div id="footer">
|
|
186
|
-
Generated on
|
|
186
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
187
187
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
188
|
-
0.5.
|
|
188
|
+
0.5.0 (ruby-1.8.7).
|
|
189
189
|
</div>
|
|
190
190
|
|
|
191
191
|
</body>
|
|
@@ -147,9 +147,9 @@ InstanceMethods
|
|
|
147
147
|
</div>
|
|
148
148
|
|
|
149
149
|
<div id="footer">
|
|
150
|
-
Generated on
|
|
150
|
+
Generated on Mon Dec 21 16:56:20 2009 by
|
|
151
151
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
152
|
-
0.5.
|
|
152
|
+
0.5.0 (ruby-1.8.7).
|
|
153
153
|
</div>
|
|
154
154
|
|
|
155
155
|
</body>
|
|
@@ -455,9 +455,9 @@ values if :allow_nil or :allow_blank have been set.
|
|
|
455
455
|
</div>
|
|
456
456
|
|
|
457
457
|
<div id="footer">
|
|
458
|
-
Generated on
|
|
458
|
+
Generated on Mon Dec 21 16:56:22 2009 by
|
|
459
459
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
460
|
-
0.5.
|
|
460
|
+
0.5.0 (ruby-1.8.7).
|
|
461
461
|
</div>
|
|
462
462
|
|
|
463
463
|
</body>
|
|
@@ -185,9 +185,9 @@ Validate unless a given method on the validatable object returns true
|
|
|
185
185
|
</div>
|
|
186
186
|
|
|
187
187
|
<div id="footer">
|
|
188
|
-
Generated on
|
|
188
|
+
Generated on Mon Dec 21 16:56:20 2009 by
|
|
189
189
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
190
|
-
0.5.
|
|
190
|
+
0.5.0 (ruby-1.8.7).
|
|
191
191
|
</div>
|
|
192
192
|
|
|
193
193
|
</body>
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
<h2>Overview</h2><div class="docstring">
|
|
81
81
|
<div class="discussion">
|
|
82
82
|
<p>
|
|
83
|
-
Validates the acceptance of an attribute, such as the
|
|
84
|
-
terms and conditions
|
|
83
|
+
Validates the acceptance of an attribute, such as the “I agree to the
|
|
84
|
+
terms and conditions” checkbox value returned by a form post.
|
|
85
85
|
</p>
|
|
86
86
|
|
|
87
87
|
|
|
@@ -245,9 +245,9 @@ Changing the :accept value
|
|
|
245
245
|
</div>
|
|
246
246
|
|
|
247
247
|
<div id="footer">
|
|
248
|
-
Generated on
|
|
248
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
249
249
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
250
|
-
0.5.
|
|
250
|
+
0.5.0 (ruby-1.8.7).
|
|
251
251
|
</div>
|
|
252
252
|
|
|
253
253
|
</body>
|
|
@@ -241,9 +241,9 @@ Checking the validity of an associated artist
|
|
|
241
241
|
</div>
|
|
242
242
|
|
|
243
243
|
<div id="footer">
|
|
244
|
-
Generated on
|
|
244
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
245
245
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
246
|
-
0.5.
|
|
246
|
+
0.5.0 (ruby-1.8.7).
|
|
247
247
|
</div>
|
|
248
248
|
|
|
249
249
|
</body>
|
|
@@ -242,9 +242,9 @@ Default usage
|
|
|
242
242
|
</div>
|
|
243
243
|
|
|
244
244
|
<div id="footer">
|
|
245
|
-
Generated on
|
|
245
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
246
246
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
247
|
-
0.5.
|
|
247
|
+
0.5.0 (ruby-1.8.7).
|
|
248
248
|
</div>
|
|
249
249
|
|
|
250
250
|
</body>
|
|
@@ -379,9 +379,9 @@ A collection to check against for exclusion.
|
|
|
379
379
|
</div>
|
|
380
380
|
|
|
381
381
|
<div id="footer">
|
|
382
|
-
Generated on
|
|
382
|
+
Generated on Mon Dec 21 16:56:20 2009 by
|
|
383
383
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
384
|
-
0.5.
|
|
384
|
+
0.5.0 (ruby-1.8.7).
|
|
385
385
|
</div>
|
|
386
386
|
|
|
387
387
|
</body>
|
|
@@ -378,9 +378,9 @@ A regular expression to check against
|
|
|
378
378
|
</div>
|
|
379
379
|
|
|
380
380
|
<div id="footer">
|
|
381
|
-
Generated on
|
|
381
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
382
382
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
383
|
-
0.5.
|
|
383
|
+
0.5.0 (ruby-1.8.7).
|
|
384
384
|
</div>
|
|
385
385
|
|
|
386
386
|
</body>
|
|
@@ -379,9 +379,9 @@ A collection to check against for inclusion.
|
|
|
379
379
|
</div>
|
|
380
380
|
|
|
381
381
|
<div id="footer">
|
|
382
|
-
Generated on
|
|
382
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
383
383
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
384
|
-
0.5.
|
|
384
|
+
0.5.0 (ruby-1.8.7).
|
|
385
385
|
</div>
|
|
386
386
|
|
|
387
387
|
</body>
|
|
@@ -460,9 +460,9 @@ against.
|
|
|
460
460
|
</div>
|
|
461
461
|
|
|
462
462
|
<div id="footer">
|
|
463
|
-
Generated on
|
|
463
|
+
Generated on Mon Dec 21 16:56:20 2009 by
|
|
464
464
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
465
|
-
0.5.
|
|
465
|
+
0.5.0 (ruby-1.8.7).
|
|
466
466
|
</div>
|
|
467
467
|
|
|
468
468
|
</body>
|
|
@@ -258,9 +258,9 @@ Only allow integer values
|
|
|
258
258
|
</div>
|
|
259
259
|
|
|
260
260
|
<div id="footer">
|
|
261
|
-
Generated on
|
|
261
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
262
262
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
263
|
-
0.5.
|
|
263
|
+
0.5.0 (ruby-1.8.7).
|
|
264
264
|
</div>
|
|
265
265
|
|
|
266
266
|
</body>
|
|
@@ -235,9 +235,9 @@ Default usage
|
|
|
235
235
|
</div>
|
|
236
236
|
|
|
237
237
|
<div id="footer">
|
|
238
|
-
Generated on
|
|
238
|
+
Generated on Mon Dec 21 16:56:20 2009 by
|
|
239
239
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
240
|
-
0.5.
|
|
240
|
+
0.5.0 (ruby-1.8.7).
|
|
241
241
|
</div>
|
|
242
242
|
|
|
243
243
|
</body>
|
|
@@ -280,9 +280,9 @@ When used with STI, check only uniqueness of records of the current type
|
|
|
280
280
|
</div>
|
|
281
281
|
|
|
282
282
|
<div id="footer">
|
|
283
|
-
Generated on
|
|
283
|
+
Generated on Mon Dec 21 16:56:21 2009 by
|
|
284
284
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
285
|
-
0.5.
|
|
285
|
+
0.5.0 (ruby-1.8.7).
|
|
286
286
|
</div>
|
|
287
287
|
|
|
288
288
|
</body>
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta name="Content-Type" content="text/html; charset=UTF-8" />
|
|
6
|
+
<title>Class: WhyValidationsSuckIn96::ValidatesUrl</title>
|
|
7
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
9
|
+
|
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
|
11
|
+
relpath = '..';
|
|
12
|
+
if (relpath != '') relpath += '/';
|
|
13
|
+
</script>
|
|
14
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
16
|
+
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="header">
|
|
20
|
+
<div id="menu">
|
|
21
|
+
|
|
22
|
+
<a href="../_index.html">Index (V)</a> »
|
|
23
|
+
<a href="../WhyValidationsSuckIn96.html" title="WhyValidationsSuckIn96">WhyValidationsSuckIn96</a>
|
|
24
|
+
»
|
|
25
|
+
<span class="title">ValidatesUrl</span>
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div id="search">
|
|
30
|
+
<a id="class_list_link" href="#">Namespace List</a>
|
|
31
|
+
<a id="method_list_link" href="#">Method List</a>
|
|
32
|
+
<a id ="file_list_link" href="#">File List</a>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="clear"></div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<iframe id="search_frame"></iframe>
|
|
39
|
+
|
|
40
|
+
<div id="content"><h1>Class: WhyValidationsSuckIn96::ValidatesUrl
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</h1>
|
|
44
|
+
|
|
45
|
+
<dl class="box">
|
|
46
|
+
|
|
47
|
+
<dt class="r1">Inherits:</dt>
|
|
48
|
+
<dd class="r1">
|
|
49
|
+
<span class="inheritName"><a href="Validation.html" title="WhyValidationsSuckIn96::Validation">WhyValidationsSuckIn96::Validation</a></span>
|
|
50
|
+
|
|
51
|
+
<ul class="fullTree">
|
|
52
|
+
<li><a href="../Object.html" title="Object">Object</a></li>
|
|
53
|
+
|
|
54
|
+
<li class="next"><a href="Validation.html" title="WhyValidationsSuckIn96::Validation">WhyValidationsSuckIn96::Validation</a></li>
|
|
55
|
+
|
|
56
|
+
<li class="next">WhyValidationsSuckIn96::ValidatesUrl</li>
|
|
57
|
+
|
|
58
|
+
</ul>
|
|
59
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
60
|
+
|
|
61
|
+
</dd>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
<dt class="r2">Includes:</dt>
|
|
69
|
+
<dd class="r2"><a href="AttributeBasedValidation.html" title="WhyValidationsSuckIn96::AttributeBasedValidation">WhyValidationsSuckIn96::AttributeBasedValidation</a>, <a href="SkippableValidation.html" title="WhyValidationsSuckIn96::SkippableValidation">WhyValidationsSuckIn96::SkippableValidation</a></dd>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
<dt class="r1 last">Defined in:</dt>
|
|
75
|
+
<dd class="r1 last">lib/whyvalidationssuckin96/macros/validates_url.rb</dd>
|
|
76
|
+
|
|
77
|
+
</dl>
|
|
78
|
+
<div class="clear"></div>
|
|
79
|
+
|
|
80
|
+
<h2>Overview</h2><div class="docstring">
|
|
81
|
+
<div class="discussion">
|
|
82
|
+
<p>
|
|
83
|
+
Checks whether a given attribute is a valid URL
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="tags">
|
|
90
|
+
|
|
91
|
+
<div class="examples">
|
|
92
|
+
<h3>Examples:</h3>
|
|
93
|
+
|
|
94
|
+
<h4>
|
|
95
|
+
Default usage
|
|
96
|
+
|
|
97
|
+
</h4>
|
|
98
|
+
<pre class="example code"> <span class='setup_validations identifier id'>setup_validations</span> <span class='do do kw'>do</span>
|
|
99
|
+
<span class='validates_as_url identifier id'>validates_as_url</span> <span class='symbol val'>:website</span>
|
|
100
|
+
<span class='end end kw'>end</span>
|
|
101
|
+
</pre>
|
|
102
|
+
|
|
103
|
+
<h4>
|
|
104
|
+
Specifying valid schemes instead of the defaults
|
|
105
|
+
|
|
106
|
+
</h4>
|
|
107
|
+
<pre class="example code"> <span class='setup_validations identifier id'>setup_validations</span> <span class='do do kw'>do</span>
|
|
108
|
+
<span class='validates_as_url identifier id'>validates_as_url</span> <span class='symbol val'>:website</span><span class='comma token'>,</span> <span class='symbol val'>:schemes</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='dstring node'>%w[ldap mailto]</span>
|
|
109
|
+
<span class='end end kw'>end</span>
|
|
110
|
+
</pre>
|
|
111
|
+
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
</div>
|
|
115
|
+
<h2>Constant Summary</h2>
|
|
116
|
+
|
|
117
|
+
<dl class="constants">
|
|
118
|
+
|
|
119
|
+
<dt id="DefaultOptions-constant ">DefaultOptions =
|
|
120
|
+
<span class="summary_desc"></span>
|
|
121
|
+
</dt>
|
|
122
|
+
<dd><pre class="code"><span class='lbrace token'>{</span><span class='symbol val'>:message</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"is not a valid URL"</span><span class='comma token'>,</span> <span class='symbol val'>:schemes</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='dstring node'>%w[http https]</span><span class='rbrace token'>}</span>
|
|
123
|
+
</pre></dd>
|
|
124
|
+
|
|
125
|
+
</dl>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<h3 class="inherited">Constants inherited from <a href="Validation.html" title="WhyValidationsSuckIn96::Validation">WhyValidationsSuckIn96::Validation</a></h3>
|
|
142
|
+
<p class="inherited"><a href="Validation.html#DefaultOptions-constant" title="DefaultOptions">DefaultOptions</a></p>
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<h2>Instance Method Summary</h2>
|
|
146
|
+
|
|
147
|
+
<ul class="summary">
|
|
148
|
+
|
|
149
|
+
<li class="public ">
|
|
150
|
+
<span class="summary_signature">
|
|
151
|
+
|
|
152
|
+
<a href="#validate-instance_method" title="#validate (instance method)">- (Object) <strong>validate</strong> </a>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
</span>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<span class="summary_desc"></span>
|
|
165
|
+
|
|
166
|
+
</li>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
</ul>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<h3 class="inherited">Methods included from <a href="AttributeBasedValidation.html" title="WhyValidationsSuckIn96::AttributeBasedValidation">WhyValidationsSuckIn96::AttributeBasedValidation</a></h3>
|
|
182
|
+
<p class="inherited"><a href="AttributeBasedValidation.html#attribute-instance_method" title="#attribute">#attribute</a>, <a href="AttributeBasedValidation.html#attribute_value-instance_method" title="#attribute_value">#attribute_value</a>, <a href="AttributeBasedValidation.html#initialize-instance_method" title="#initialize">#initialize</a></p>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
<h3 class="inherited">Methods inherited from <a href="Validation.html" title="WhyValidationsSuckIn96::Validation">WhyValidationsSuckIn96::Validation</a></h3>
|
|
190
|
+
<p class="inherited"><a href="Validation.html#failed%3F-instance_method" title="#failed?">#failed?</a>, <a href="Validation.html#has_run%3F-instance_method" title="#has_run?">#has_run?</a>, <a href="Validation.html#initialize-instance_method" title="#initialize">#initialize</a>, <a href="Validation.html#message-instance_method" title="#message">#message</a>, <a href="Validation.html#new_subclass-class_method" title="new_subclass">new_subclass</a>, <a href="Validation.html#passed%3F-instance_method" title="#passed?">#passed?</a>, <a href="Validation.html#validates%3F-instance_method" title="#validates?">#validates?</a></p>
|
|
191
|
+
<div id="constructor_details" class="method_details_list">
|
|
192
|
+
<h2>Constructor Details</h2>
|
|
193
|
+
|
|
194
|
+
<p class="notice">This class inherits a constructor from <a href="AttributeBasedValidation.html#initialize-instance_method" title="WhyValidationsSuckIn96::AttributeBasedValidation">WhyValidationsSuckIn96::AttributeBasedValidation</a></p>
|
|
195
|
+
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
<div id="instance_method_details" class="method_details_list">
|
|
200
|
+
<h2>Instance Method Details</h2>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<div class="method_details first">
|
|
204
|
+
<p class="signature first" id="validate-instance_method">
|
|
205
|
+
|
|
206
|
+
- (<tt><a href="../Object.html" title="Object">Object</a></tt>) <strong>validate</strong>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
</p><table class="source_code">
|
|
211
|
+
<tr>
|
|
212
|
+
<td>
|
|
213
|
+
<pre class="lines">
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
24
|
|
217
|
+
25
|
|
218
|
+
26
|
|
219
|
+
27
|
|
220
|
+
28
|
|
221
|
+
29
|
|
222
|
+
30</pre>
|
|
223
|
+
</td>
|
|
224
|
+
<td>
|
|
225
|
+
<pre class="code"><span class="info file"># File 'lib/whyvalidationssuckin96/macros/validates_url.rb', line 24</span>
|
|
226
|
+
|
|
227
|
+
<span class='def def kw'>def</span> <span class='validate identifier id'>validate</span>
|
|
228
|
+
<span class='super super kw'>super</span>
|
|
229
|
+
<span class='uri identifier id'>uri</span> <span class='assign token'>=</span> <span class='URI constant id'>URI</span><span class='dot token'>.</span><span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='attribute_value identifier id'>attribute_value</span><span class='rparen token'>)</span>
|
|
230
|
+
<span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:schemes</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='include? fid id'>include?</span><span class='lparen token'>(</span><span class='uri identifier id'>uri</span><span class='dot token'>.</span><span class='scheme identifier id'>scheme</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='pass identifier id'>pass</span> <span class='colon op'>:</span> <span class='fail identifier id'>fail</span>
|
|
231
|
+
<span class='rescue rescue kw'>rescue</span> <span class='URI constant id'>URI</span><span class='colon2 op'>::</span><span class='InvalidURIError constant id'>InvalidURIError</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='e identifier id'>e</span>
|
|
232
|
+
<span class='fail identifier id'>fail</span>
|
|
233
|
+
<span class='end end kw'>end</span>
|
|
234
|
+
</pre>
|
|
235
|
+
</td>
|
|
236
|
+
</tr>
|
|
237
|
+
</table>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div id="footer">
|
|
245
|
+
Generated on Mon Dec 21 16:56:22 2009 by
|
|
246
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
|
247
|
+
0.5.0 (ruby-1.8.7).
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
</body>
|
|
251
|
+
</html>
|