ice_cube 0.6.5 → 0.6.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/rules/daily_rule.rb +8 -9
- data/lib/ice_cube/version.rb +1 -1
- metadata +4 -4
@@ -6,32 +6,31 @@ module IceCube
|
|
6
6
|
# Determine whether this rule occurs on a give date.
|
7
7
|
def in_interval?(date, start_date)
|
8
8
|
#make sure we're in a proper interval
|
9
|
-
day_count =
|
9
|
+
day_count = date.yday - start_date.yday
|
10
10
|
day_count % @interval == 0
|
11
|
-
true
|
12
11
|
end
|
13
12
|
|
14
|
-
def to_ical
|
13
|
+
def to_ical
|
15
14
|
'FREQ=DAILY' << to_ical_base
|
16
15
|
end
|
17
|
-
|
16
|
+
|
18
17
|
def to_s
|
19
18
|
to_s_base 'Daily', "Every #{@interval} days"
|
20
19
|
end
|
21
|
-
|
20
|
+
|
22
21
|
protected
|
23
|
-
|
22
|
+
|
24
23
|
def default_jump(date, attempt_count = nil)
|
25
24
|
goal = date + IceCube::ONE_DAY * @interval
|
26
25
|
adjust(goal, date)
|
27
26
|
end
|
28
|
-
|
27
|
+
|
29
28
|
private
|
30
|
-
|
29
|
+
|
31
30
|
def initialize(interval)
|
32
31
|
super(interval)
|
33
32
|
end
|
34
|
-
|
33
|
+
|
35
34
|
end
|
36
35
|
|
37
36
|
end
|
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: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 6
|
10
|
+
version: 0.6.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: 2011-01-
|
18
|
+
date: 2011-01-18 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|