date_validator 0.7.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 10530abca992905ef4966abc59bde16277badc80
4
- data.tar.gz: ec91b26e1d5c4ec2f2a021da33b785e4c60d5371
2
+ SHA256:
3
+ metadata.gz: '089b8331eec9d9832d3867d22d213f0fe9f16f1c0e61982def3e19b171dc729d'
4
+ data.tar.gz: f2e3b93ed21294cef464284976e2edcc2fab27bb0bf6b37b18a494b241dd85d0
5
5
  SHA512:
6
- metadata.gz: 33d51b09b3101e09ceb24e72fdab255c32be4e7ee766610163bbaaac793b7ab5d64c12a27a693642238e290c233e673d34a34c60a83603d75ffbadd70035c589
7
- data.tar.gz: 0bb7e42f9e6bd99894952e29c5e5b1cffa388bb643cbe896b069097a36b74d3022bfe51855d372509b0ee32022da3851d7f71bf6f7e5eb3d0b852fcdd4d06ff0
6
+ metadata.gz: bef6a2179671eb18059b1fc21c5796d11a425803a0041371e5f456c5a5b244e8aa3266fe89be416c5acf527ea40dd15a183090e75cd8cb8ab9b4f73c5ca60a96
7
+ data.tar.gz: a98af5f8076fbfc0dc3e83b3dbf8e5df23330638a2048a3a6804e3e3b05c49b62bc1a77cfab04e715b2d19a34f122b66aea570976cadc0629505fec00f45a62a
@@ -0,0 +1,52 @@
1
+ name: "Tests"
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - "*"
10
+
11
+ env:
12
+ CI: "true"
13
+
14
+ jobs:
15
+ main:
16
+ name: Tests
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7]
21
+ activemodel: [3.2, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1]
22
+ include:
23
+ - ruby: 3.0
24
+ activemodel: 6.0
25
+ - ruby: 3.0
26
+ activemodel: 6.1
27
+ exclude:
28
+ - ruby: 2.2
29
+ activemodel: 6.0
30
+ - ruby: 2.3
31
+ activemodel: 6.0
32
+ - ruby: 2.4
33
+ activemodel: 6.0
34
+ - ruby: 2.2
35
+ activemodel: 6.1
36
+ - ruby: 2.3
37
+ activemodel: 6.1
38
+ - ruby: 2.4
39
+ activemodel: 6.1
40
+ fail-fast: true
41
+ env:
42
+ ACTIVE_MODEL_VERSION: ${{ matrix.activemodel }}
43
+ steps:
44
+ - uses: actions/checkout@v2.0.0
45
+ with:
46
+ fetch-depth: 1
47
+ - uses: ruby/setup-ruby@master
48
+ with:
49
+ ruby-version: ${{ matrix.ruby }}
50
+ - run: bundle install --jobs 4 --retry 3
51
+ name: Install Ruby deps
52
+ - run: bundle exec rake
data/Gemfile CHANGED
@@ -1,21 +1,12 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- active_model_version = ENV['ACTIVE_MODEL_VERSION'] || 'default'
6
-
7
5
  active_model_opts =
8
- case active_model_version
9
- when 'master'
10
- { github: 'rails/rails' }
11
- when 'default'
12
- '~> 3'
13
- else
14
- "~> #{active_model_version}"
6
+ case version = ENV['ACTIVE_MODEL_VERSION'] || "master"
7
+ when 'master' then { github: 'rails/rails' }
8
+ when 'default' then '~> 3'
9
+ else "~> #{version}"
15
10
  end
16
11
 
17
12
  gem 'activemodel', active_model_opts
18
-
19
- platforms :rbx do
20
- gem 'rubysl', '~> 2.0'
21
- end
data/Readme.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # date_validator [![Build Status](https://travis-ci.org/codegram/date_validator.png?branch=master)](https://travis-ci.org/codegram/date_validator)
2
2
 
3
3
 
4
- A simple date validator for Rails. Should be compatible with all latest Rubies.
4
+ A simple date validator for Rails. Should be compatible with all latest Rubies (~> 2.x).
5
5
 
6
6
 
7
7
  ```shell
@@ -32,6 +32,14 @@ validates :expiration_date,
32
32
  date: { after: :packaging_date }
33
33
  ```
34
34
 
35
+ or access attributes via the object being validated directly (the input to the Proc):
36
+
37
+ ```ruby
38
+ validates :due_date,
39
+ date: { after_or_equal_to: Proc.new { |obj| obj.created_at.to_date }
40
+ # The object being validated is available in the Proc
41
+ ```
42
+
35
43
  For now the available options you can use are `:after`, `:before`,
36
44
  `:after_or_equal_to`, `:before_or_equal_to` and `:equal_to`.
37
45
 
@@ -51,6 +59,11 @@ If you want to make sure an attribute is before/after another attribute, use:
51
59
  validates :start_date, date: { before: :end_date }
52
60
  ```
53
61
 
62
+ If you want to allow an empty date, use:
63
+
64
+ ```ruby
65
+ validates :optional_date, date: { allow_blank: true }
66
+ ```
54
67
  ## Note on Patches/Pull Requests
55
68
 
56
69
  * Fork the project.
@@ -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
+ date_after: "moet na %{date} wees"
8
+ date_after_or_equal_to: "moet na of op %{date} wees"
9
+ date_before: "moet voor %{date} wees"
10
+ date_before_or_equal_to: "moet voor of op %{date} wees"
11
+ date_equal_to: "moet gelyk aan %{date} wees"
12
+ cannot_be_in_the_future: "kan nie in die toekoms wees nie"
@@ -0,0 +1,9 @@
1
+ ar:
2
+ errors:
3
+ messages:
4
+ not_a_date: "ليس بتاريخ"
5
+ date_after: "يجب أن يكون بعد %{date}"
6
+ date_after_or_equal_to: "يجب أن يكون مساوي أو بعد %{date}"
7
+ date_before: "يجب أن يكون قبل %{date}"
8
+ date_before_or_equal_to: "يجب أن يكون مساوي أو قبل %{date}"
9
+ date_equal_to: "يجب أن يساوي %{date}"
@@ -0,0 +1,9 @@
1
+ ca:
2
+ errors:
3
+ messages:
4
+ not_a_date: "no és una data"
5
+ date_after: "ha de ser posterior a %{date}"
6
+ date_after_or_equal_to: "ha de ser posterior o igual a %{date}"
7
+ date_before: "ha de ser abans de %{date}"
8
+ date_before_or_equal_to: "ha de ser abans de o igual a %{date}"
9
+ date_equal_to: "ha de ser igual a %{date}"
@@ -0,0 +1,8 @@
1
+ de:
2
+ errors:
3
+ messages:
4
+ not_a_date: "ist kein Datum"
5
+ date_after: "muss nach %{date} sein"
6
+ date_after_or_equal_to: "muss nach oder gleich %{date} sein"
7
+ date_before: "muss vor %{date} sein"
8
+ date_before_or_equal_to: "muss vor oder gleich %{date} sein"
@@ -0,0 +1,9 @@
1
+ en:
2
+ errors:
3
+ messages:
4
+ not_a_date: "is not a date"
5
+ date_after: "must be after %{date}"
6
+ date_after_or_equal_to: "must be after or equal to %{date}"
7
+ date_before: "must be before %{date}"
8
+ date_before_or_equal_to: "must be before or equal to %{date}"
9
+ date_equal_to: "must be equal to %{date}"
@@ -0,0 +1,9 @@
1
+ es:
2
+ errors:
3
+ messages:
4
+ not_a_date: "no es una fecha"
5
+ date_after: "tiene que ser posterior a %{date}"
6
+ date_after_or_equal_to: "tiene que ser posterior o igual a %{date}"
7
+ date_before: "tiene que ser antes de %{date}"
8
+ date_before_or_equal_to: "tiene que ser antes o igual a %{date}"
9
+ date_equal_to: "tiene que ser igual a %{date}"
@@ -5,7 +5,7 @@ fr:
5
5
  errors:
6
6
  messages:
7
7
  not_a_date: "n'est pas une date"
8
- after: "doit être après %{date}"
9
- after_or_equal_to: "doit être supérieur ou égal à %{date}"
10
- before: "doit être avant %{date}"
11
- before_or_equal_to: "doit être inférieur ou égal à %{date}"
8
+ date_after: "doit être après %{date}"
9
+ date_after_or_equal_to: "doit être supérieur ou égal à %{date}"
10
+ date_before: "doit être avant %{date}"
11
+ date_before_or_equal_to: "doit être inférieur ou égal à %{date}"
@@ -0,0 +1,9 @@
1
+ it:
2
+ errors:
3
+ messages:
4
+ not_a_date: "non è una data"
5
+ date_after: "deve essere successiva a %{date}"
6
+ date_after_or_equal_to: "deve essere successiva o uguale a %{date}"
7
+ date_before: "deve essere antecedente a %{date}"
8
+ date_before_or_equal_to: "deve essere antecedente o uguale a %{date}"
9
+ date_equal_to: "deve essere uguale a %{date}"
@@ -0,0 +1,9 @@
1
+ ja:
2
+ errors:
3
+ messages:
4
+ not_a_date: "は日付ではありません"
5
+ date_after: "は%{date}より後に設定してください"
6
+ date_after_or_equal_to: "は%{date}以後に設定してください"
7
+ date_before: "は%{date}より前に設定してください"
8
+ date_before_or_equal_to: "は%{date}以前に設定してください"
9
+ date_equal_to: "は%{date}にしてください"
@@ -0,0 +1,8 @@
1
+ nl:
2
+ errors:
3
+ messages:
4
+ not_a_date: "is geen datum"
5
+ date_after: "moet na %{date} liggen"
6
+ date_after_or_equal_to: "moet gelijk zijn aan of na %{date} liggen"
7
+ date_before: "moet voor %{date} liggen"
8
+ date_before_or_equal_to: "moet gelijk zijn of voor %{date} liggen"
@@ -0,0 +1,8 @@
1
+ pl:
2
+ errors:
3
+ messages:
4
+ not_a_date: "nie jest datą"
5
+ date_after: "musi być po %{date}"
6
+ date_after_or_equal_to: "musi być po lub równa %{date}"
7
+ date_before: "musi być przed %{date}"
8
+ date_before_or_equal_to: "musi być przed lub równa %{date}"
@@ -0,0 +1,8 @@
1
+ pt-BR:
2
+ errors:
3
+ messages:
4
+ not_a_date: "não é uma data válida"
5
+ date_after: "deve ser após %{date}"
6
+ date_after_or_equal_to: "deve ser após ou igual a %{date}"
7
+ date_before: "deve ser antes de %{date}"
8
+ date_before_or_equal_to: "deve ser antes ou igual a %{date}"
@@ -0,0 +1,8 @@
1
+ ru:
2
+ errors:
3
+ messages:
4
+ not_a_date: "не является датой"
5
+ date_after: "должна быть позднее чем %{date}"
6
+ date_after_or_equal_to: "должна равняться или быть позднее чем %{date}"
7
+ date_before: "должна быть ранее чем %{date}"
8
+ date_before_or_equal_to: "должна равняться или быть ранее чем %{date}"
@@ -0,0 +1,9 @@
1
+ tr:
2
+ errors:
3
+ messages:
4
+ not_a_date: "geçerli tarih değil"
5
+ date_after: "%{date} den ileri bir tarih olmalı"
6
+ date_after_or_equal_to: "%{date} ile aynı veya ileri bir tarih olmalı"
7
+ date_before: "%{date} den öncesi bir tarih olmalı"
8
+ date_before_or_equal_to: "%{date} ile aynı veya öncesi bir tarih olmalı"
9
+ date_equal_to: "%{date} ile aynı tarihte olmalı"
@@ -0,0 +1,9 @@
1
+ zh-CN:
2
+ errors:
3
+ messages:
4
+ not_a_date: "不是一个日期"
5
+ date_after: "必须晚于 %{date}"
6
+ date_after_or_equal_to: "必须早于或等于 %{date}"
7
+ date_before: "必须早于 %{date}"
8
+ date_before_or_equal_to: "必须晚于或等于 %{date}"
9
+ date_equal_to: "必须等于 %{date}"
@@ -5,22 +5,23 @@ require "date_validator/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "date_validator"
7
7
  s.version = DateValidator::VERSION
8
- s.platform = Gem::Platform::RUBY
9
8
  s.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
10
9
  s.email = ["info@codegram.com"]
11
10
  s.homepage = "http://github.com/codegram/date_validator"
12
- s.summary = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel.}
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.}
11
+ s.summary = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3+, based on ActiveModel.}
12
+ 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
13
 
15
14
  s.rubyforge_project = "date_validator"
16
15
 
17
- s.add_runtime_dependency 'activemodel'
16
+ s.add_runtime_dependency 'activemodel', '>= 3'
17
+ s.add_runtime_dependency 'activesupport', '>= 3'
18
18
 
19
19
  s.add_development_dependency 'minitest'
20
- s.add_development_dependency 'rake'
21
- s.add_development_dependency 'activesupport'
20
+ s.add_development_dependency 'rake', '>= 12.3.3'
22
21
  s.add_development_dependency 'tzinfo'
23
22
 
23
+ s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
24
+
24
25
  s.files = `git ls-files`.split("\n")
25
26
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
26
27
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -1,4 +1,6 @@
1
1
  require 'active_model/validations'
2
+ require 'active_support/core_ext/date_time/conversions'
3
+ require 'active_support/core_ext/hash/conversions'
2
4
 
3
5
  # ActiveModel Rails module.
4
6
  module ActiveModel
@@ -57,14 +59,19 @@ module ActiveModel
57
59
  end
58
60
 
59
61
  if value_before_type_cast.present? && value.nil?
60
- record.errors.add(attr_name, :not_a_date, options)
62
+ record.errors.add(attr_name, :not_a_date, **options)
61
63
  return
62
64
  end
63
65
 
64
66
  return if (value.nil? && options[:allow_nil]) || (value.blank? && options[:allow_blank])
65
67
 
66
68
  unless value
67
- record.errors.add(attr_name, :not_a_date, options)
69
+ record.errors.add(attr_name, :not_a_date, **options)
70
+ return
71
+ end
72
+
73
+ unless is_time?(value)
74
+ record.errors.add(attr_name, :not_a_date, **options)
68
75
  return
69
76
  end
70
77
 
@@ -87,7 +94,7 @@ module ActiveModel
87
94
  end
88
95
 
89
96
  unless is_time?(option_value) && value.to_i.send(CHECKS[option], option_value.to_i)
90
- record.errors.add(attr_name, option, options.merge(
97
+ record.errors.add(attr_name, :"date_#{option}", **options.merge(
91
98
  value: original_value,
92
99
  date: (I18n.localize(original_option_value) rescue original_option_value)
93
100
  ))
@@ -1,7 +1,8 @@
1
1
  require 'active_model/validations/date_validator'
2
2
  require 'active_support/i18n'
3
+ require 'date_validator/engine' if defined?(Rails)
3
4
 
4
- # A simple date validator for Rails 3.
5
+ # A simple date validator for Rails 3+.
5
6
  #
6
7
  # @example
7
8
  # validates :expiration_date,
@@ -0,0 +1,4 @@
1
+ module DateValidator
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -1,4 +1,4 @@
1
1
  module DateValidator
2
2
  # The version number.
3
- VERSION = "0.7.1"
3
+ VERSION = "0.11.0"
4
4
  end
@@ -84,6 +84,8 @@ module ActiveModel
84
84
 
85
85
  it "allows custom validation message to be handled by I18n" do
86
86
  custom_message = 'Custom Date Message'
87
+
88
+ I18n.backend.eager_load! if I18n.backend.respond_to?(:eager_load!)
87
89
  I18n.backend.store_translations('en', { errors: { messages: { not_a_date: custom_message }}})
88
90
 
89
91
  TestRecord.validates :expiration_date, date: true
@@ -113,7 +115,7 @@ module ActiveModel
113
115
  TestRecord.validates(:expiration_date, date: { after: Time.now.to_date }).must_be_kind_of Hash
114
116
  when :time_with_zone then
115
117
  Time.zone = "Hawaii"
116
- TestRecord.validates(:expiration_date, date: { before: Time.zone.parse((Time.now + 21000).to_s) }).must_be_kind_of Hash
118
+ TestRecord.validates(:expiration_date, date: { before: Time.zone.parse((Time.now + 21000).to_s, Time.now) }).must_be_kind_of Hash
117
119
  end
118
120
  end
119
121
  end
@@ -148,6 +150,13 @@ module ActiveModel
148
150
  TestRecord.new(nil).valid?.must_equal false
149
151
  end
150
152
  end
153
+
154
+ describe 'with garbage input' do
155
+ it 'is invalid' do
156
+ TestRecord.validates(:expiration_date, date: true, allow_nil: true)
157
+ TestRecord.new('not a date').valid?.must_equal false
158
+ end
159
+ end
151
160
  end
152
161
 
153
162
  end
data/test/test_helper.rb CHANGED
@@ -11,13 +11,11 @@ begin; require 'turn'; rescue LoadError; end
11
11
  gem 'minitest'
12
12
  require 'minitest/autorun'
13
13
 
14
- require 'active_support/core_ext'
15
- require 'active_support/time' # For testing Date and TimeWithZone objects
16
-
17
14
  require 'active_model'
15
+ require 'active_support/core_ext/time/zones'
18
16
  require 'date_validator'
19
17
 
20
- I18n.load_path += Dir[File.expand_path(File.join(File.dirname(__FILE__), '../locales', '*.yml')).to_s]
18
+ I18n.load_path += Dir[File.expand_path(File.join(File.dirname(__FILE__), '../config/locales', '*.yml')).to_s]
21
19
 
22
20
  class TestRecord
23
21
  include ActiveModel::Validations
metadata CHANGED
@@ -1,89 +1,89 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oriol Gual
8
8
  - Josep M. Bach
9
9
  - Josep Jaume Rey
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-15 00:00:00.000000000 Z
13
+ date: 2021-05-11 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
- version: '0'
21
+ version: '3'
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
- version: '0'
28
+ version: '3'
29
29
  - !ruby/object:Gem::Dependency
30
- name: minitest
30
+ name: activesupport
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
- version: '0'
36
- type: :development
35
+ version: '3'
36
+ type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: '0'
42
+ version: '3'
43
43
  - !ruby/object:Gem::Dependency
44
- name: rake
44
+ name: minitest
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
- name: activesupport
58
+ name: rake
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '0'
63
+ version: 12.3.3
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
- version: '0'
70
+ version: 12.3.3
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
86
- 3, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to
86
+ 3+, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to
87
87
  and :before_or_equal_to options.
88
88
  email:
89
89
  - info@codegram.com
@@ -91,57 +91,60 @@ executables: []
91
91
  extensions: []
92
92
  extra_rdoc_files: []
93
93
  files:
94
- - .document
95
- - .gemtest
96
- - .gitignore
97
- - .rspec
98
- - .rvmrc
99
- - .travis.yml
94
+ - ".document"
95
+ - ".gemtest"
96
+ - ".github/workflows/ci.yml"
97
+ - ".gitignore"
98
+ - ".rspec"
100
99
  - Gemfile
101
100
  - LICENSE
102
101
  - Rakefile
103
102
  - Readme.md
103
+ - config/locales/af.yml
104
+ - config/locales/ar.yml
105
+ - config/locales/ca.yml
106
+ - config/locales/de.yml
107
+ - config/locales/en.yml
108
+ - config/locales/es.yml
109
+ - config/locales/fr.yml
110
+ - config/locales/it.yml
111
+ - config/locales/ja.yml
112
+ - config/locales/nl.yml
113
+ - config/locales/pl.yml
114
+ - config/locales/pt-BR.yml
115
+ - config/locales/ru.yml
116
+ - config/locales/tr.yml
117
+ - config/locales/zh-CN.yml
104
118
  - date_validator.gemspec
105
119
  - lib/active_model/validations/date_validator.rb
106
120
  - lib/date_validator.rb
121
+ - lib/date_validator/engine.rb
107
122
  - lib/date_validator/version.rb
108
- - locales/ca.yml
109
- - locales/de.yml
110
- - locales/en.yml
111
- - locales/es.yml
112
- - locales/fr.yml
113
- - locales/it.yml
114
- - locales/nl.yml
115
- - locales/pl.yml
116
- - locales/pt-BR.yml
117
- - locales/ru.yml
118
123
  - test/date_validator_test.rb
119
124
  - test/test_helper.rb
120
125
  homepage: http://github.com/codegram/date_validator
121
126
  licenses: []
122
127
  metadata: {}
123
- post_install_message:
128
+ post_install_message:
124
129
  rdoc_options: []
125
130
  require_paths:
126
131
  - lib
127
132
  required_ruby_version: !ruby/object:Gem::Requirement
128
133
  requirements:
129
- - - '>='
134
+ - - ">="
130
135
  - !ruby/object:Gem::Version
131
- version: '0'
136
+ version: '2.2'
132
137
  required_rubygems_version: !ruby/object:Gem::Requirement
133
138
  requirements:
134
- - - '>='
139
+ - - ">="
135
140
  - !ruby/object:Gem::Version
136
141
  version: '0'
137
142
  requirements: []
138
- rubyforge_project: date_validator
139
- rubygems_version: 2.0.14
140
- signing_key:
143
+ rubygems_version: 3.1.4
144
+ signing_key:
141
145
  specification_version: 4
142
- summary: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based
143
- on ActiveModel.
146
+ summary: A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3+,
147
+ based on ActiveModel.
144
148
  test_files:
145
149
  - test/date_validator_test.rb
146
150
  - test/test_helper.rb
147
- has_rdoc:
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use ruby-2.0.0@date_validator --create
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- # http://about.travis-ci.org/docs/user/build-configuration/
2
- langauge: ruby
3
- env:
4
- - ACTIVE_MODEL_VERSION=3.2
5
- - ACTIVE_MODEL_VERSION=4.0
6
- rvm:
7
- - 1.9.3
8
- - 2.0.0
9
- - rbx
10
- - jruby-19mode
data/locales/ca.yml DELETED
@@ -1,11 +0,0 @@
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
- ca:
5
- errors:
6
- messages:
7
- not_a_date: "is not a date"
8
- after: "must be after %{date}"
9
- after_or_equal_to: "must be after or equal to %{date}"
10
- before: "must be before %{date}"
11
- before_or_equal_to: "must be before or equal to %{date}"
data/locales/de.yml DELETED
@@ -1,8 +0,0 @@
1
- de:
2
- errors:
3
- messages:
4
- not_a_date: "ist kein Datum"
5
- after: "muss nach %{date} sein"
6
- after_or_equal_to: "muss nach oder gleich %{date} sein"
7
- before: "muss vor %{date} sein"
8
- before_or_equal_to: "muss vor oder gleich %{date} sein"
data/locales/en.yml DELETED
@@ -1,9 +0,0 @@
1
- en:
2
- errors:
3
- messages:
4
- not_a_date: "is not a date"
5
- after: "must be after %{date}"
6
- after_or_equal_to: "must be after or equal to %{date}"
7
- before: "must be before %{date}"
8
- before_or_equal_to: "must be before or equal to %{date}"
9
- equal_to: "must be equal to %{date}"
data/locales/es.yml DELETED
@@ -1,8 +0,0 @@
1
- es:
2
- errors:
3
- messages:
4
- not_a_date: "no es una fecha"
5
- after: "tiene que ser posterior a %{date}"
6
- after_or_equal_to: "tiene que ser posterior o igual a %{date}"
7
- before: "tiene que ser antes de %{date}"
8
- before_or_equal_to: "tiene que ser antes o igual a %{date}"
data/locales/it.yml DELETED
@@ -1,8 +0,0 @@
1
- it:
2
- errors:
3
- messages:
4
- not_a_date: "non è una data"
5
- after: "deve essere successiva a %{date}"
6
- after_or_equal_to: "deve essere successiva o uguale a %{date}"
7
- before: "deve essere antecedente a %{date}"
8
- before_or_equal_to: "deve essere antecedente o uguale a %{date}"
data/locales/nl.yml DELETED
@@ -1,8 +0,0 @@
1
- nl:
2
- errors:
3
- messages:
4
- not_a_date: "is geen datum"
5
- after: "moet na %{date} liggen"
6
- after_or_equal_to: "moet gelijk zijn aan of na %{date} liggen"
7
- before: "moet voor %{date} liggen"
8
- before_or_equal_to: "moet gelijk zijn of voor %{date} liggen"
data/locales/pl.yml DELETED
@@ -1,8 +0,0 @@
1
- pl:
2
- errors:
3
- messages:
4
- not_a_date: "nie jest datą"
5
- after: "musi być po %{date}"
6
- after_or_equal_to: "musi być po lub równa %{date}"
7
- before: "musi być przed %{date}"
8
- before_or_equal_to: "musi być przed lub równa %{date}"
data/locales/pt-BR.yml DELETED
@@ -1,8 +0,0 @@
1
- pt-BR:
2
- errors:
3
- messages:
4
- not_a_date: "não é uma data válida"
5
- after: "deve ser após %{date}"
6
- after_or_equal_to: "deve ser após ou igual a %{date}"
7
- before: "deve ser antes de %{date}"
8
- before_or_equal_to: "deve ser antes ou igual a %{date}"
data/locales/ru.yml DELETED
@@ -1,8 +0,0 @@
1
- ru:
2
- errors:
3
- messages:
4
- not_a_date: "не является датой"
5
- after: "должна быть позднее чем %{date}"
6
- after_or_equal_to: "должна равняться или быть позднее чем %{date}"
7
- before: "должна быть ранее чем %{date}"
8
- before_or_equal_to: "должна равняться или быть ранее чем %{date}"