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.
- data/.bundle/config +2 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +29 -0
- data/README.rdoc +2 -1
- data/Rakefile +12 -7
- data/VERSION +1 -1
- data/date_validator.gemspec +28 -17
- data/locales/ca.yml +11 -0
- data/locales/en.yml +6 -9
- data/locales/es.yml +8 -0
- data/spec/spec_helper.rb +1 -1
- metadata +45 -24
data/.bundle/config
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -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
|
data/README.rdoc
CHANGED
@@ -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 => {
|
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.
|
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
|
13
|
+
gem.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
|
13
14
|
|
14
|
-
gem.add_dependency 'activemodel', '>= 3.0.0.
|
15
|
+
gem.add_dependency 'activemodel', '>= 3.0.0.rc'
|
15
16
|
|
16
|
-
gem.add_development_dependency "rspec", '>= 2.0.0.beta.
|
17
|
-
gem.add_development_dependency "activesupport", '>= 3.0.0.
|
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.
|
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.
|
1
|
+
0.5.7
|
data/date_validator.gemspec
CHANGED
@@ -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.
|
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
|
12
|
-
s.date = %q{2010-
|
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.
|
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
|
-
".
|
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.
|
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::
|
48
|
-
s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0.
|
49
|
-
s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta.
|
50
|
-
s.add_development_dependency(%q<activesupport>, [">= 3.0.0.
|
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.
|
53
|
-
s.add_dependency(%q<rspec>, [">= 2.0.0.beta.
|
54
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.0.
|
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.
|
58
|
-
s.add_dependency(%q<rspec>, [">= 2.0.0.beta.
|
59
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.0.
|
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
|
|
data/locales/ca.yml
ADDED
@@ -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}"
|
data/locales/en.yml
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
-
|
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: "
|
8
|
-
after: "
|
9
|
-
after_or_equal_to: "
|
10
|
-
before: "
|
11
|
-
before_or_equal_to: "
|
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}"
|
data/locales/es.yml
ADDED
@@ -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}"
|
data/spec/spec_helper.rb
CHANGED
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
|
-
-
|
10
|
-
version: 0.5.
|
8
|
+
- 7
|
9
|
+
version: 0.5.7
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Oriol Gual
|
14
|
-
-
|
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-
|
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
|
-
-
|
37
|
-
version: 3.0.0.
|
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
|
-
-
|
55
|
-
version: 2.0.0.beta.
|
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
|
-
-
|
72
|
-
version: 3.0.0.
|
64
|
+
- rc
|
65
|
+
version: 3.0.0.rc
|
73
66
|
type: :development
|
74
67
|
version_requirements: *id003
|
75
|
-
|
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.
|
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
|