validates_timeliness 4.1.0 → 4.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 148ec0229512f4f5dd6ab3b7eeb0afe75551db13cc7d905d49d3f2caf31e54b1
4
- data.tar.gz: d87f86e30c3e580c3fe568681d8815c87fc023acd6a5adc4cff79e448b2bafa0
3
+ metadata.gz: 942eb4506928d381dae7a7356206a045a57d8085cc9ef8ea6e96801186274bea
4
+ data.tar.gz: 6991d619ce2c4872c16e1c757f6de78c8f1761c6b5194f10b0312158431aba15
5
5
  SHA512:
6
- metadata.gz: 37e10a32e376ece6501a9e3148ead0aa3e2951c2a29791d75984b265c297ceaf0668bfad1a6e8d3771996393356137e2137bc86efac1f8a4b8822bc3a3f58510
7
- data.tar.gz: 241e9aff31988c0d27c584d79355b8b5346c691312f907d0ec3845933f14a9847490af64b7c8bb5cbc7caad17778877f420330d4ff572612d96c208825a6ce3e
6
+ metadata.gz: abf74b01270b55f495fd10ca1e5abcdfe899742499dcb8c7af17b11f68aa04143b843d3b65c9cbafbd6eae1f56a4a9d4959b9bd8af6ec42a1c7bcc65055689d1
7
+ data.tar.gz: afb9c7e4657292e244749548a8669222da167410d7a28831c665f6a86fa88e0415e3daecbd4580f8c2eec24e754c59cfe7ba2a232256c7a769b0ff2805aea6a5
@@ -9,12 +9,6 @@ bundler_args: --verbose
9
9
 
10
10
  matrix:
11
11
  include:
12
- - rvm: "2.3.7"
13
- gemfile: gemfiles/rails_4_0.gemfile
14
- - rvm: "2.3.7"
15
- gemfile: gemfiles/rails_4_1.gemfile
16
- - rvm: "2.3.7"
17
- gemfile: gemfiles/rails_4_2.gemfile
18
12
  - rvm: "2.4.6"
19
13
  gemfile: gemfiles/rails_4_2.gemfile
20
14
  - rvm: "2.5.5"
@@ -1,3 +1,10 @@
1
+ = 4.1.1 [2019-08-06]
2
+ * Add initializer to ensure Timeliness default ambigiuous date handling config
3
+ in Timeliness v0.4.1+ is set correctly when using `use_us_formats` or
4
+ `use_euro_formats` switcher to set default.
5
+ * Removed build support for Ruby 2.3 and Rails 4.0 and 4.1 to EOL official
6
+ support for those.
7
+
1
8
  = 4.1.0 [2019-06-11]
2
9
  * Relaxed Timeliness dependency version to >= 0.3.10 and < 1, which allows
3
10
  version 0.4 with threadsafety fix for use_us_formats and use_euro_formats
@@ -5,7 +5,8 @@
5
5
 
6
6
  == Description
7
7
 
8
- Complete validation of dates, times and datetimes for Rails 4.x and ActiveModel.
8
+ Complete validation of dates, times and datetimes for Rails 4.2.x and ActiveModel. Rails 4.0.x and 4.1.x may
9
+ still work but official support has ended.
9
10
 
10
11
  If you a looking for the old version for Rails 3.x go here[http://github.com/adzap/validates_timeliness/tree/v3.x].
11
12
 
@@ -30,7 +31,7 @@ If you a looking for the old version for Rails 3.x go here[http://github.com/adz
30
31
  == Installation
31
32
 
32
33
  # in Gemfile
33
- gem 'validates_timeliness', '~> 4.0'
34
+ gem 'validates_timeliness', '~> 4.1'
34
35
 
35
36
  # Run bundler
36
37
  $ bundle install
@@ -11,5 +11,13 @@ module ValidatesTimeliness
11
11
  initializer "validates_timeliness.initialize_restriction_errors" do
12
12
  ValidatesTimeliness.ignore_restriction_errors = !Rails.env.test?
13
13
  end
14
+
15
+ initializer "validates_timeliness.initialize_timeliness_ambiguous_date_format", :after => 'load_config_initializers' do
16
+ if Timeliness.respond_to?(:ambiguous_date_format) # i.e. v0.4+
17
+ # Set default for each new thread if you have changed the default using
18
+ # the format switching methods.
19
+ Timeliness.configuration.ambiguous_date_format = Timeliness::Definitions.current_date_format
20
+ end
21
+ end
14
22
  end
15
23
  end
@@ -1,3 +1,3 @@
1
1
  module ValidatesTimeliness
2
- VERSION = '4.1.0'
2
+ VERSION = '4.1.1'
3
3
  end
@@ -9,6 +9,8 @@ require 'timecop'
9
9
  require 'validates_timeliness'
10
10
  require 'validates_timeliness/orm/active_model'
11
11
 
12
+ require 'rails/railtie'
13
+
12
14
  require 'support/test_model'
13
15
  require 'support/model_helpers'
14
16
  require 'support/config_helper'
@@ -0,0 +1,22 @@
1
+ require 'validates_timeliness/railtie'
2
+
3
+ RSpec.describe ValidatesTimeliness::Railtie do
4
+ context "intializers" do
5
+ context "validates_timeliness.initialize_timeliness_ambiguous_date_format" do
6
+ it 'should set the timeliness default ambiguous date format from the current format' do
7
+ expect(Timeliness.configuration.ambiguous_date_format).to eq :us
8
+ ValidatesTimeliness.parser.use_euro_formats
9
+
10
+ initializer("validates_timeliness.initialize_timeliness_ambiguous_date_format").run
11
+
12
+ expect(Timeliness.configuration.ambiguous_date_format).to eq :euro
13
+ end
14
+ end if Timeliness.respond_to?(:ambiguous_date_format)
15
+
16
+ def initializer(name)
17
+ ValidatesTimeliness::Railtie.initializers.find { |i|
18
+ i.name == name
19
+ } || raise("Initializer #{name} not found")
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_timeliness
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Meehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-11 00:00:00.000000000 Z
11
+ date: 2019-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timeliness
@@ -45,8 +45,6 @@ files:
45
45
  - LICENSE
46
46
  - README.rdoc
47
47
  - Rakefile
48
- - gemfiles/rails_4_0.gemfile
49
- - gemfiles/rails_4_1.gemfile
50
48
  - gemfiles/rails_4_2.gemfile
51
49
  - init.rb
52
50
  - lib/generators/validates_timeliness/install_generator.rb
@@ -75,6 +73,7 @@ files:
75
73
  - spec/validates_timeliness/extensions/multiparameter_handler_spec.rb
76
74
  - spec/validates_timeliness/helper_methods_spec.rb
77
75
  - spec/validates_timeliness/orm/active_record_spec.rb
76
+ - spec/validates_timeliness/railtie_spec.rb
78
77
  - spec/validates_timeliness/validator/after_spec.rb
79
78
  - spec/validates_timeliness/validator/before_spec.rb
80
79
  - spec/validates_timeliness/validator/is_at_spec.rb
@@ -119,6 +118,7 @@ test_files:
119
118
  - spec/validates_timeliness/extensions/multiparameter_handler_spec.rb
120
119
  - spec/validates_timeliness/helper_methods_spec.rb
121
120
  - spec/validates_timeliness/orm/active_record_spec.rb
121
+ - spec/validates_timeliness/railtie_spec.rb
122
122
  - spec/validates_timeliness/validator/after_spec.rb
123
123
  - spec/validates_timeliness/validator/before_spec.rb
124
124
  - spec/validates_timeliness/validator/is_at_spec.rb
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.13"
6
- gem "rspec", "~> 3.6.0"
7
- gem "rspec-rails", "~> 3.6.0"
8
- gem "timecop"
9
- gem "byebug"
10
- gem "appraisal"
11
- gem "sqlite3", "~> 1.3.0"
12
- gem "nokogiri", "1.6.7"
13
-
14
- gemspec path: "../"
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.1.14"
6
- gem "rspec", "~> 3.6.0"
7
- gem "rspec-rails", "~> 3.6.0"
8
- gem "timecop"
9
- gem "byebug"
10
- gem "appraisal"
11
- gem "sqlite3", "~> 1.3.0"
12
- gem "nokogiri", "1.6.7"
13
-
14
- gemspec path: "../"