human_time 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: b12cbffd26a4db1167ac7c77d7828a5cd8c99afc
4
- data.tar.gz: be0ebc498f5669a01b54fbcea79a8e3f163c8b7d
3
+ metadata.gz: a60b959d89bd2d20081ed31131df81e471be12ac
4
+ data.tar.gz: b8e12d7897606efaae9b2826d8a48703baa416db
5
5
  SHA512:
6
- metadata.gz: 1a950b477a762ebc7c0723ca028d7db879e14d6216138b6221a254198669fb1f262b1b6457d5d7e699a027c5ab2afe502aa02d6c1e2e58de75cccab6f84558b3
7
- data.tar.gz: f2ad8b5d90ff11862a548bf15ffc618e81fb64334b3d9e280b75ade9663eebe018f8a254cfca021378882a7311a0e0b09e4c29b33464e0ea0ea9269dc501d6b9
6
+ metadata.gz: 74a0b1b845e884ffe80dd3839d632ea26d3ea93d447ee6699ae1a0ad01e4b11f7dc1a9e3b71234ea67fc9b1c2f7eb08b1c374bf34627d0258656d69468814153
7
+ data.tar.gz: 74d9be51c57d0904ce2f3d7563d7066b1ba3cd4edb8bb6d852ef439236a3e583b59a2e84013f248c2806ce4c397d7dcb8cb7939f9238b5b8d27aaa8e0af43656
data/README.md CHANGED
@@ -69,22 +69,26 @@ newer_date.newer_than?(older_date)
69
69
  - `newer_than?`
70
70
  - `more_recent_than?`
71
71
  - `comes_after?`
72
+ - `later_than?`
72
73
 
73
74
  ### `>=` aliases
74
75
 
75
76
  - `newer_than_or_equal_to?`
76
77
  - `more_recent_than_or_equal_to?`
77
78
  - `after_or_equal_to?`
79
+ - `later_than_or_equal_to?`
78
80
 
79
81
  ### `<` aliases
80
82
 
81
83
  - `older_than?`
82
84
  - `comes_before?`
85
+ - `earlier_than?`
83
86
 
84
87
  ### `<=` aliases
85
88
 
86
89
  - `older_than_or_equal_to?`
87
90
  - `before_or_equal_to?`
91
+ - `earlier_than_or_equal_to?`
88
92
 
89
93
  ## RSpec Matchers
90
94
 
@@ -105,11 +109,15 @@ newer_date = Date.parse('2016-01-02')
105
109
  expect(newer_date).to be_more_recent_than(older_date)
106
110
  expect(newer_date).to be_newer_than(older_date)
107
111
  expect(newer_date).to be_after(older_date)
112
+ expect(newer_date).to be_later_than(older_date)
108
113
  expect(newer_date).to be_more_recent_than_or_equal_to(older_date)
109
114
  expect(newer_date).to be_newer_than_or_equal_to(newer_date)
115
+ expect(newer_date).to be_later_than_or_equal_to(newer_date)
110
116
  expect(older_date).to be_older_than(newer_date)
111
117
  expect(older_date).to be_before(newer_date)
118
+ expect(older_date).to be_earlier_than(newer_date)
112
119
  expect(older_date).to be_older_than_or_equal_to(older_date)
120
+ expect(older_date).to be_earlier_than_or_equal_to(older_date)
113
121
  ```
114
122
 
115
123
  ## Development
@@ -18,6 +18,12 @@ RSpec::Matchers.define :be_after do |expected|
18
18
  end
19
19
  end
20
20
 
21
+ RSpec::Matchers.define :be_later_than do |expected|
22
+ match do |actual|
23
+ actual > expected
24
+ end
25
+ end
26
+
21
27
  RSpec::Matchers.define :be_more_recent_than_or_equal_to do |expected|
22
28
  match do |actual|
23
29
  actual >= expected
@@ -30,12 +36,23 @@ RSpec::Matchers.define :be_newer_than_or_equal_to do |expected|
30
36
  end
31
37
  end
32
38
 
39
+ RSpec::Matchers.define :be_later_than_or_equal_to do |expected|
40
+ match do |actual|
41
+ actual >= expected
42
+ end
43
+ end
44
+
33
45
  RSpec::Matchers.define :be_older_than do |expected|
34
46
  match do |actual|
35
47
  actual < expected
36
48
  end
37
49
  end
38
50
 
51
+ RSpec::Matchers.define :be_earlier_than do |expected|
52
+ match do |actual|
53
+ actual < expected
54
+ end
55
+ end
39
56
 
40
57
  RSpec::Matchers.define :be_before do |expected|
41
58
  match do |actual|
@@ -48,3 +65,9 @@ RSpec::Matchers.define :be_older_than_or_equal_to do |expected|
48
65
  actual <= expected
49
66
  end
50
67
  end
68
+
69
+ RSpec::Matchers.define :be_earlier_than_or_equal_to do |expected|
70
+ match do |actual|
71
+ actual <= expected
72
+ end
73
+ end
@@ -1,3 +1,3 @@
1
1
  module HumanTime
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/human_time.rb CHANGED
@@ -5,19 +5,19 @@ require "human_time/version"
5
5
 
6
6
  module HumanTime
7
7
  def self.greater_than_aliases
8
- %w{newer_than? more_recent_than? comes_after?}
8
+ %w{newer_than? more_recent_than? comes_after? later_than?}
9
9
  end
10
10
 
11
11
  def self.greater_than_or_equal_to_aliases
12
- %w{newer_than_or_equal_to? more_recent_than_or_equal_to? after_or_equal_to?}
12
+ %w{newer_than_or_equal_to? more_recent_than_or_equal_to? after_or_equal_to? later_than_or_equal_to?}
13
13
  end
14
14
 
15
15
  def self.less_than_aliases
16
- %w{older_than? comes_before?}
16
+ %w{older_than? comes_before? earlier_than?}
17
17
  end
18
18
 
19
19
  def self.less_than_or_equal_to_aliases
20
- %w{older_than_or_equal_to? before_or_equal_to?}
20
+ %w{older_than_or_equal_to? before_or_equal_to? earlier_than_or_equal_to?}
21
21
  end
22
22
  end
23
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Allen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler