month 1.2.0 → 1.3.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
2
  SHA1:
3
- metadata.gz: 99d3a1f9ba6751770d9a06df16bd73ee776a8726
4
- data.tar.gz: 2939e754f6952365f4874ecf4cd6ae262975a723
3
+ metadata.gz: 074b88d35639de246321396e3deb7986c75d0e6e
4
+ data.tar.gz: 4a359d04e6abb0cde293420bc6193234d47b9c8e
5
5
  SHA512:
6
- metadata.gz: c2e439bbb93bc6b10b0a7a0f0ead067c366660ecaa884c3a2eda73681f1ffa2032600b1964e6cc6fdb75b266f05d2065b7ab6f5a1e723de4179af7a4c82b8f11
7
- data.tar.gz: 38a4336b1e7c8ad7c258241379a174e4b9538dd76b826e0c1399efbf8e0db7fb00acf9080875f12383e9445b6665f30c3edc07d4fec4b2fb5837981e21a1e70e
6
+ metadata.gz: 2f41916e6b14eab832a57b778ac39b988346e2554a313228e2c8affe4a944605ad503954fcb9aae43d77ef6b04fe0a046489e65db967e7f7f7fa7836785035bf
7
+ data.tar.gz: d8ce70bc5f52728efce01d298fdec98a5312549236ad9458e9950cb16cd71bb1cd5b61878b324d5db2a9a7c7284f6fd302540118b6901cdbce86c305cdf25dd5
data/README.md CHANGED
@@ -1,18 +1,17 @@
1
- month
2
- =====
1
+ # month
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/month.svg)](https://badge.fury.io/rb/month) [![Build Status](https://api.travis-ci.org/timcraft/month.svg?branch=master)](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 Extras
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
- History
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)).
@@ -22,6 +22,8 @@ class Month
22
22
  end
23
23
 
24
24
  @year, @number = year, number
25
+
26
+ freeze
25
27
  end
26
28
 
27
29
  attr_reader :year, :number
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'month'
3
- s.version = '1.2.0'
3
+ s.version = '1.3.0'
4
4
  s.license = 'MIT'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
@@ -3,9 +3,16 @@ require 'minitest/autorun'
3
3
  require_relative '../lib/month'
4
4
 
5
5
  describe 'Month' do
6
- it 'raises an exception when initialized with an invalid number' do
7
- proc { Month.new(2014, 0) }.must_raise(ArgumentError)
8
- proc { Month.new(2014, 100) }.must_raise(ArgumentError)
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.2.0
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: 2015-06-25 00:00:00.000000000 Z
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.2.2
73
+ rubygems_version: 2.6.11
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: See description