hiccup 0.5.13 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiccup/enumerable/monthly_enumerator.rb +3 -1
- data/lib/hiccup/version.rb +1 -1
- data/test/monthly_enumerator_test.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c1bee5bcb1f8cd61b3c8633f3871518a8141c6e
|
4
|
+
data.tar.gz: dcd57fb38eed485874e5384b57763fb349b26a5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81b11821607bd174ce60aa98f4bb44df1e2567fde655f06ac0c90da1167811a3ca420cf43464b26cd6eb930ebef48b07815a77a51f249e0f1951ff4cbd86bd83
|
7
|
+
data.tar.gz: 6ba823a3b95c039da615e6e7a01e9ee237650a9823b9b16d02184a45996fd733a1ee038de85fe01279467998255fa1882bd5a852c3af90e9c49bea9c7052fc6a
|
@@ -5,7 +5,9 @@ module Hiccup
|
|
5
5
|
class MonthlyEnumerator < ScheduleEnumerator
|
6
6
|
|
7
7
|
def self.for(schedule)
|
8
|
-
if schedule.monthly_pattern.
|
8
|
+
if schedule.monthly_pattern.empty?
|
9
|
+
NeverEnumerator
|
10
|
+
elsif schedule.monthly_pattern.all? { |occurrence| Fixnum === occurrence }
|
9
11
|
MonthlyDateEnumerator
|
10
12
|
else
|
11
13
|
self
|
data/lib/hiccup/version.rb
CHANGED
@@ -69,4 +69,21 @@ class MonthlyEnumeratorTest < ActiveSupport::TestCase
|
|
69
69
|
end
|
70
70
|
|
71
71
|
|
72
|
+
context "with an empty schedule" do
|
73
|
+
setup do
|
74
|
+
@schedule = Schedule.new(
|
75
|
+
kind: :monthly,
|
76
|
+
skip: 2,
|
77
|
+
monthly_pattern: [],
|
78
|
+
start_date: Date.new(2015, 1, 1))
|
79
|
+
end
|
80
|
+
|
81
|
+
should "always return nil" do
|
82
|
+
date = Date.new(2015, 2, 1)
|
83
|
+
enumerator = @schedule.enumerator.new(@schedule, date)
|
84
|
+
assert_equal nil, enumerator.next
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
|
72
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiccup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Lail
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|