age_calculator 1.2.0 → 1.2.1

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
2
  SHA256:
3
- metadata.gz: aee3d23e9bb225c4c03eb269c6a14da8c0f02c2bc8f0b389e0df617523f468d7
4
- data.tar.gz: f5efaf19f902905a43cac4d84ffb3b3f2b69a4fa2d09a09fe3079041d3a7d399
3
+ metadata.gz: dcdb424ff53ec2b05f613927bfbd263f7172407bc6f2b5a91842f77446915b84
4
+ data.tar.gz: bbb5c4f4931a2923312072c1598438c36f71571e20cb14b7572fb3e4b9111ca7
5
5
  SHA512:
6
- metadata.gz: 3d764ffaef4eaab4c5021055098d5c28e3ddb1a9ece41893aae16e4731a85c355c19caee51fcfb4f631d1e83660682c53432c7b891239dfb63a84f877715d194
7
- data.tar.gz: 8a8b31faa16c1e51a77c4f06e69dac481b7e7115cacc839d54a1d284597cab40a0b769c3af9c79361a8a176942c4407ddcdb8b04f8130967e834ac264a48e937
6
+ metadata.gz: f337d1b15891667088054564b31160bbe30fad2e9e77e6a5cfb99ef550c2081b2ea09100f2400a0357003262e508813afb2ae437f15335ca3960d20bad9b635b
7
+ data.tar.gz: 76a80f440b8ba9141a69dec2f124b51690263d06ddd5d78ef58496a2b115dc8483d1cc967668a67fbb23b88ff51e22aeddf4d9fc8eb5a953e0e6dcf19c77b39b
data/README.md CHANGED
@@ -49,6 +49,7 @@ For a basic usage:
49
49
 
50
50
  ```ruby
51
51
  birthday = Date.new(2000,1,1)
52
+
52
53
  ac = AgeCalculator.new(birthday)
53
54
 
54
55
  ac.age
@@ -63,12 +64,10 @@ For a model with a validation on the age:
63
64
  ```ruby
64
65
  class Adult < ActiveRecord::Base
65
66
  validates :birthday, age: { over: 18 }
66
-
67
67
  end
68
68
 
69
69
  class Adult < ActiveRecord::Base
70
70
  validates :birthday, age: { over: 18, asof: Date.today.beginning_of_year }
71
-
72
71
  end
73
72
  ```
74
73
 
@@ -3,7 +3,7 @@ class AgeCalculator
3
3
  initializer 'age_calculator.active_model' do |app|
4
4
  require 'age_calculator/validator'
5
5
 
6
- I18n.load_path += Pathname.new(__FILE__).dirname.parent.parent.glob('config/locales/*.yml')
6
+ I18n.load_path += AgeValidator.locales
7
7
  end
8
8
  end
9
9
  end
@@ -13,4 +13,8 @@ class AgeValidator < ActiveModel::EachValidator
13
13
  end
14
14
  end
15
15
  end
16
+
17
+ def self.locales
18
+ Dir[Pathname.new(__FILE__).join('../../../config/locales/*.yml')]
19
+ end
16
20
  end
@@ -1,3 +1,3 @@
1
1
  class AgeCalculator
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -11,7 +11,7 @@ include ActiveSupport::Testing::TimeHelpers
11
11
 
12
12
  # Locale
13
13
  I18n.enforce_available_locales = true
14
- I18n.load_path += Pathname.new(__FILE__).dirname.parent.glob('config/locales/*.yml')
14
+ I18n.load_path += AgeValidator.locales
15
15
 
16
16
  class Adult
17
17
  include ActiveModel::Validations
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: age_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-04 00:00:00.000000000 Z
11
+ date: 2018-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake