dm-validations 1.0.2 → 1.1.0.rc1

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.
Files changed (31) hide show
  1. data/Gemfile +25 -94
  2. data/LICENSE +1 -1
  3. data/Rakefile +2 -7
  4. data/VERSION +1 -1
  5. data/dm-validations.gemspec +281 -270
  6. data/lib/dm-validations.rb +36 -35
  7. data/lib/dm-validations/auto_validate.rb +10 -5
  8. data/lib/dm-validations/contextual_validators.rb +41 -4
  9. data/lib/dm-validations/formats/email.rb +12 -8
  10. data/lib/dm-validations/validation_errors.rb +4 -0
  11. data/lib/dm-validations/validators/acceptance_validator.rb +4 -0
  12. data/lib/dm-validations/validators/format_validator.rb +3 -3
  13. data/lib/dm-validations/validators/generic_validator.rb +8 -20
  14. data/lib/dm-validations/validators/length_validator.rb +7 -1
  15. data/lib/dm-validations/validators/uniqueness_validator.rb +8 -2
  16. data/spec/fixtures/mittelschnauzer.rb +1 -0
  17. data/spec/integration/automatic_validation/inferred_boolean_properties_validation_spec.rb +20 -24
  18. data/spec/integration/automatic_validation/inferred_float_property_validation_spec.rb +11 -3
  19. data/spec/integration/automatic_validation/inferred_integer_properties_validation_spec.rb +9 -14
  20. data/spec/integration/automatic_validation/inferred_length_validation_spec.rb +9 -0
  21. data/spec/integration/automatic_validation/inferred_uniqueness_validation_spec.rb +48 -0
  22. data/spec/integration/automatic_validation/spec_helper.rb +2 -19
  23. data/spec/integration/format_validator/email_format_validator_spec.rb +15 -1
  24. data/spec/unit/generic_validator/optional_spec.rb +54 -0
  25. data/spec/unit/validation_errors/respond_to_spec.rb +15 -0
  26. data/tasks/spec.rake +0 -3
  27. metadata +69 -42
  28. data/.gitignore +0 -37
  29. data/tasks/ci.rake +0 -1
  30. data/tasks/local_gemfile.rake +0 -16
  31. data/tasks/metrics.rake +0 -36
data/.gitignore DELETED
@@ -1,37 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## Rubinius
17
- *.rbc
18
-
19
- ## PROJECT::GENERAL
20
- *.gem
21
- coverage
22
- rdoc
23
- pkg
24
- tmp
25
- doc
26
- log
27
- .yardoc
28
- measurements
29
-
30
- ## BUNDLER
31
- .bundle
32
- Gemfile.local
33
- Gemfile.lock
34
- Gemfile.local.lock
35
-
36
- ## PROJECT::SPECIFIC
37
- spec/db/
data/tasks/ci.rake DELETED
@@ -1 +0,0 @@
1
- task :ci => [ :verify_measurements, 'metrics:all' ]
@@ -1,16 +0,0 @@
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
- root.join('Gemfile.local').open('w') do |f|
8
- root.join('Gemfile').open.each do |line|
9
- line.sub!(/DATAMAPPER = 'git:\/\/github.com\/datamapper'/, "DATAMAPPER = '#{datamapper}'")
10
- line.sub!(/:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, ':path => "#{DATAMAPPER}/\1"')
11
- line.sub!(/do_options\[:git\] = \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/, 'do_options[:path] = "#{DATAMAPPER}/\1"')
12
- f.puts line
13
- end
14
- end
15
-
16
- end
data/tasks/metrics.rake DELETED
@@ -1,36 +0,0 @@
1
- begin
2
- require 'metric_fu'
3
- rescue LoadError
4
- namespace :metrics do
5
- task :all do
6
- abort 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
7
- end
8
- end
9
- end
10
-
11
- begin
12
- require 'reek/adapters/rake_task'
13
-
14
- Reek::RakeTask.new do |t|
15
- t.fail_on_error = true
16
- t.verbose = false
17
- t.source_files = 'lib/**/*.rb'
18
- end
19
- rescue LoadError
20
- task :reek do
21
- abort 'Reek is not available. In order to run reek, you must: gem install reek'
22
- end
23
- end
24
-
25
- begin
26
- require 'roodi'
27
- require 'roodi_task'
28
-
29
- RoodiTask.new do |t|
30
- t.verbose = false
31
- end
32
- rescue LoadError
33
- task :roodi do
34
- abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
35
- end
36
- end