fat_core 0.5.2 → 0.5.3

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: cdaf3715eeb1419b1926b013d783c344de551510
4
- data.tar.gz: 7f356adfefc210d1f5455b1ab9dac4e190f9697f
3
+ metadata.gz: 7bb57601c694dcca084b7e0cedf6122267fae07d
4
+ data.tar.gz: 935cca77deba0bc578dd5ea6d0548b97bfb835e9
5
5
  SHA512:
6
- metadata.gz: 02669fb5def651019c5673ae5ca6d532193db6e03054b94055dc324181a7e0d9f8ce2669c485d1f692667406c83908f9ba95764637806bff6bb1adbcb94d2a72
7
- data.tar.gz: 64b998e157700080144adc6b882c3cea0acd5949fa38dda836dd9158eddc7da8077b9df3d77f111e59a3c54cec67151fa097b4a182f26e95bb7fca33c879d2ff
6
+ metadata.gz: 1efe0764bc17f809d64bad67adf09ded6a21e2db79371f3821a48658c284699597d8c48b61d1437981e1d019023d73ffb16a5d7082323fc6b64988944722dd8c
7
+ data.tar.gz: 6376076ec020b330a5b35a58d26d73c4030f4d7643be3dbb0c6076e12e34588c4c1fa7be2e22ee7a1d9d146487048a8eb6cfa817990f684a971931c0e22c6053
data/bin/easters ADDED
@@ -0,0 +1,17 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ require 'fat_core'
4
+
5
+ base = Date.new(30, 1, 1)
6
+ 3000.times do |k|
7
+ dt = Date.new(base.year + k, 1, 1)
8
+ easter = dt.easter_this_year
9
+ print "%04d: #{easter}" % dt.year
10
+ if easter.month == 3 && easter.day <= 23
11
+ print easter.day == 22 ? " <<<\n" : " <<\n"
12
+ elsif easter.month == 4 && easter.day >= 24
13
+ print easter.day == 25 ? " >>>\n" : " >>\n"
14
+ else
15
+ print "\n"
16
+ end
17
+ end
@@ -155,7 +155,7 @@ class Range
155
155
  cur_point = rr.max.succ
156
156
  end
157
157
  end
158
- if cur_point < max
158
+ if cur_point <= max
159
159
  gaps << (cur_point..max)
160
160
  end
161
161
  gaps
@@ -1,7 +1,7 @@
1
1
  module FatCore
2
2
  MAJOR = 0
3
3
  MINOR = 5
4
- PATCH = 2
4
+ PATCH = 3
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
@@ -228,6 +228,11 @@ describe Range do
228
228
  expect(gaps[1]).to eq((7..10))
229
229
  end
230
230
 
231
+ it "should work for a single-point range" do
232
+ gaps = (3..3).gaps([(0..2), (4..4), (5..5), (6..6)])
233
+ expect(gaps[0]).to eq((3..3))
234
+ end
235
+
231
236
  it "should work even if ranges overlap" do
232
237
  gaps = (0..10).gaps([(-2..3), (2..8), (4..10)])
233
238
  expect(gaps).to be_empty
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-19 00:00:00.000000000 Z
11
+ date: 2015-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -167,7 +167,8 @@ dependencies:
167
167
  description: Write a longer description. Optional.
168
168
  email:
169
169
  - ded-law@ddoherty.net
170
- executables: []
170
+ executables:
171
+ - easters
171
172
  extensions: []
172
173
  extra_rdoc_files: []
173
174
  files:
@@ -180,6 +181,7 @@ files:
180
181
  - LICENSE.txt
181
182
  - README.md
182
183
  - Rakefile
184
+ - bin/easters
183
185
  - fat_core.gemspec
184
186
  - lib/core_extensions/date/fat_core.rb
185
187
  - lib/fat_core.rb