ice_cube 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,15 +79,15 @@ module IceCube
79
79
  representation_pieces.join(SEPARATOR)
80
80
  end
81
81
 
82
- def to_ical
83
- representation_pieces = ["DTSTART#{TimeUtil.ical_format(@start_date)}"]
82
+ def to_ical(force_utc = false)
83
+ representation_pieces = ["DTSTART#{TimeUtil.ical_format(@start_date, force_utc)}"]
84
84
  representation_pieces << "DURATION:#{TimeUtil.ical_duration(@duration)}" if @duration
85
85
  inc_dates = (@rdates - @exdates).uniq
86
- representation_pieces.concat inc_dates.sort.map { |d| "RDATE#{TimeUtil.ical_format(d)}" } if inc_dates.any?
87
- representation_pieces.concat @exdates.uniq.sort.map { |d| "EXDATE#{TimeUtil.ical_format(d)}" } if @exdates
86
+ representation_pieces.concat inc_dates.sort.map { |d| "RDATE#{TimeUtil.ical_format(d, force_utc)}" } if inc_dates.any?
87
+ representation_pieces.concat @exdates.uniq.sort.map { |d| "EXDATE#{TimeUtil.ical_format(d, force_utc)}" } if @exdates
88
88
  representation_pieces.concat @rrule_occurrence_heads.map { |r| "RRULE:#{r.rule.to_ical}" } if @rrule_occurrence_heads
89
89
  representation_pieces.concat @exrule_occurrence_heads.map { |r| "EXRULE:#{r.rule.to_ical}" } if @exrule_occurrence_heads
90
- representation_pieces << "DTEND#{TimeUtil.ical_format(@end_time)}" if @end_time
90
+ representation_pieces << "DTEND#{TimeUtil.ical_format(@end_time, force_utc)}" if @end_time
91
91
  representation_pieces.join(NEWLINE)
92
92
  end
93
93
 
@@ -72,7 +72,8 @@ module IceCube
72
72
  is_leap?(date.year) ? LeapYearMonthDays[date.month - 1] : CommonYearMonthDays[date.month - 1]
73
73
  end
74
74
 
75
- def self.ical_format(time)
75
+ def self.ical_format(time, force_utc)
76
+ time = time.dup.utc if force_utc
76
77
  if time.utc?
77
78
  ":#{time.strftime('%Y%m%dT%H%M%SZ')}" # utc time
78
79
  else
@@ -1,5 +1,5 @@
1
1
  module IceCube
2
2
 
3
- VERSION = '0.6.6'
3
+ VERSION = '0.6.7'
4
4
 
5
5
  end
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: 11
5
- prerelease: false
4
+ hash: 9
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 6
10
- version: 0.6.6
9
+ - 7
10
+ version: 0.6.7
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 00:00:00 -05:00
18
+ date: 2011-04-22 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  requirements: []
95
95
 
96
96
  rubyforge_project: ice-cube
97
- rubygems_version: 1.3.7
97
+ rubygems_version: 1.4.1
98
98
  signing_key:
99
99
  specification_version: 3
100
100
  summary: Ruby Date Recurrence Library