month 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +1 -1
- data/lib/month.rb +3 -1
- data/month.gemspec +3 -3
- data/spec/month_spec.rb +4 -0
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5b3bdca8b5d09040c1b4ac4acae05c8e03547c5e6ff020e59535cc5755df14b2
|
4
|
+
data.tar.gz: 916f1bc25bdc43daac8a90681c9c0d02add86c46cce4096aaaae84ef5be7d3e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8be4984db7ecd605a9384ae9fb337af3227d7bf35683fa436a090ef232b4aa5efcd3d49c42858c4ace3a94691419868e166382417d1070bdc3959bdbdf487e
|
7
|
+
data.tar.gz: 84acf9a45e4641ccf2ebf1adb697e1c98b13d55679c65ef04d5b02176f8e9de08b8450e883360edc8bcd7c523497442df973e13039b3111639b9c267ad58acb5
|
data/LICENSE.txt
CHANGED
data/lib/month.rb
CHANGED
@@ -17,7 +17,7 @@ class Month
|
|
17
17
|
}
|
18
18
|
|
19
19
|
def initialize(year, number)
|
20
|
-
unless NAMES.
|
20
|
+
unless NAMES.key?(number)
|
21
21
|
raise ArgumentError, 'invalid month number'
|
22
22
|
end
|
23
23
|
|
@@ -51,6 +51,8 @@ class Month
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def <=>(month)
|
54
|
+
return unless month.class == self.class
|
55
|
+
|
54
56
|
if @year == month.year
|
55
57
|
@number <=> month.number
|
56
58
|
else
|
data/month.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'month'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.4.0'
|
4
4
|
s.license = 'MIT'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ['Tim Craft']
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.summary = 'See description'
|
11
11
|
s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE.txt README.md month.gemspec)
|
12
12
|
s.required_ruby_version = '>= 1.9.3'
|
13
|
-
s.add_development_dependency('rake', '
|
14
|
-
s.add_development_dependency('minitest', '~> 5
|
13
|
+
s.add_development_dependency('rake', '>= 12')
|
14
|
+
s.add_development_dependency('minitest', '~> 5')
|
15
15
|
s.require_path = 'lib'
|
16
16
|
end
|
data/spec/month_spec.rb
CHANGED
@@ -78,6 +78,10 @@ describe 'Month' do
|
|
78
78
|
(Month.new(2014, 2) > Month.new(2014, 1)).must_equal(true)
|
79
79
|
end
|
80
80
|
|
81
|
+
it 'supports comparison with nil' do
|
82
|
+
(Month.new(2014, 1) == nil).must_equal(false)
|
83
|
+
end
|
84
|
+
|
81
85
|
it 'supports being used in a range' do
|
82
86
|
range = Month.new(2014, 1) .. Month.new(2014, 4)
|
83
87
|
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: month
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Craft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '12'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5
|
33
|
+
version: '5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5
|
40
|
+
version: '5'
|
41
41
|
description: A little Ruby library for working with months
|
42
42
|
email:
|
43
43
|
- mail@timcraft.com
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.6
|
73
|
+
rubygems_version: 2.7.6
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: See description
|