flexyear 2.1.1 → 2.2.1

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: 929b57a6f2f71b83adb9d436b5304e88802ccec1
4
- data.tar.gz: d4936577ab3e36019669b9c9222fc8611a757cbd
3
+ metadata.gz: 2fb4798c126d9f8ee4d7045436f487f3a679af87
4
+ data.tar.gz: f1fc3aad4bbcd29cbaf4955d0079a581b8ac0b85
5
5
  SHA512:
6
- metadata.gz: f20398d5815ac685692558a248e2f1eab79735186d34b8ea7fc9668287a73b152e972fcbff1be08dd0b129a1deb870adb8a812b001ae0dda6553239d10c44443
7
- data.tar.gz: 2e746c4ee7fbb2b48d84a022674da74e78e5690a175e64ef93becb052e1ebe694ae5c07e838ae9d8ccc6a25420faac887e043069afe413e58455f970af7caed5
6
+ metadata.gz: ddf3c28f8240c9d44d61deb52210c9f8872e767c4640dd8ce727f7e1418cc96aa2806c4826cf379e9450f05a14c3aaea528f940a28bcf254c5b0bf5bca8fcc1f
7
+ data.tar.gz: d9d213c018110dde753c7bdcba2eeb5a5f1a0971df51ae9eb37b3cfa1d7c4a0912b931d95f24d2e762ee68d9315c4caf92c272e486ff6d8ccbbe5b166a31d156
data/README.md CHANGED
@@ -48,3 +48,11 @@ Or install it yourself as:
48
48
  ### Test
49
49
 
50
50
  `rake`
51
+
52
+ ### Publish a new version
53
+
54
+ We use bundlers rake commands to release versions. To cut and release a new version:
55
+
56
+ 1. Update lib/flexyear/version.rb and increment to your new desired version
57
+ 2. Commit and push your version bump
58
+ 3. Run `bundle exec rake release` to package and publish that version
@@ -1,3 +1,3 @@
1
1
  class FlexYear
2
- VERSION = "2.1.1"
2
+ VERSION = "2.2.1"
3
3
  end
data/lib/flexyear.rb CHANGED
@@ -39,6 +39,10 @@ class FlexYear
39
39
  @year_input
40
40
  end
41
41
 
42
+ def decade?
43
+ year_low % 10 == 0 && year_high % 10 == 9
44
+ end
45
+
42
46
  private
43
47
 
44
48
  def parse_year_list(years)
@@ -30,42 +30,49 @@ describe FlexYear do
30
30
  subject { flexyear_class.new(1979) }
31
31
  its(:year_low) { should eq(1979) }
32
32
  its(:year_high) { should eq(1979) }
33
+ its(:decade?) { should eq(false) }
33
34
  end
34
35
 
35
36
  context "given 1979" do
36
37
  subject { flexyear_class.new("1979") }
37
38
  its(:year_low) { should eq(1979) }
38
39
  its(:year_high) { should eq(1979) }
40
+ its(:decade?) { should eq(false) }
39
41
  end
40
42
 
41
43
  context "given 1979 (with a space)" do
42
44
  subject { flexyear_class.new("1979 ") }
43
45
  its(:year_low) { should eq(1979) }
44
46
  its(:year_high) { should eq(1979) }
47
+ its(:decade?) { should eq(false) }
45
48
  end
46
49
 
47
50
  context 'given 197*' do
48
51
  subject { flexyear_class.new('197*') }
49
52
  its(:year_low) { should eq(1970) }
50
53
  its(:year_high) { should eq(1979) }
54
+ its(:decade?) { should eq(true) }
51
55
  end
52
56
 
53
57
  context "given 1970s" do
54
58
  subject { flexyear_class.new("1970s") }
55
59
  its(:year_low) { should eq(1970) }
56
60
  its(:year_high) { should eq(1979) }
61
+ its(:decade?) { should eq(true) }
57
62
  end
58
63
 
59
64
  context "given 70s" do
60
65
  subject { flexyear_class.new("70s") }
61
66
  its(:year_low) { should eq(1970) }
62
67
  its(:year_high) { should eq(1979) }
68
+ its(:decade?) { should eq(true) }
63
69
  end
64
70
 
65
71
  context "given something with negative and dots" do
66
72
  subject { flexyear_class.new("approx.-2006") }
67
73
  its(:year_low) { should eq(2005) }
68
74
  its(:year_high) { should eq(2007) }
75
+ its(:decade?) { should eq(false) }
69
76
  end
70
77
 
71
78
  context 'given before 1973' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexyear
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Melnick & Yan Pritzker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-21 00:00:00.000000000 Z
11
+ date: 2019-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler