ice_cube 0.5.5 → 0.5.6
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.
- data/lib/ice_cube/schedule.rb +11 -0
- data/lib/ice_cube/version.rb +1 -1
- metadata +4 -4
data/lib/ice_cube/schedule.rb
CHANGED
@@ -124,6 +124,17 @@ module IceCube
|
|
124
124
|
find_occurrences { |head| head.upto(end_date) }
|
125
125
|
end
|
126
126
|
|
127
|
+
# Find remaining occurrences
|
128
|
+
def remaining_occurrences(from = Time.now)
|
129
|
+
raise ArgumentError.new('Schedule must have an end_time to use remaining_occurrences') unless @end_time
|
130
|
+
occurrences_between(from, @end_time)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Find next scheduled occurrence
|
134
|
+
def next_occurrence(from = Time.now)
|
135
|
+
remaining_occurrences(from).first
|
136
|
+
end
|
137
|
+
|
127
138
|
# Retrieve the first (n) occurrences of the schedule. May return less than
|
128
139
|
# n results, if the rules end before n results are reached.
|
129
140
|
def first(n = nil)
|
data/lib/ice_cube/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ice_cube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 6
|
10
|
+
version: 0.5.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Crepezzi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-06 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|