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 +4 -4
- data/bin/easters +17 -0
- data/lib/fat_core/range.rb +1 -1
- data/lib/fat_core/version.rb +1 -1
- data/spec/lib/range_spec.rb +5 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb57601c694dcca084b7e0cedf6122267fae07d
|
4
|
+
data.tar.gz: 935cca77deba0bc578dd5ea6d0548b97bfb835e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/fat_core/range.rb
CHANGED
data/lib/fat_core/version.rb
CHANGED
data/spec/lib/range_spec.rb
CHANGED
@@ -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.
|
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-
|
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
|