date_validator 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_DISABLE_SHARED_GEMS: "1"
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # A sample Gemfile
2
+ source :gemcutter
3
+
4
+ group :development do
5
+ gem "rspec", ">= 2.0.0.beta.19"
6
+ gem "activesupport", "3.0.0.rc"
7
+ gem "tzinfo"
8
+ end
9
+
10
+ gem "activemodel", "3.0.0.rc"
@@ -0,0 +1,29 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activemodel (3.0.0.rc)
5
+ activesupport (= 3.0.0.rc)
6
+ builder (~> 2.1.2)
7
+ i18n (~> 0.4.1)
8
+ activesupport (3.0.0.rc)
9
+ builder (2.1.2)
10
+ diff-lcs (1.1.2)
11
+ i18n (0.4.1)
12
+ rspec (2.0.0.beta.19)
13
+ rspec-core (= 2.0.0.beta.19)
14
+ rspec-expectations (= 2.0.0.beta.19)
15
+ rspec-mocks (= 2.0.0.beta.19)
16
+ rspec-core (2.0.0.beta.19)
17
+ rspec-expectations (2.0.0.beta.19)
18
+ diff-lcs (>= 1.1.2)
19
+ rspec-mocks (2.0.0.beta.19)
20
+ tzinfo (0.3.22)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ activemodel (= 3.0.0.rc)
27
+ activesupport (= 3.0.0.rc)
28
+ rspec (>= 2.0.0.beta.19)
29
+ tzinfo
@@ -7,7 +7,8 @@ A simple date validator for Rails 3.
7
7
 
8
8
  And I mean simple. In your model:
9
9
 
10
- validates :expiration_date, :date => { :after => Time.now, :before => Time.now + 1.year }
10
+ validates :expiration_date, :date => {:after => lambda { Time.now } :before => lambda { Time.now + 1.year } }
11
+ Using lambda prevents production cache issues.
11
12
 
12
13
  For now these are the available options you can use:
13
14
 
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require 'rubygems'
2
3
  require 'rake'
3
4
 
@@ -5,16 +6,18 @@ begin
5
6
  require 'jeweler'
6
7
  Jeweler::Tasks.new do |gem|
7
8
  gem.name = "date_validator"
8
- gem.summary = "A simple date validator for Rails 3."
9
- gem.description = "A simple date validator for Rails 3. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options. Remarkable-friendly :)"
9
+ gem.summary = "A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel."
10
+ gem.description = "A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options."
10
11
  gem.email = "info@codegram.com"
11
12
  gem.homepage = "http://github.com/codegram/date_validator"
12
- gem.authors = ["Oriol Gual", "Josep Mª Bach", "Josep Jaume Rey"]
13
+ gem.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
13
14
 
14
- gem.add_dependency 'activemodel', '>= 3.0.0.beta4'
15
+ gem.add_dependency 'activemodel', '>= 3.0.0.rc'
15
16
 
16
- gem.add_development_dependency "rspec", '>= 2.0.0.beta.12'
17
- gem.add_development_dependency "activesupport", '>= 3.0.0.beta4'
17
+ gem.add_development_dependency "rspec", '>= 2.0.0.beta.19'
18
+ gem.add_development_dependency "activesupport", '>= 3.0.0.rc'
19
+ gem.add_development_dependency "bundler", '>= 1.0.0.rc3'
20
+ gem.add_development_dependency "tzinfo"
18
21
  end
19
22
  Jeweler::GemcutterTasks.new
20
23
  rescue LoadError
@@ -23,7 +26,7 @@ end
23
26
 
24
27
 
25
28
  # Rake RSpec2 task stuff
26
- gem 'rspec', '>= 2.0.0.beta.12'
29
+ gem 'rspec', '>= 2.0.0.beta.19'
27
30
  gem 'rspec-expectations'
28
31
 
29
32
  require 'rspec/core/rake_task'
@@ -42,6 +45,8 @@ Rake::RDocTask.new do |rdoc|
42
45
  else
43
46
  version = ""
44
47
  end
48
+
49
+
45
50
  rdoc.rdoc_dir = 'rdoc'
46
51
  rdoc.title = "date_validator #{version}"
47
52
  rdoc.rdoc_files.include('README*')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6
1
+ 0.5.7
@@ -5,36 +5,41 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{date_validator}
8
- s.version = "0.5.6"
8
+ s.version = "0.5.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Oriol Gual", "Josep M\302\252 Bach", "Josep Jaume Rey"]
12
- s.date = %q{2010-06-20}
13
- s.description = %q{A simple date validator for Rails 3. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options. Remarkable-friendly :)}
11
+ s.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
12
+ s.date = %q{2010-08-09}
13
+ s.description = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options.}
14
14
  s.email = %q{info@codegram.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
- ".document",
20
+ ".bundle/config",
21
+ ".document",
21
22
  ".gitignore",
22
23
  ".rspec",
24
+ "Gemfile",
25
+ "Gemfile.lock",
23
26
  "LICENSE",
24
27
  "README.rdoc",
25
28
  "Rakefile",
26
29
  "VERSION",
27
30
  "date_validator.gemspec",
28
31
  "lib/date_validator.rb",
32
+ "locales/ca.yml",
29
33
  "locales/en.yml",
34
+ "locales/es.yml",
30
35
  "spec/date_validator_spec.rb",
31
36
  "spec/spec_helper.rb"
32
37
  ]
33
38
  s.homepage = %q{http://github.com/codegram/date_validator}
34
39
  s.rdoc_options = ["--charset=UTF-8"]
35
40
  s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.3.7}
37
- s.summary = %q{A simple date validator for Rails 3.}
41
+ s.rubygems_version = %q{1.3.6}
42
+ s.summary = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel.}
38
43
  s.test_files = [
39
44
  "spec/date_validator_spec.rb",
40
45
  "spec/spec_helper.rb"
@@ -44,19 +49,25 @@ Gem::Specification.new do |s|
44
49
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
45
50
  s.specification_version = 3
46
51
 
47
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
- s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0.beta4"])
49
- s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta.12"])
50
- s.add_development_dependency(%q<activesupport>, [">= 3.0.0.beta4"])
52
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
53
+ s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0.rc"])
54
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
55
+ s.add_development_dependency(%q<activesupport>, [">= 3.0.0.rc"])
56
+ s.add_development_dependency(%q<bundler>, [">= 1.0.0.rc3"])
57
+ s.add_development_dependency(%q<tzinfo>, [">= 0"])
51
58
  else
52
- s.add_dependency(%q<activemodel>, [">= 3.0.0.beta4"])
53
- s.add_dependency(%q<rspec>, [">= 2.0.0.beta.12"])
54
- s.add_dependency(%q<activesupport>, [">= 3.0.0.beta4"])
59
+ s.add_dependency(%q<activemodel>, [">= 3.0.0.rc"])
60
+ s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
61
+ s.add_dependency(%q<activesupport>, [">= 3.0.0.rc"])
62
+ s.add_dependency(%q<bundler>, [">= 1.0.0.rc3"])
63
+ s.add_dependency(%q<tzinfo>, [">= 0"])
55
64
  end
56
65
  else
57
- s.add_dependency(%q<activemodel>, [">= 3.0.0.beta4"])
58
- s.add_dependency(%q<rspec>, [">= 2.0.0.beta.12"])
59
- s.add_dependency(%q<activesupport>, [">= 3.0.0.beta4"])
66
+ s.add_dependency(%q<activemodel>, [">= 3.0.0.rc"])
67
+ s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
68
+ s.add_dependency(%q<activesupport>, [">= 3.0.0.rc"])
69
+ s.add_dependency(%q<bundler>, [">= 1.0.0.rc3"])
70
+ s.add_dependency(%q<tzinfo>, [">= 0"])
60
71
  end
61
72
  end
62
73
 
@@ -0,0 +1,11 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ errors:
6
+ messages:
7
+ not_a_date: "is not a date"
8
+ after: "must be after %{value}"
9
+ after_or_equal_to: "must be after or equal to %{value}"
10
+ before: "must be before %{value}"
11
+ before_or_equal_to: "must be before or equal to %{value}"
@@ -1,11 +1,8 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
1
+ ca:
5
2
  errors:
6
3
  messages:
7
- not_a_date: "is not a date"
8
- after: "must be after %{value}"
9
- after_or_equal_to: "must be after or equal to %{value}"
10
- before: "must be before %{value}"
11
- before_or_equal_to: "must be before or equal to %{value}"
4
+ not_a_date: "no és una data"
5
+ after: "ha de ser posterior a %{value}"
6
+ after_or_equal_to: "ha de ser posterior o igual a %{value}"
7
+ before: "ha de ser abans de %{value}"
8
+ before_or_equal_to: "ha de ser abans o igual a %{value}"
@@ -0,0 +1,8 @@
1
+ es:
2
+ errors:
3
+ messages:
4
+ not_a_date: "no es una fecha"
5
+ after: "tiene que ser posterior a %{value}"
6
+ after_or_equal_to: "tiene que ser posterior o igual a %{value}"
7
+ before: "tiene que ser antes de %{value}"
8
+ before_or_equal_to: "tiene que ser antes o igual a %{value}"
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
  require 'rubygems'
5
5
  require 'active_model'
6
6
 
7
- require 'lib/date_validator'
7
+ require 'date_validator'
8
8
  require 'rspec'
9
9
  require 'rspec/autorun'
10
10
 
metadata CHANGED
@@ -1,78 +1,98 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_validator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 5
9
- - 6
10
- version: 0.5.6
8
+ - 7
9
+ version: 0.5.7
11
10
  platform: ruby
12
11
  authors:
13
12
  - Oriol Gual
14
- - "Josep M\xC2\xAA Bach"
13
+ - Josep M. Bach
15
14
  - Josep Jaume Rey
16
15
  autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2010-06-20 00:00:00 +02:00
19
+ date: 2010-08-09 00:00:00 +02:00
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
23
  name: activemodel
25
24
  prerelease: false
26
25
  requirement: &id001 !ruby/object:Gem::Requirement
27
- none: false
28
26
  requirements:
29
27
  - - ">="
30
28
  - !ruby/object:Gem::Version
31
- hash: 299253624
32
29
  segments:
33
30
  - 3
34
31
  - 0
35
32
  - 0
36
- - beta4
37
- version: 3.0.0.beta4
33
+ - rc
34
+ version: 3.0.0.rc
38
35
  type: :runtime
39
36
  version_requirements: *id001
40
37
  - !ruby/object:Gem::Dependency
41
38
  name: rspec
42
39
  prerelease: false
43
40
  requirement: &id002 !ruby/object:Gem::Requirement
44
- none: false
45
41
  requirements:
46
42
  - - ">="
47
43
  - !ruby/object:Gem::Version
48
- hash: 62196475
49
44
  segments:
50
45
  - 2
51
46
  - 0
52
47
  - 0
53
48
  - beta
54
- - 12
55
- version: 2.0.0.beta.12
49
+ - 19
50
+ version: 2.0.0.beta.19
56
51
  type: :development
57
52
  version_requirements: *id002
58
53
  - !ruby/object:Gem::Dependency
59
54
  name: activesupport
60
55
  prerelease: false
61
56
  requirement: &id003 !ruby/object:Gem::Requirement
62
- none: false
63
57
  requirements:
64
58
  - - ">="
65
59
  - !ruby/object:Gem::Version
66
- hash: 299253624
67
60
  segments:
68
61
  - 3
69
62
  - 0
70
63
  - 0
71
- - beta4
72
- version: 3.0.0.beta4
64
+ - rc
65
+ version: 3.0.0.rc
73
66
  type: :development
74
67
  version_requirements: *id003
75
- description: A simple date validator for Rails 3. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options. Remarkable-friendly :)
68
+ - !ruby/object:Gem::Dependency
69
+ name: bundler
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ segments:
76
+ - 1
77
+ - 0
78
+ - 0
79
+ - rc3
80
+ version: 1.0.0.rc3
81
+ type: :development
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: tzinfo
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
92
+ version: "0"
93
+ type: :development
94
+ version_requirements: *id005
95
+ description: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options.
76
96
  email: info@codegram.com
77
97
  executables: []
78
98
 
@@ -82,16 +102,21 @@ extra_rdoc_files:
82
102
  - LICENSE
83
103
  - README.rdoc
84
104
  files:
105
+ - .bundle/config
85
106
  - .document
86
107
  - .gitignore
87
108
  - .rspec
109
+ - Gemfile
110
+ - Gemfile.lock
88
111
  - LICENSE
89
112
  - README.rdoc
90
113
  - Rakefile
91
114
  - VERSION
92
115
  - date_validator.gemspec
93
116
  - lib/date_validator.rb
117
+ - locales/ca.yml
94
118
  - locales/en.yml
119
+ - locales/es.yml
95
120
  - spec/date_validator_spec.rb
96
121
  - spec/spec_helper.rb
97
122
  has_rdoc: true
@@ -104,30 +129,26 @@ rdoc_options:
104
129
  require_paths:
105
130
  - lib
106
131
  required_ruby_version: !ruby/object:Gem::Requirement
107
- none: false
108
132
  requirements:
109
133
  - - ">="
110
134
  - !ruby/object:Gem::Version
111
- hash: 3
112
135
  segments:
113
136
  - 0
114
137
  version: "0"
115
138
  required_rubygems_version: !ruby/object:Gem::Requirement
116
- none: false
117
139
  requirements:
118
140
  - - ">="
119
141
  - !ruby/object:Gem::Version
120
- hash: 3
121
142
  segments:
122
143
  - 0
123
144
  version: "0"
124
145
  requirements: []
125
146
 
126
147
  rubyforge_project:
127
- rubygems_version: 1.3.7
148
+ rubygems_version: 1.3.6
128
149
  signing_key:
129
150
  specification_version: 3
130
- summary: A simple date validator for Rails 3.
151
+ summary: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel.
131
152
  test_files:
132
153
  - spec/date_validator_spec.rb
133
154
  - spec/spec_helper.rb