my_age 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: ed518c60d22b461b67de0b21011c9affc8d1ff3e
4
- data.tar.gz: 740e0433fda1083d2a08b2a81c7ddc41a81a2133
3
+ metadata.gz: 2f67fc7c50a8236d6096d02eae9a37030f7fedd3
4
+ data.tar.gz: 27f63a0490f82dfbadafcd0d6b81ae159e733a18
5
5
  SHA512:
6
- metadata.gz: ae2be5a285f8541faff74541d1e01645735fb364c8dbddf7041c267d3b70f303c5672f3bd5896e37fbc9b0601d4bb6786dc611e543acfd5193d5b4f92c7537f6
7
- data.tar.gz: 958f2a2e336b7c9797cd2cb0d1e4310e5141a2838027fd1114a790a38499cba1e2b914f54fbca1471e239b53567f5b1e0f236c44801edfc70d1f3b9d119a12f7
6
+ metadata.gz: c5fd15d4cf141055360511e20345bac46ab8dafd5ba3634f3ee6e7e0982962d6d2f4b5c9599d808b901b2fa5359f816b9cd7c18028ae56d96064ee65a346b9bc
7
+ data.tar.gz: 69067448a2f89eedefb7d0faf3fcbebe14c68aad17ed17bef51b8b7c63093d0fb9165b10def25183cbafb7b3d1c68011e5730f6d950ad24a6fe9562775c7bca1
data/README.md CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- Mixin the `Age` module and call `age` method.
21
+ Mixin `MyAge` module and call `age` method. It assumes your class has an attribute called `dob` that stores the date of birth.
22
22
 
23
23
  ```
24
24
  class User
@@ -31,29 +31,29 @@ user = User.new
31
31
  user.age
32
32
  ## but you can supply a specific date
33
33
  user.age(date)
34
- ## there are a host of helpers starting with 'age_as_of_' to specify the date too
34
+ ## there is a host of helpers starting with 'age_as_of_' to specify the date too
35
35
  user.age_as_of_tomorrow
36
36
  ```
37
37
 
38
- If your date-of-birth attribute is not called `dob`, you can assign it with `my_dob` so the gem knows where to look for it.
38
+ If your date-of-birth attribute is not called `dob`, you can assign it using `my_dob` so the gem knows where to look for it.
39
39
 
40
40
  ```
41
41
  class User
42
42
  attr_accessor :date_of_birth
43
43
  include MyAge
44
- my_dob :date_of_birthi #my attribute name
44
+ my_dob :date_of_birth #my attribute name
45
45
  end
46
46
 
47
47
  ##everything else is the same
48
48
  ```
49
49
  ## Use ActiveSupport Helpers
50
- You can use the helpers in `DateAndTime::Calculations`. Methods will look like `age_as_of_helper`:
50
+ You can use the helpers in `active_support/core_ext/date/calculations`. Methods are constructed like `age_as_of_helper`. All dates specified this way are relative to today.
51
51
 
52
52
  ```
53
- ## with #end_of_month, you can all
53
+ ## with #end_of_month, you can call
54
54
  user.age_as_of_end_of_month
55
55
 
56
- ## or with #months_since
56
+ ## this gives you the age as of 9 months later from today
57
57
  user.age_as_of_months_since(9)
58
58
 
59
59
  ## to be explicit, you can call
data/lib/my_age.rb CHANGED
@@ -1,5 +1,6 @@
1
- require "active_support/core_ext/object"
2
- require "active_support/core_ext/date_and_time/calculations"
1
+ require 'active_support'
2
+ require "active_support/core_ext/object/blank"
3
+ require "active_support/core_ext/date/calculations"
3
4
  require "my_age/version"
4
5
  require "my_age/calculator"
5
6
  require "my_age/helper"
data/lib/my_age/cli.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'thor'
2
2
  require 'my_age'
3
- require 'pry'
4
3
  module MyAge
5
4
  class CLI < Thor
6
5
  attr_accessor :dob
@@ -1,3 +1,3 @@
1
1
  module MyAge
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_age
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-29 00:00:00.000000000 Z
11
+ date: 2018-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport