dm-validations 0.10.2 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/.gitignore +36 -0
  2. data/Gemfile +143 -0
  3. data/README.rdoc +52 -102
  4. data/Rakefile +3 -3
  5. data/VERSION +1 -1
  6. data/dm-validations.gemspec +126 -14
  7. data/lib/dm-validations.rb +78 -18
  8. data/lib/dm-validations/auto_validate.rb +27 -23
  9. data/lib/dm-validations/contextual_validators.rb +3 -3
  10. data/lib/dm-validations/formats/email.rb +3 -3
  11. data/lib/dm-validations/formats/url.rb +3 -3
  12. data/lib/dm-validations/support/context.rb +1 -1
  13. data/lib/dm-validations/validation_errors.rb +5 -7
  14. data/lib/dm-validations/validators/absent_field_validator.rb +13 -9
  15. data/lib/dm-validations/validators/acceptance_validator.rb +10 -7
  16. data/lib/dm-validations/validators/block_validator.rb +3 -3
  17. data/lib/dm-validations/validators/confirmation_validator.rb +10 -7
  18. data/lib/dm-validations/validators/format_validator.rb +14 -10
  19. data/lib/dm-validations/validators/generic_validator.rb +3 -3
  20. data/lib/dm-validations/validators/length_validator.rb +10 -7
  21. data/lib/dm-validations/validators/method_validator.rb +3 -3
  22. data/lib/dm-validations/validators/numeric_validator.rb +25 -14
  23. data/lib/dm-validations/validators/primitive_validator.rb +12 -8
  24. data/lib/dm-validations/validators/required_field_validator.rb +12 -9
  25. data/lib/dm-validations/validators/uniqueness_validator.rb +9 -6
  26. data/lib/dm-validations/validators/within_validator.rb +3 -3
  27. data/spec/fixtures/barcode.rb +10 -2
  28. data/spec/fixtures/basketball_court.rb +7 -7
  29. data/spec/fixtures/basketball_player.rb +3 -3
  30. data/spec/fixtures/beta_tester_account.rb +4 -4
  31. data/spec/fixtures/bill_of_landing.rb +7 -7
  32. data/spec/fixtures/boat_dock.rb +2 -2
  33. data/spec/fixtures/city.rb +1 -1
  34. data/spec/fixtures/company.rb +7 -7
  35. data/spec/fixtures/corporate_world.rb +24 -26
  36. data/spec/fixtures/country.rb +1 -1
  37. data/spec/fixtures/currency.rb +4 -4
  38. data/spec/fixtures/ethernet_frame.rb +5 -5
  39. data/spec/fixtures/event.rb +2 -2
  40. data/spec/fixtures/g3_concert.rb +3 -3
  41. data/spec/fixtures/jabberwock.rb +2 -2
  42. data/spec/fixtures/kayak.rb +2 -2
  43. data/spec/fixtures/lernean_hydra.rb +3 -3
  44. data/spec/fixtures/mathematical_function.rb +2 -2
  45. data/spec/fixtures/memory_object.rb +3 -3
  46. data/spec/fixtures/mittelschnauzer.rb +3 -3
  47. data/spec/fixtures/motor_launch.rb +1 -1
  48. data/spec/fixtures/page.rb +3 -3
  49. data/spec/fixtures/phone_number.rb +2 -2
  50. data/spec/fixtures/pirogue.rb +2 -2
  51. data/spec/fixtures/programming_language.rb +3 -3
  52. data/spec/fixtures/reservation.rb +5 -5
  53. data/spec/fixtures/scm_operation.rb +42 -45
  54. data/spec/fixtures/sms_message.rb +1 -1
  55. data/spec/fixtures/udp_packet.rb +3 -3
  56. data/spec/integration/absent_field_validator/absent_field_validator_spec.rb +6 -6
  57. data/spec/integration/acceptance_validator/acceptance_validator_spec.rb +3 -3
  58. data/spec/integration/automatic_validation/inferred_length_validation_spec.rb +5 -5
  59. data/spec/integration/automatic_validation/spec_helper.rb +1 -1
  60. data/spec/integration/block_validator/block_validator_spec.rb +2 -2
  61. data/spec/integration/conditional_validation/if_condition_spec.rb +3 -3
  62. data/spec/integration/confirmation_validator/confirmation_validator_spec.rb +3 -3
  63. data/spec/integration/datamapper_models/association_validation_spec.rb +5 -5
  64. data/spec/integration/datamapper_models/inheritance_spec.rb +6 -6
  65. data/spec/integration/duplicated_validations/duplicated_validations_spec.rb +3 -3
  66. data/spec/integration/format_validator/email_format_validator_spec.rb +6 -6
  67. data/spec/integration/format_validator/format_validator_spec.rb +8 -8
  68. data/spec/integration/format_validator/regexp_validator_spec.rb +4 -4
  69. data/spec/integration/format_validator/url_format_validator_spec.rb +4 -4
  70. data/spec/integration/length_validator/default_value_spec.rb +3 -3
  71. data/spec/integration/length_validator/equality_spec.rb +4 -4
  72. data/spec/integration/length_validator/error_message_spec.rb +3 -3
  73. data/spec/integration/length_validator/maximum_spec.rb +3 -3
  74. data/spec/integration/length_validator/minimum_spec.rb +3 -3
  75. data/spec/integration/length_validator/range_spec.rb +3 -3
  76. data/spec/integration/method_validator/method_validator_spec.rb +8 -8
  77. data/spec/integration/numeric_validator/equality_with_float_type_spec.rb +7 -7
  78. data/spec/integration/numeric_validator/equality_with_integer_type_spec.rb +5 -5
  79. data/spec/integration/numeric_validator/float_type_spec.rb +3 -3
  80. data/spec/integration/numeric_validator/gt_with_float_type_spec.rb +3 -3
  81. data/spec/integration/numeric_validator/gte_with_float_type_spec.rb +3 -3
  82. data/spec/integration/numeric_validator/lt_with_float_type_spec.rb +3 -3
  83. data/spec/integration/numeric_validator/lte_with_float_type_spec.rb +3 -3
  84. data/spec/integration/primitive_validator/primitive_validator_spec.rb +4 -4
  85. data/spec/integration/pure_ruby_objects/plain_old_ruby_object_validation_spec.rb +4 -4
  86. data/spec/integration/required_field_validator/association_spec.rb +19 -51
  87. data/spec/integration/required_field_validator/boolean_type_value_spec.rb +4 -1
  88. data/spec/integration/required_field_validator/date_type_value_spec.rb +4 -2
  89. data/spec/integration/required_field_validator/datetime_type_value_spec.rb +4 -2
  90. data/spec/integration/required_field_validator/float_type_value_spec.rb +4 -2
  91. data/spec/integration/required_field_validator/integer_type_value_spec.rb +4 -2
  92. data/spec/integration/required_field_validator/plain_old_ruby_object_spec.rb +6 -4
  93. data/spec/integration/required_field_validator/string_type_value_spec.rb +3 -1
  94. data/spec/integration/required_field_validator/text_type_value_spec.rb +3 -1
  95. data/spec/integration/shared/valid_and_invalid_model.rb +8 -0
  96. data/spec/integration/uniqueness_validator/uniqueness_validator_spec.rb +29 -25
  97. data/spec/integration/within_validator/within_validator_spec.rb +6 -6
  98. data/spec/public/resource_spec.rb +47 -9
  99. data/spec/spec_helper.rb +13 -27
  100. data/spec/unit/contextual_validators/emptiness_spec.rb +4 -4
  101. data/spec/unit/contextual_validators/execution_spec.rb +6 -6
  102. data/spec/unit/contextual_validators/spec_helper.rb +3 -3
  103. data/spec/unit/generic_validator/equality_operator_spec.rb +7 -7
  104. data/spec/unit/validation_errors/adding_spec.rb +2 -2
  105. data/spec/unit/validation_errors/emptiness_spec.rb +2 -2
  106. data/spec/unit/validation_errors/enumerable_spec.rb +2 -2
  107. data/tasks/local_gemfile.rake +18 -0
  108. data/tasks/spec.rake +0 -3
  109. metadata +157 -25
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
  require 'integration/within_validator/spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::Fixtures::PhoneNumber' do
4
+ describe 'DataMapper::Validations::Fixtures::PhoneNumber' do
5
5
  before :all do
6
- DataMapper::Validate::Fixtures::PhoneNumber.auto_migrate!
6
+ DataMapper::Validations::Fixtures::PhoneNumber.auto_migrate!
7
7
 
8
- @model = DataMapper::Validate::Fixtures::PhoneNumber.new(:type_of_number => 'cell')
8
+ @model = DataMapper::Validations::Fixtures::PhoneNumber.new(:type_of_number => 'cell')
9
9
  @model.should be_valid
10
10
  end
11
11
 
@@ -51,11 +51,11 @@ end
51
51
 
52
52
 
53
53
 
54
- describe 'DataMapper::Validate::Fixtures::MathematicalFunction' do
54
+ describe 'DataMapper::Validations::Fixtures::MathematicalFunction' do
55
55
  before :all do
56
- DataMapper::Validate::Fixtures::MathematicalFunction.auto_migrate!
56
+ DataMapper::Validations::Fixtures::MathematicalFunction.auto_migrate!
57
57
 
58
- @model = DataMapper::Validate::Fixtures::MathematicalFunction.new(:input => 2, :output => -2)
58
+ @model = DataMapper::Validations::Fixtures::MathematicalFunction.new(:input => 2, :output => -2)
59
59
  @model.should be_valid
60
60
  end
61
61
 
@@ -2,9 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  describe 'DataMapper::Resource' do
4
4
  before :all do
5
- DataMapper::Validate::Fixtures::Barcode.auto_migrate!
5
+ DataMapper::Validations::Fixtures::Barcode.all.destroy!
6
6
 
7
- @resource = DataMapper::Validate::Fixtures::Barcode.new
7
+ @resource = DataMapper::Validations::Fixtures::Barcode.new
8
8
  end
9
9
 
10
10
  describe '#update' do
@@ -34,12 +34,12 @@ describe 'DataMapper::Resource' do
34
34
 
35
35
  describe 'when provided invalid attributes and a context' do
36
36
  before :all do
37
- DataMapper::Validate::Fixtures::Organisation.auto_migrate!
38
- DataMapper::Validate::Fixtures::Department.auto_migrate!
39
- DataMapper::Validate::Fixtures::User.auto_migrate!
37
+ DataMapper::Validations::Fixtures::Organisation.all.destroy!
38
+ DataMapper::Validations::Fixtures::Department.all.destroy!
39
+ DataMapper::Validations::Fixtures::User.all.destroy!
40
40
 
41
- organization = DataMapper::Validate::Fixtures::Organisation.create(:name => 'Org 101', :domain => '101')
42
- dept = DataMapper::Validate::Fixtures::Department.create(:name => 'accounting')
41
+ organization = DataMapper::Validations::Fixtures::Organisation.create(:name => 'Org 101', :domain => '101')
42
+ dept = DataMapper::Validations::Fixtures::Department.create(:name => 'accounting')
43
43
 
44
44
  attributes = {
45
45
  :organisation => organization,
@@ -48,9 +48,9 @@ describe 'DataMapper::Resource' do
48
48
  }
49
49
 
50
50
  # create a record that will be a dupe when User#update is executed below
51
- DataMapper::Validate::Fixtures::User.create(attributes).should be_saved
51
+ DataMapper::Validations::Fixtures::User.create(attributes).should be_saved
52
52
 
53
- @resource = DataMapper::Validate::Fixtures::User.create(attributes.merge(:user_name => 'other'))
53
+ @resource = DataMapper::Validations::Fixtures::User.create(attributes.merge(:user_name => 'other'))
54
54
 
55
55
  @response = @resource.update(attributes, :signing_up_for_department_account)
56
56
  end
@@ -64,4 +64,42 @@ describe 'DataMapper::Resource' do
64
64
  end
65
65
  end
66
66
  end
67
+
68
+ describe '#save' do
69
+ before :all do
70
+ @resource.code = 'a' * 10
71
+ @resource.save
72
+ end
73
+
74
+ describe 'on a new resource' do
75
+ it 'should call valid? once' do
76
+ @resource.valid_hook_call_count.should == 1
77
+ end
78
+ end
79
+
80
+ describe 'on a saved, non-dirty resource' do
81
+ before :all do
82
+ # reload the resource
83
+ @resource = @resource.model.get(*@resource.key)
84
+ @resource.save
85
+ end
86
+
87
+ it 'should not call valid?' do
88
+ @resource.valid_hook_call_count.should be_nil
89
+ end
90
+ end
91
+
92
+ describe 'on a saved, dirty resource' do
93
+ before :all do
94
+ # reload the resource
95
+ @resource = @resource.model.get(*@resource.key)
96
+ @resource.code = 'b' * 10
97
+ @resource.save
98
+ end
99
+
100
+ it 'should call valid? once' do
101
+ @resource.valid_hook_call_count.should == 1
102
+ end
103
+ end
104
+ end
67
105
  end
data/spec/spec_helper.rb CHANGED
@@ -1,34 +1,20 @@
1
- require 'rubygems'
1
+ require 'dm-core/spec/setup'
2
+ require 'dm-core/spec/lib/adapter_helpers'
2
3
 
3
- # use local dm-core if running from a typical dev checkout.
4
- lib = File.join('..', '..', 'dm-core', 'lib')
5
- $LOAD_PATH.unshift(lib) if File.directory?(lib)
6
- require 'dm-core'
4
+ require 'dm-validations'
5
+ require 'dm-types'
6
+ require 'dm-migrations'
7
7
 
8
- # Support running specs with 'rake spec' and 'spec'
9
- $LOAD_PATH.unshift('lib') unless $LOAD_PATH.include?('lib')
8
+ SPEC_ROOT = Pathname(__FILE__).dirname
9
+ Pathname.glob((SPEC_ROOT + 'fixtures/**/*.rb').to_s).each { |file| require file }
10
+ Pathname.glob((SPEC_ROOT + 'integration/shared/**/*.rb').to_s).each { |file| require file }
10
11
 
11
- require 'dm-validations'
12
+ DataMapper::Spec.setup
12
13
 
13
- def load_driver(name, default_uri)
14
- return false if ENV['ADAPTER'] != name.to_s
14
+ Spec::Runner.configure do |config|
15
+ config.extend(DataMapper::Spec::Adapters::Helpers)
15
16
 
16
- begin
17
- DataMapper.setup(name, ENV["#{name.to_s.upcase}_SPEC_URI"] || default_uri)
18
- DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name]
19
- true
20
- rescue LoadError => e
21
- warn "Could not load do_#{name}: #{e}"
22
- false
17
+ config.before :suite do
18
+ DataMapper.auto_migrate!
23
19
  end
24
20
  end
25
-
26
- ENV['ADAPTER'] ||= 'sqlite3'
27
-
28
- HAS_SQLITE3 = load_driver(:sqlite3, 'sqlite3::memory:')
29
- HAS_MYSQL = load_driver(:mysql, 'mysql://localhost/dm_core_test')
30
- HAS_POSTGRES = load_driver(:postgres, 'postgres://postgres@localhost/dm_core_test')
31
-
32
- ROOT = Pathname(__FILE__).dirname.parent
33
- Dir[ROOT / 'spec' / 'integration' / 'shared' / '**' / '*.rb'].each { |rb| require(rb) }
34
- Dir[ROOT / 'spec' / 'fixtures' / '**' / '*.rb'].each { |rb| require(rb) }
@@ -2,9 +2,9 @@
2
2
  require 'spec_helper'
3
3
  require 'unit/contextual_validators/spec_helper'
4
4
 
5
- describe 'DataMapper::Validate::ContextualValidators' do
5
+ describe 'DataMapper::Validations::ContextualValidators' do
6
6
  before :all do
7
- @model = DataMapper::Validate::ContextualValidators.new
7
+ @model = DataMapper::Validations::ContextualValidators.new
8
8
  end
9
9
 
10
10
  describe "initially" do
@@ -27,7 +27,7 @@ describe 'DataMapper::Validate::ContextualValidators' do
27
27
 
28
28
  describe "after a context being added" do
29
29
  before :all do
30
- @model.context(:default) << DataMapper::Validate::RequiredFieldValidator.new(:toc, :when => [:publishing])
30
+ @model.context(:default) << DataMapper::Validations::PresenceValidator.new(:toc, :when => [:publishing])
31
31
  end
32
32
 
33
33
  it "is no longer empty" do
@@ -38,7 +38,7 @@ describe 'DataMapper::Validate::ContextualValidators' do
38
38
 
39
39
  describe "when cleared" do
40
40
  before :all do
41
- @model.context(:default) << DataMapper::Validate::RequiredFieldValidator.new(:toc, :when => [:publishing])
41
+ @model.context(:default) << DataMapper::Validations::PresenceValidator.new(:toc, :when => [:publishing])
42
42
  @model.should_not be_empty
43
43
  @model.clear!
44
44
  end
@@ -2,15 +2,15 @@
2
2
  require 'spec_helper'
3
3
  require 'unit/contextual_validators/spec_helper'
4
4
 
5
- describe 'DataMapper::Validate::ContextualValidators' do
5
+ describe 'DataMapper::Validations::ContextualValidators' do
6
6
  before :all do
7
- @model = DataMapper::Validate::ContextualValidators.new
7
+ @model = DataMapper::Validations::ContextualValidators.new
8
8
  end
9
9
 
10
10
  describe "#execute(name, target)" do
11
11
  before do
12
- @validator_one = DataMapper::Validate::RequiredFieldValidator.new(:name)
13
- @validator_two = DataMapper::Validate::WithinValidator.new(:operating_system, :set => ["Mac OS X", "Linux", "FreeBSD", "Solaris"])
12
+ @validator_one = DataMapper::Validations::PresenceValidator.new(:name)
13
+ @validator_two = DataMapper::Validations::WithinValidator.new(:operating_system, :set => ["Mac OS X", "Linux", "FreeBSD", "Solaris"])
14
14
 
15
15
  @model.context(:default) << @validator_one << @validator_two
16
16
  end
@@ -18,7 +18,7 @@ describe 'DataMapper::Validate::ContextualValidators' do
18
18
 
19
19
  describe "when target satisfies all validators" do
20
20
  before do
21
- @target = DataMapper::Validate::Fixtures::PieceOfSoftware.new(:name => 'gcc', :operating_system => "Mac OS X")
21
+ @target = DataMapper::Validations::Fixtures::PieceOfSoftware.new(:name => 'gcc', :operating_system => "Mac OS X")
22
22
  @validator_one.call(@target).should be_true
23
23
  @validator_two.call(@target).should be_true
24
24
 
@@ -33,7 +33,7 @@ describe 'DataMapper::Validate::ContextualValidators' do
33
33
 
34
34
  describe "when target does not satisfy all validators" do
35
35
  before do
36
- @target = DataMapper::Validate::Fixtures::PieceOfSoftware.new(:name => 'Skitch', :operating_system => "Haiku")
36
+ @target = DataMapper::Validations::Fixtures::PieceOfSoftware.new(:name => 'Skitch', :operating_system => "Haiku")
37
37
  @validator_one.call(@target).should be_true
38
38
  @validator_two.call(@target).should be_false
39
39
 
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module DataMapper
4
- module Validate
4
+ module Validations
5
5
  module Fixtures
6
6
 
7
7
  class PieceOfSoftware
@@ -9,7 +9,7 @@ module DataMapper
9
9
  # Behaviors
10
10
  #
11
11
 
12
- include DataMapper::Validate
12
+ include DataMapper::Validations
13
13
 
14
14
  #
15
15
  # Attributes
@@ -33,5 +33,5 @@ module DataMapper
33
33
  end
34
34
 
35
35
  end # Fixtures
36
- end # Validate
36
+ end # Validations
37
37
  end # DataMapper
@@ -1,26 +1,26 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'DataMapper::Validate::GenericValidator' do
3
+ describe 'DataMapper::Validations::GenericValidator' do
4
4
  describe "when types and fields are equal" do
5
5
  it "returns true" do
6
- DataMapper::Validate::RequiredFieldValidator.new(:name).
7
- should == DataMapper::Validate::RequiredFieldValidator.new(:name)
6
+ DataMapper::Validations::PresenceValidator.new(:name).
7
+ should == DataMapper::Validations::PresenceValidator.new(:name)
8
8
  end
9
9
  end
10
10
 
11
11
 
12
12
  describe "when types differ" do
13
13
  it "returns false" do
14
- DataMapper::Validate::RequiredFieldValidator.new(:name).
15
- should_not == DataMapper::Validate::UniquenessValidator.new(:name)
14
+ DataMapper::Validations::PresenceValidator.new(:name).
15
+ should_not == DataMapper::Validations::UniquenessValidator.new(:name)
16
16
  end
17
17
  end
18
18
 
19
19
 
20
20
  describe "when property names differ" do
21
21
  it "returns false" do
22
- DataMapper::Validate::RequiredFieldValidator.new(:first_name).
23
- should_not == DataMapper::Validate::RequiredFieldValidator.new(:last_name)
22
+ DataMapper::Validations::PresenceValidator.new(:first_name).
23
+ should_not == DataMapper::Validations::PresenceValidator.new(:last_name)
24
24
  end
25
25
  end
26
26
  end
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::ValidationErrors' do
4
+ describe 'DataMapper::Validations::ValidationErrors' do
5
5
  before :all do
6
- @model = DataMapper::Validate::ValidationErrors.new(Object.new)
6
+ @model = DataMapper::Validations::ValidationErrors.new(Object.new)
7
7
  end
8
8
 
9
9
  describe "after first error being added" do
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::ValidationErrors' do
4
+ describe 'DataMapper::Validations::ValidationErrors' do
5
5
  before :all do
6
- @model = DataMapper::Validate::ValidationErrors.new(Object.new)
6
+ @model = DataMapper::Validations::ValidationErrors.new(Object.new)
7
7
  end
8
8
 
9
9
  describe "initially" do
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'spec_helper'
3
3
 
4
- describe 'DataMapper::Validate::ValidationErrors' do
4
+ describe 'DataMapper::Validations::ValidationErrors' do
5
5
  before :all do
6
- @model = DataMapper::Validate::ValidationErrors.new(Object.new)
6
+ @model = DataMapper::Validations::ValidationErrors.new(Object.new)
7
7
  @model.add(:ip_address, "must have valid format")
8
8
  @model.add(:full_name, "can't be blank")
9
9
  end
@@ -0,0 +1,18 @@
1
+ desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle foo)"
2
+ task :local_gemfile do |t|
3
+
4
+ root = Pathname(__FILE__).dirname.parent
5
+ datamapper = root.parent
6
+
7
+ source_regex = /DATAMAPPER = 'git:\/\/github.com\/datamapper'/
8
+ gem_source_regex = /:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/
9
+
10
+ root.join('Gemfile.local').open('w') do |f|
11
+ root.join('Gemfile').open.each do |line|
12
+ line.sub!(source_regex, "DATAMAPPER = '#{datamapper}'")
13
+ line.sub!(gem_source_regex, ':path => "#{DATAMAPPER}/\1"')
14
+ f.puts line
15
+ end
16
+ end
17
+
18
+ end
data/tasks/spec.rake CHANGED
@@ -35,7 +35,4 @@ rescue LoadError
35
35
  end
36
36
  end
37
37
 
38
- task :spec => :check_dependencies
39
- task :rcov => :check_dependencies
40
-
41
38
  task :default => :spec
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ prerelease: true
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ - rc1
10
+ version: 1.0.0.rc1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Guy van den Berg
@@ -9,39 +15,52 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-12-11 00:00:00 -08:00
18
+ date: 2010-05-19 00:00:00 -07:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: dm-core
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
20
25
  requirements:
21
26
  - - ~>
22
27
  - !ruby/object:Gem::Version
23
- version: 0.10.2
24
- version:
28
+ segments:
29
+ - 1
30
+ - 0
31
+ - 0
32
+ - rc1
33
+ version: 1.0.0.rc1
34
+ type: :runtime
35
+ version_requirements: *id001
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: rspec
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
30
40
  requirements:
31
41
  - - ~>
32
42
  - !ruby/object:Gem::Version
33
- version: 1.2.9
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: yard
43
+ segments:
44
+ - 1
45
+ - 3
46
+ version: "1.3"
37
47
  type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: dm-types
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
40
53
  requirements:
41
54
  - - ~>
42
55
  - !ruby/object:Gem::Version
43
- version: 0.4.0
44
- version:
56
+ segments:
57
+ - 1
58
+ - 0
59
+ - 0
60
+ - rc1
61
+ version: 1.0.0.rc1
62
+ type: :development
63
+ version_requirements: *id003
45
64
  description: Library for performing validations on DM models and pure Ruby object
46
65
  email: vandenberg.guy [a] gmail [d] com
47
66
  executables: []
@@ -52,6 +71,8 @@ extra_rdoc_files:
52
71
  - LICENSE
53
72
  - README.rdoc
54
73
  files:
74
+ - .gitignore
75
+ - Gemfile
55
76
  - LICENSE
56
77
  - README.rdoc
57
78
  - Rakefile
@@ -189,6 +210,7 @@ files:
189
210
  - spec/unit/validation_errors/emptiness_spec.rb
190
211
  - spec/unit/validation_errors/enumerable_spec.rb
191
212
  - tasks/ci.rake
213
+ - tasks/local_gemfile.rake
192
214
  - tasks/metrics.rake
193
215
  - tasks/spec.rake
194
216
  - tasks/yard.rake
@@ -206,20 +228,130 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
228
  requirements:
207
229
  - - ">="
208
230
  - !ruby/object:Gem::Version
231
+ segments:
232
+ - 0
209
233
  version: "0"
210
- version:
211
234
  required_rubygems_version: !ruby/object:Gem::Requirement
212
235
  requirements:
213
- - - ">="
236
+ - - ">"
214
237
  - !ruby/object:Gem::Version
215
- version: "0"
216
- version:
238
+ segments:
239
+ - 1
240
+ - 3
241
+ - 1
242
+ version: 1.3.1
217
243
  requirements: []
218
244
 
219
245
  rubyforge_project: datamapper
220
- rubygems_version: 1.3.5
246
+ rubygems_version: 1.3.6
221
247
  signing_key:
222
248
  specification_version: 3
223
249
  summary: Library for performing validations on DM models and pure Ruby object
224
- test_files: []
225
-
250
+ test_files:
251
+ - spec/fixtures/barcode.rb
252
+ - spec/fixtures/basketball_court.rb
253
+ - spec/fixtures/basketball_player.rb
254
+ - spec/fixtures/beta_tester_account.rb
255
+ - spec/fixtures/bill_of_landing.rb
256
+ - spec/fixtures/boat_dock.rb
257
+ - spec/fixtures/city.rb
258
+ - spec/fixtures/company.rb
259
+ - spec/fixtures/corporate_world.rb
260
+ - spec/fixtures/country.rb
261
+ - spec/fixtures/currency.rb
262
+ - spec/fixtures/ethernet_frame.rb
263
+ - spec/fixtures/event.rb
264
+ - spec/fixtures/g3_concert.rb
265
+ - spec/fixtures/jabberwock.rb
266
+ - spec/fixtures/kayak.rb
267
+ - spec/fixtures/lernean_hydra.rb
268
+ - spec/fixtures/mathematical_function.rb
269
+ - spec/fixtures/memory_object.rb
270
+ - spec/fixtures/mittelschnauzer.rb
271
+ - spec/fixtures/motor_launch.rb
272
+ - spec/fixtures/page.rb
273
+ - spec/fixtures/phone_number.rb
274
+ - spec/fixtures/pirogue.rb
275
+ - spec/fixtures/programming_language.rb
276
+ - spec/fixtures/reservation.rb
277
+ - spec/fixtures/scm_operation.rb
278
+ - spec/fixtures/sms_message.rb
279
+ - spec/fixtures/udp_packet.rb
280
+ - spec/integration/absent_field_validator/absent_field_validator_spec.rb
281
+ - spec/integration/absent_field_validator/spec_helper.rb
282
+ - spec/integration/acceptance_validator/acceptance_validator_spec.rb
283
+ - spec/integration/acceptance_validator/spec_helper.rb
284
+ - spec/integration/automatic_validation/custom_messages_for_inferred_validation_spec.rb
285
+ - spec/integration/automatic_validation/disabling_inferred_validation_spec.rb
286
+ - spec/integration/automatic_validation/inferred_boolean_properties_validation_spec.rb
287
+ - spec/integration/automatic_validation/inferred_float_property_validation_spec.rb
288
+ - spec/integration/automatic_validation/inferred_format_validation_spec.rb
289
+ - spec/integration/automatic_validation/inferred_integer_properties_validation_spec.rb
290
+ - spec/integration/automatic_validation/inferred_length_validation_spec.rb
291
+ - spec/integration/automatic_validation/inferred_presence_validation_spec.rb
292
+ - spec/integration/automatic_validation/inferred_primitive_validation_spec.rb
293
+ - spec/integration/automatic_validation/inferred_within_validation_spec.rb
294
+ - spec/integration/automatic_validation/spec_helper.rb
295
+ - spec/integration/block_validator/block_validator_spec.rb
296
+ - spec/integration/block_validator/spec_helper.rb
297
+ - spec/integration/conditional_validation/if_condition_spec.rb
298
+ - spec/integration/conditional_validation/spec_helper.rb
299
+ - spec/integration/confirmation_validator/confirmation_validator_spec.rb
300
+ - spec/integration/confirmation_validator/spec_helper.rb
301
+ - spec/integration/datamapper_models/association_validation_spec.rb
302
+ - spec/integration/datamapper_models/inheritance_spec.rb
303
+ - spec/integration/duplicated_validations/duplicated_validations_spec.rb
304
+ - spec/integration/duplicated_validations/spec_helper.rb
305
+ - spec/integration/format_validator/email_format_validator_spec.rb
306
+ - spec/integration/format_validator/format_validator_spec.rb
307
+ - spec/integration/format_validator/regexp_validator_spec.rb
308
+ - spec/integration/format_validator/spec_helper.rb
309
+ - spec/integration/format_validator/url_format_validator_spec.rb
310
+ - spec/integration/length_validator/default_value_spec.rb
311
+ - spec/integration/length_validator/equality_spec.rb
312
+ - spec/integration/length_validator/error_message_spec.rb
313
+ - spec/integration/length_validator/maximum_spec.rb
314
+ - spec/integration/length_validator/minimum_spec.rb
315
+ - spec/integration/length_validator/range_spec.rb
316
+ - spec/integration/length_validator/spec_helper.rb
317
+ - spec/integration/method_validator/method_validator_spec.rb
318
+ - spec/integration/method_validator/spec_helper.rb
319
+ - spec/integration/numeric_validator/equality_with_float_type_spec.rb
320
+ - spec/integration/numeric_validator/equality_with_integer_type_spec.rb
321
+ - spec/integration/numeric_validator/float_type_spec.rb
322
+ - spec/integration/numeric_validator/gt_with_float_type_spec.rb
323
+ - spec/integration/numeric_validator/gte_with_float_type_spec.rb
324
+ - spec/integration/numeric_validator/integer_only_true_spec.rb
325
+ - spec/integration/numeric_validator/integer_type_spec.rb
326
+ - spec/integration/numeric_validator/lt_with_float_type_spec.rb
327
+ - spec/integration/numeric_validator/lte_with_float_type_spec.rb
328
+ - spec/integration/numeric_validator/spec_helper.rb
329
+ - spec/integration/primitive_validator/primitive_validator_spec.rb
330
+ - spec/integration/primitive_validator/spec_helper.rb
331
+ - spec/integration/pure_ruby_objects/plain_old_ruby_object_validation_spec.rb
332
+ - spec/integration/required_field_validator/association_spec.rb
333
+ - spec/integration/required_field_validator/boolean_type_value_spec.rb
334
+ - spec/integration/required_field_validator/date_type_value_spec.rb
335
+ - spec/integration/required_field_validator/datetime_type_value_spec.rb
336
+ - spec/integration/required_field_validator/float_type_value_spec.rb
337
+ - spec/integration/required_field_validator/integer_type_value_spec.rb
338
+ - spec/integration/required_field_validator/plain_old_ruby_object_spec.rb
339
+ - spec/integration/required_field_validator/shared_examples.rb
340
+ - spec/integration/required_field_validator/spec_helper.rb
341
+ - spec/integration/required_field_validator/string_type_value_spec.rb
342
+ - spec/integration/required_field_validator/text_type_value_spec.rb
343
+ - spec/integration/shared/default_validation_context.rb
344
+ - spec/integration/shared/valid_and_invalid_model.rb
345
+ - spec/integration/uniqueness_validator/spec_helper.rb
346
+ - spec/integration/uniqueness_validator/uniqueness_validator_spec.rb
347
+ - spec/integration/within_validator/spec_helper.rb
348
+ - spec/integration/within_validator/within_validator_spec.rb
349
+ - spec/public/resource_spec.rb
350
+ - spec/spec_helper.rb
351
+ - spec/unit/contextual_validators/emptiness_spec.rb
352
+ - spec/unit/contextual_validators/execution_spec.rb
353
+ - spec/unit/contextual_validators/spec_helper.rb
354
+ - spec/unit/generic_validator/equality_operator_spec.rb
355
+ - spec/unit/validation_errors/adding_spec.rb
356
+ - spec/unit/validation_errors/emptiness_spec.rb
357
+ - spec/unit/validation_errors/enumerable_spec.rb