ical_importer 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ical_importer (0.0.7)
4
+ ical_importer (0.0.8)
5
5
  activesupport (~> 3.0.15)
6
6
  i18n
7
7
  ri_cal
@@ -47,7 +47,11 @@ module IcalImporter
47
47
  if event_time.is_a? DateTime
48
48
  (event_time.tzid == :floating) ? event_time : event_time.utc
49
49
  else
50
- event_time.to_datetime
50
+ begin
51
+ event_time.to_datetime
52
+ rescue
53
+ event_time
54
+ end
51
55
  end
52
56
  end
53
57
  end
@@ -63,7 +63,7 @@ module IcalImporter
63
63
  # multiplying thise "X" times by the frequency that the event recurrs
64
64
  case @rrule.freq
65
65
  when "DAILY"
66
- @local_event.recur_end_date = frequency_template.days if @rrule.bounded?.is_a? Fixnum # convert X times to a date
66
+ @local_event.recur_end_date = local_event.start_date_time + (rrule.bounded? * rrule.interval - 1).days if @rrule.bounded?.is_a? Fixnum # convert X times to a date
67
67
  when "WEEKLY"
68
68
  if @rrule.to_ical.include?("BYDAY=")
69
69
  remote_days = @rrule.to_ical.split("BYDAY=").last.split(";WKST=").first.split(',')
@@ -77,19 +77,15 @@ module IcalImporter
77
77
  end
78
78
  end
79
79
  # recurrence X times is probably broken - we can select multiple times in a week
80
- @local_event.recur_end_date = @local_event.start_date_time + ((@rrule.bounded? * @rrule.interval - 1) / remote_days.length).weeks if @rrule.bounded?.is_a?(Fixnum)
80
+ @local_event.recur_end_date = @local_event.start_date_time + ((@rrule.bounded? * @rrule.interval - 1) / remote_days.length).weeks if @rrule.bounded?.is_a?(Fixnum)
81
81
  when "MONTHLY"
82
82
  @local_event.recur_month_repeat_by = (@rrule.to_ical =~ /BYDAY/) ? "day_of_week" : "day_of_month"
83
- @local_event.recur_end_date = frequency_template.months if @rrule.bounded?.is_a? Fixnum # convert X times to a date
83
+ @local_event.recur_end_date = local_event.start_date_time + (rrule.bounded? * rrule.interval - 1).months if @rrule.bounded?.is_a? Fixnum # convert X times to a date
84
84
  when "YEARLY"
85
- @local_event.recur_end_date = frequency_template.years if @rrule.bounded?.is_a? Fixnum # convert X times to a date
85
+ @local_event.recur_end_date = local_event.start_date_time + (rrule.bounded? * rrule.interval - 1).years if @rrule.bounded?.is_a? Fixnum # convert X times to a date
86
86
  end
87
87
  end
88
88
 
89
- def frequency_template
90
- @local_event.start_date_time + (@rrule.bounded? * @rrule.interval - 1)
91
- end
92
-
93
89
  def recur_map
94
90
  {
95
91
  "DAILY" => "day",
@@ -1,3 +1,3 @@
1
1
  module IcalImporter
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ical_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-17 00:00:00.000000000 Z
12
+ date: 2012-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -158,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  segments:
160
160
  - 0
161
- hash: 2694229606449926665
161
+ hash: 2481768714040711217
162
162
  required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements:
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  segments:
169
169
  - 0
170
- hash: 2694229606449926665
170
+ hash: 2481768714040711217
171
171
  requirements: []
172
172
  rubyforge_project:
173
173
  rubygems_version: 1.8.24