month 1.2.0 → 1.3.0
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 +4 -4
- data/README.md +7 -10
- data/lib/month.rb +2 -0
- data/month.gemspec +1 -1
- data/spec/month_spec.rb +10 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 074b88d35639de246321396e3deb7986c75d0e6e
|
4
|
+
data.tar.gz: 4a359d04e6abb0cde293420bc6193234d47b9c8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f41916e6b14eab832a57b778ac39b988346e2554a313228e2c8affe4a944605ad503954fcb9aae43d77ef6b04fe0a046489e65db967e7f7f7fa7836785035bf
|
7
|
+
data.tar.gz: d8ce70bc5f52728efce01d298fdec98a5312549236ad9458e9950cb16cd71bb1cd5b61878b324d5db2a9a7c7284f6fd302540118b6901cdbce86c305cdf25dd5
|
data/README.md
CHANGED
@@ -1,18 +1,17 @@
|
|
1
|
-
month
|
2
|
-
|
1
|
+
# month
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/month) [](https://travis-ci.org/timcraft/month)
|
3
4
|
|
4
5
|
|
5
6
|
A little Ruby library for working with months.
|
6
7
|
|
7
8
|
|
8
|
-
Installation
|
9
|
-
------------
|
9
|
+
## Installation
|
10
10
|
|
11
11
|
$ gem install month
|
12
12
|
|
13
13
|
|
14
|
-
Feature tour
|
15
|
-
------------
|
14
|
+
## Feature tour
|
16
15
|
|
17
16
|
You can create a new Month object with a year and month number:
|
18
17
|
|
@@ -117,8 +116,7 @@ Month objects can be used in ranges.
|
|
117
116
|
Month objects are comparable.
|
118
117
|
|
119
118
|
|
120
|
-
Bonus
|
121
|
-
------------
|
119
|
+
## Bonus extras
|
122
120
|
|
123
121
|
The Month::Methods module provides methods for constructing Month objects
|
124
122
|
and Date objects in a manner that closely resembles written english:
|
@@ -135,8 +133,7 @@ It is not included globally by default; you can either include it within
|
|
135
133
|
your own modules/classes or globally within your own application/script.
|
136
134
|
|
137
135
|
|
138
|
-
|
139
|
-
-------
|
136
|
+
## Thanks
|
140
137
|
|
141
138
|
This current implementation is an accidental rewrite of an older library/gem
|
142
139
|
with the same name/purpose ([fhwang / month](https://github.com/fhwang/month)).
|
data/lib/month.rb
CHANGED
data/month.gemspec
CHANGED
data/spec/month_spec.rb
CHANGED
@@ -3,9 +3,16 @@ require 'minitest/autorun'
|
|
3
3
|
require_relative '../lib/month'
|
4
4
|
|
5
5
|
describe 'Month' do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
describe 'constructor' do
|
7
|
+
it 'raises an exception when initialized with an invalid number' do
|
8
|
+
proc { Month.new(2014, 0) }.must_raise(ArgumentError)
|
9
|
+
proc { Month.new(2014, 100) }.must_raise(ArgumentError)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'returns frozen instances' do
|
13
|
+
month = Month.new(2017, 1)
|
14
|
+
month.frozen?.must_equal(true)
|
15
|
+
end
|
9
16
|
end
|
10
17
|
|
11
18
|
describe 'year method' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: month
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.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: 2017-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -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.
|
73
|
+
rubygems_version: 2.6.11
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: See description
|