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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 074b88d35639de246321396e3deb7986c75d0e6e
4
- data.tar.gz: 4a359d04e6abb0cde293420bc6193234d47b9c8e
2
+ SHA256:
3
+ metadata.gz: 5b3bdca8b5d09040c1b4ac4acae05c8e03547c5e6ff020e59535cc5755df14b2
4
+ data.tar.gz: 916f1bc25bdc43daac8a90681c9c0d02add86c46cce4096aaaae84ef5be7d3e9
5
5
  SHA512:
6
- metadata.gz: 2f41916e6b14eab832a57b778ac39b988346e2554a313228e2c8affe4a944605ad503954fcb9aae43d77ef6b04fe0a046489e65db967e7f7f7fa7836785035bf
7
- data.tar.gz: d8ce70bc5f52728efce01d298fdec98a5312549236ad9458e9950cb16cd71bb1cd5b61878b324d5db2a9a7c7284f6fd302540118b6901cdbce86c305cdf25dd5
6
+ metadata.gz: 7a8be4984db7ecd605a9384ae9fb337af3227d7bf35683fa436a090ef232b4aa5efcd3d49c42858c4ace3a94691419868e166382417d1070bdc3959bdbdf487e
7
+ data.tar.gz: 84acf9a45e4641ccf2ebf1adb697e1c98b13d55679c65ef04d5b02176f8e9de08b8450e883360edc8bcd7c523497442df973e13039b3111639b9c267ad58acb5
@@ -1,4 +1,4 @@
1
- Copyright the authors and contributors. All rights reserved.
1
+ Copyright (c) 2014-2018 TIMCRAFT
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
@@ -17,7 +17,7 @@ class Month
17
17
  }
18
18
 
19
19
  def initialize(year, number)
20
- unless NAMES.has_key?(number)
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'month'
3
- s.version = '1.3.0'
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', '~> 10.0')
14
- s.add_development_dependency('minitest', '~> 5.0')
13
+ s.add_development_dependency('rake', '>= 12')
14
+ s.add_development_dependency('minitest', '~> 5')
15
15
  s.require_path = 'lib'
16
16
  end
@@ -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.3.0
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: 2017-06-09 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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.0'
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.0'
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.11
73
+ rubygems_version: 2.7.6
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: See description