dm-validations 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/dm-validations.gemspec +8 -7
- data/lib/dm-validations.rb +3 -1
- data/lib/dm-validations/auto_validate.rb +1 -2
- data/lib/dm-validations/validators/format_validator.rb +0 -1
- data/lib/dm-validations/validators/generic_validator.rb +2 -2
- data/lib/dm-validations/validators/numeric_validator.rb +0 -2
- metadata +7 -7
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -12,13 +12,14 @@ begin
|
|
12
12
|
gem.email = 'vandenberg.guy [a] gmail [d] com'
|
13
13
|
gem.homepage = 'http://github.com/datamapper/%s' % gem.name
|
14
14
|
gem.authors = [ 'Guy van den Berg' ]
|
15
|
+
gem.has_rdoc = 'yard'
|
15
16
|
|
16
17
|
gem.rubyforge_project = 'datamapper'
|
17
18
|
|
18
|
-
gem.add_dependency 'dm-core', '~> 1.0.
|
19
|
+
gem.add_dependency 'dm-core', '~> 1.0.2'
|
19
20
|
|
20
21
|
gem.add_development_dependency 'rspec', '~> 1.3'
|
21
|
-
gem.add_development_dependency 'dm-types', '~> 1.0.
|
22
|
+
gem.add_development_dependency 'dm-types', '~> 1.0.2'
|
22
23
|
end
|
23
24
|
|
24
25
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/dm-validations.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-validations}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Guy van den Berg"]
|
@@ -163,6 +163,7 @@ Gem::Specification.new do |s|
|
|
163
163
|
"tasks/yard.rake",
|
164
164
|
"tasks/yardstick.rake"
|
165
165
|
]
|
166
|
+
s.has_rdoc = %q{yard}
|
166
167
|
s.homepage = %q{http://github.com/datamapper/dm-validations}
|
167
168
|
s.rdoc_options = ["--charset=UTF-8"]
|
168
169
|
s.require_paths = ["lib"]
|
@@ -285,18 +286,18 @@ Gem::Specification.new do |s|
|
|
285
286
|
s.specification_version = 3
|
286
287
|
|
287
288
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
288
|
-
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.
|
289
|
+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.2"])
|
289
290
|
s.add_development_dependency(%q<rspec>, ["~> 1.3"])
|
290
|
-
s.add_development_dependency(%q<dm-types>, ["~> 1.0.
|
291
|
+
s.add_development_dependency(%q<dm-types>, ["~> 1.0.2"])
|
291
292
|
else
|
292
|
-
s.add_dependency(%q<dm-core>, ["~> 1.0.
|
293
|
+
s.add_dependency(%q<dm-core>, ["~> 1.0.2"])
|
293
294
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
294
|
-
s.add_dependency(%q<dm-types>, ["~> 1.0.
|
295
|
+
s.add_dependency(%q<dm-types>, ["~> 1.0.2"])
|
295
296
|
end
|
296
297
|
else
|
297
|
-
s.add_dependency(%q<dm-core>, ["~> 1.0.
|
298
|
+
s.add_dependency(%q<dm-core>, ["~> 1.0.2"])
|
298
299
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
299
|
-
s.add_dependency(%q<dm-types>, ["~> 1.0.
|
300
|
+
s.add_dependency(%q<dm-types>, ["~> 1.0.2"])
|
300
301
|
end
|
301
302
|
end
|
302
303
|
|
data/lib/dm-validations.rb
CHANGED
@@ -40,7 +40,9 @@ module DataMapper
|
|
40
40
|
def self.new(model, name, options = {}, type = nil)
|
41
41
|
property = super
|
42
42
|
property.model.auto_generate_validations(property)
|
43
|
-
|
43
|
+
|
44
|
+
# FIXME: explicit return needed for YARD to parse this properly
|
45
|
+
return property
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
@@ -36,7 +36,6 @@ module DataMapper
|
|
36
36
|
# Auto-generate validations for a given property. This will only occur
|
37
37
|
# if the option :auto_validation is either true or left undefined.
|
38
38
|
#
|
39
|
-
# @details [Triggers]
|
40
39
|
# Triggers that generate validator creation
|
41
40
|
#
|
42
41
|
# :required => true
|
@@ -112,7 +111,7 @@ module DataMapper
|
|
112
111
|
@disable_auto_validations || false
|
113
112
|
end
|
114
113
|
|
115
|
-
|
114
|
+
alias_method :auto_validations_disabled?, :disabled_auto_validations?
|
116
115
|
|
117
116
|
# Checks whether or not property should be auto validated.
|
118
117
|
# It is the case for properties with :auto_validation option
|
@@ -70,7 +70,6 @@ module DataMapper
|
|
70
70
|
# @option :as<Format, Proc, Regexp> the pre-defined format, Proc or Regexp to validate against
|
71
71
|
# @option :with<Format, Proc, Regexp> an alias for :as
|
72
72
|
#
|
73
|
-
# @details [Pre-defined Formats]
|
74
73
|
# :email_address (format is specified in DataMapper::Validations::Format::Email)
|
75
74
|
# :url (format is specified in DataMapper::Validations::Format::Url)
|
76
75
|
#
|
@@ -130,7 +130,7 @@ module DataMapper
|
|
130
130
|
# explicitly given validations with different option
|
131
131
|
# (usually as Range vs. max limit for inferred validation)
|
132
132
|
#
|
133
|
-
# @semipublic
|
133
|
+
# @api semipublic
|
134
134
|
def ==(other)
|
135
135
|
self.class == other.class &&
|
136
136
|
self.field_name == other.field_name &&
|
@@ -143,7 +143,7 @@ module DataMapper
|
|
143
143
|
"<##{self.class.name} @field_name='#{@field_name}' @if_clause=#{@if_clause.inspect} @unless_clause=#{@unless_clause.inspect} @options=#{@options.inspect}>"
|
144
144
|
end
|
145
145
|
|
146
|
-
|
146
|
+
alias_method :to_s, :inspect
|
147
147
|
end # class GenericValidator
|
148
148
|
end # module Validations
|
149
149
|
end # module DataMapper
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Guy van den Berg
|
@@ -28,8 +28,8 @@ dependencies:
|
|
28
28
|
segments:
|
29
29
|
- 1
|
30
30
|
- 0
|
31
|
-
-
|
32
|
-
version: 1.0.
|
31
|
+
- 2
|
32
|
+
version: 1.0.2
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
@@ -57,8 +57,8 @@ dependencies:
|
|
57
57
|
segments:
|
58
58
|
- 1
|
59
59
|
- 0
|
60
|
-
-
|
61
|
-
version: 1.0.
|
60
|
+
- 2
|
61
|
+
version: 1.0.2
|
62
62
|
type: :development
|
63
63
|
version_requirements: *id003
|
64
64
|
description: Library for performing validations on DM models and pure Ruby object
|
@@ -216,7 +216,7 @@ files:
|
|
216
216
|
- tasks/spec.rake
|
217
217
|
- tasks/yard.rake
|
218
218
|
- tasks/yardstick.rake
|
219
|
-
has_rdoc:
|
219
|
+
has_rdoc: yard
|
220
220
|
homepage: http://github.com/datamapper/dm-validations
|
221
221
|
licenses: []
|
222
222
|
|