date_validator 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Readme.md +5 -0
- data/lib/date_validator.rb +1 -0
- data/lib/date_validator/engine.rb +5 -0
- data/lib/date_validator/version.rb +1 -1
- data/locales/af.yml +12 -0
- data/locales/ca.yml +5 -8
- data/locales/it.yml +1 -0
- data/locales/ja.yml +9 -0
- data/test/date_validator_test.rb +1 -1
- data/test/test_helper.rb +1 -3
- metadata +23 -22
- data/.rvmrc +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8f859465fc2a2eedc9ca6e02e571595b90379d
|
4
|
+
data.tar.gz: 5512229010aa291eccd0f7aae359e7007b2eccfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfa3bf68fb302764c093774e54b72a4ad57ad4543b39a6e05a1cc706d4b8670559cdae735f9abded88926f38cfe0024efcded0f6210adfc790b9afa78a54121c
|
7
|
+
data.tar.gz: c1efda702378e821041575bcd9dd2f2b5867ef2b7fedffe54307b91e43b953708b21399deb381351b7b32a7efe12bbb39c3687617d7474549197b9d6c7b7c5bd
|
data/.travis.yml
CHANGED
data/Readme.md
CHANGED
@@ -51,6 +51,11 @@ If you want to make sure an attribute is before/after another attribute, use:
|
|
51
51
|
validates :start_date, date: { before: :end_date }
|
52
52
|
```
|
53
53
|
|
54
|
+
If you want to allow an empty date, use:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
validates :optional_date, date: { allow_blank: true }
|
58
|
+
```
|
54
59
|
## Note on Patches/Pull Requests
|
55
60
|
|
56
61
|
* Fork the project.
|
data/lib/date_validator.rb
CHANGED
data/locales/af.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Sample localization file for Afrikaans. Add more files in this directory for other locales.
|
2
|
+
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale for starting points.
|
3
|
+
af:
|
4
|
+
errors:
|
5
|
+
messages:
|
6
|
+
not_a_date: "is nie 'n datum nie"
|
7
|
+
after: "moet na %{date} wees"
|
8
|
+
after_or_equal_to: "moet na of op %{date} wees"
|
9
|
+
before: "moet voor %{date} wees"
|
10
|
+
before_or_equal_to: "moet voor of op %{date} wees"
|
11
|
+
equal_to: "moet gelyk aan %{date} wees"
|
12
|
+
cannot_be_in_the_future: "kan nie in die toekoms wees nie"
|
data/locales/ca.yml
CHANGED
@@ -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
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 %{date}"
|
6
|
+
after_or_equal_to: "ha de ser posterior o igual a %{date}"
|
7
|
+
before: "ha de ser abans de %{date}"
|
8
|
+
before_or_equal_to: "ha de ser abans de o igual a %{date}"
|
data/locales/it.yml
CHANGED
data/locales/ja.yml
ADDED
data/test/date_validator_test.rb
CHANGED
@@ -113,7 +113,7 @@ module ActiveModel
|
|
113
113
|
TestRecord.validates(:expiration_date, date: { after: Time.now.to_date }).must_be_kind_of Hash
|
114
114
|
when :time_with_zone then
|
115
115
|
Time.zone = "Hawaii"
|
116
|
-
TestRecord.validates(:expiration_date, date: { before: Time.zone.parse((Time.now + 21000).to_s) }).must_be_kind_of Hash
|
116
|
+
TestRecord.validates(:expiration_date, date: { before: Time.zone.parse((Time.now + 21000).to_s, Time.now) }).must_be_kind_of Hash
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
data/test/test_helper.rb
CHANGED
@@ -11,9 +11,7 @@ begin; require 'turn'; rescue LoadError; end
|
|
11
11
|
gem 'minitest'
|
12
12
|
require 'minitest/autorun'
|
13
13
|
|
14
|
-
require 'active_support/
|
15
|
-
require 'active_support/time' # For testing Date and TimeWithZone objects
|
16
|
-
|
14
|
+
require 'active_support/all'
|
17
15
|
require 'active_model'
|
18
16
|
require 'date_validator'
|
19
17
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: date_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oriol Gual
|
@@ -10,76 +10,76 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-05-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: minitest
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rake
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: activesupport
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: tzinfo
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
description: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails
|
@@ -91,12 +91,11 @@ executables: []
|
|
91
91
|
extensions: []
|
92
92
|
extra_rdoc_files: []
|
93
93
|
files:
|
94
|
-
- .document
|
95
|
-
- .gemtest
|
96
|
-
- .gitignore
|
97
|
-
- .rspec
|
98
|
-
- .
|
99
|
-
- .travis.yml
|
94
|
+
- ".document"
|
95
|
+
- ".gemtest"
|
96
|
+
- ".gitignore"
|
97
|
+
- ".rspec"
|
98
|
+
- ".travis.yml"
|
100
99
|
- Gemfile
|
101
100
|
- LICENSE
|
102
101
|
- Rakefile
|
@@ -104,13 +103,16 @@ files:
|
|
104
103
|
- date_validator.gemspec
|
105
104
|
- lib/active_model/validations/date_validator.rb
|
106
105
|
- lib/date_validator.rb
|
106
|
+
- lib/date_validator/engine.rb
|
107
107
|
- lib/date_validator/version.rb
|
108
|
+
- locales/af.yml
|
108
109
|
- locales/ca.yml
|
109
110
|
- locales/de.yml
|
110
111
|
- locales/en.yml
|
111
112
|
- locales/es.yml
|
112
113
|
- locales/fr.yml
|
113
114
|
- locales/it.yml
|
115
|
+
- locales/ja.yml
|
114
116
|
- locales/nl.yml
|
115
117
|
- locales/pl.yml
|
116
118
|
- locales/pt-BR.yml
|
@@ -126,17 +128,17 @@ require_paths:
|
|
126
128
|
- lib
|
127
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
128
130
|
requirements:
|
129
|
-
- -
|
131
|
+
- - ">="
|
130
132
|
- !ruby/object:Gem::Version
|
131
133
|
version: '0'
|
132
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
135
|
requirements:
|
134
|
-
- -
|
136
|
+
- - ">="
|
135
137
|
- !ruby/object:Gem::Version
|
136
138
|
version: '0'
|
137
139
|
requirements: []
|
138
140
|
rubyforge_project: date_validator
|
139
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.4.5
|
140
142
|
signing_key:
|
141
143
|
specification_version: 4
|
142
144
|
summary: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based
|
@@ -144,4 +146,3 @@ summary: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3,
|
|
144
146
|
test_files:
|
145
147
|
- test/date_validator_test.rb
|
146
148
|
- test/test_helper.rb
|
147
|
-
has_rdoc:
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm use ruby-2.0.0@date_validator --create
|