ice_cube 0.3.5 → 0.3.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 +3 -3
- data/lib/ice_cube/validation_types.rb +1 -2
- data/lib/ice_cube/version.rb +1 -1
- metadata +2 -2
data/lib/ice_cube/schedule.rb
CHANGED
@@ -55,9 +55,9 @@ module IceCube
|
|
55
55
|
# there's a lot that can happen here
|
56
56
|
def to_s
|
57
57
|
representation = ''
|
58
|
-
inc_dates = @rdates - @exdates
|
58
|
+
inc_dates = (@rdates - @exdates).compact
|
59
59
|
if inc_dates && !inc_dates.empty?
|
60
|
-
representation << inc_dates.map { |d| d.strftime(TIME_FORMAT) }.join(SEPARATOR)
|
60
|
+
representation << inc_dates.sort.map { |d| d.strftime(TIME_FORMAT) }.join(SEPARATOR)
|
61
61
|
end
|
62
62
|
if @rrule_occurrence_heads && !@rrule_occurrence_heads.empty?
|
63
63
|
representation << SEPARATOR unless representation.empty?
|
@@ -69,7 +69,7 @@ module IceCube
|
|
69
69
|
end
|
70
70
|
if @exdates && !@exdates.empty?
|
71
71
|
representation << SEPARATOR unless representation.empty?
|
72
|
-
representation << @exdates.map { |d| 'not on ' << d.strftime(TIME_FORMAT) }.join(SEPARATOR)
|
72
|
+
representation << @exdates.uniq.sort.map { |d| 'not on ' << d.strftime(TIME_FORMAT) }.join(SEPARATOR)
|
73
73
|
end
|
74
74
|
representation
|
75
75
|
end
|
@@ -78,7 +78,6 @@ module ValidationTypes
|
|
78
78
|
# on. ie: rule.day_of_week(:monday => [1, -1]) would mean
|
79
79
|
# that this rule should occur on the first and last mondays of each month.
|
80
80
|
def day_of_week(days)
|
81
|
-
puts days[0].to_s
|
82
81
|
@validations[:day_of_week] ||= {}
|
83
82
|
@validation_types[:day_of_week] ||= IceCube::DayOfWeekValidation.new(self)
|
84
83
|
days.each do |day, occurrences|
|
@@ -135,4 +134,4 @@ module ValidationTypes
|
|
135
134
|
self
|
136
135
|
end
|
137
136
|
|
138
|
-
end
|
137
|
+
end
|
data/lib/ice_cube/version.rb
CHANGED