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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c7d5467534e26cb3bb22d205c08b4b064651f71
4
- data.tar.gz: 89bf8ac258976fbe3d95c8f3fd66e9908d5a72b8
3
+ metadata.gz: 1c1bee5bcb1f8cd61b3c8633f3871518a8141c6e
4
+ data.tar.gz: dcd57fb38eed485874e5384b57763fb349b26a5a
5
5
  SHA512:
6
- metadata.gz: 37af0836777d27ec8bc5b0b4fa83a6bc77baf71108a50d80401cf1a314be919c817aac5c1aa1651d7bb31f245f2c7c5989361c910d01e1c9ab4640332faaefa0
7
- data.tar.gz: 559990a51e3b9bc7b62da61f5036e53a937110e09f60ec9db4e6879f8811d4a84a4e40512275beb171773d8b214261769757a1c8d69a3e5b2303215c3e8abd1c
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.all? { |occurrence| Fixnum === occurrence }
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
@@ -1,3 +1,3 @@
1
1
  module Hiccup
2
- VERSION = "0.5.13"
2
+ VERSION = "0.5.14"
3
3
  end
@@ -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.13
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-07-08 00:00:00.000000000 Z
11
+ date: 2015-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport