icalendar-recurrence 1.1.0 → 1.1.1
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ede64f8068bd4d1f17d2e8046c64821e8c1a3d7
|
4
|
+
data.tar.gz: a8fc2ed01b526d56066e871921130e9f019ec670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad43d2ac725ac2c3e30f360ed07b9e0e13ce507bc55f0175ea3d813a4549f004152bbde3044088ca10beffb90aca2f3a5bc55609a9d88df50e615a9f1c69b66e
|
7
|
+
data.tar.gz: cfcd923fbcf94746b0eb472418b9d752e0df8e80bf18fff7995af2e1a3bbc1ba3c42a9e5916e93bf1f05bc3668adde150d77f22d32333d421a26fc581d499f1d
|
data/CHANGELOG.md
CHANGED
@@ -82,15 +82,14 @@ module Icalendar
|
|
82
82
|
|
83
83
|
schedule
|
84
84
|
end
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
return 0 unless ical_duration
|
85
|
+
|
86
|
+
def convert_duration_to_seconds(ical_duration)
|
87
|
+
return 0 unless ical_duration
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
conversion_rates = { seconds: 1, minutes: 60, hours: 3600, days: 86400, weeks: 604800 }
|
90
|
+
seconds = conversion_rates.inject(0) { |sum, (unit, multiplier)| sum + ical_duration.send(unit) * multiplier }
|
91
|
+
seconds * (ical_duration.past ? -1 : 1)
|
92
|
+
end
|
93
93
|
end
|
94
|
-
|
95
94
|
end
|
96
95
|
end
|
data/spec/lib/schedule_spec.rb
CHANGED
@@ -26,7 +26,7 @@ describe Icalendar::Recurrence::Schedule do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
describe "#all_occurrences" do
|
31
31
|
let(:example_occurrences) do
|
32
32
|
weekly_event = example_event :weekly_with_count
|
@@ -46,4 +46,16 @@ describe Icalendar::Recurrence::Schedule do
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
context "given an event without an end time" do
|
50
|
+
let(:schedule) do
|
51
|
+
weekly_event = example_event :weekly_with_count # has 1 hour duration
|
52
|
+
allow(weekly_event).to receive(:end).and_return(nil)
|
53
|
+
Schedule.new(weekly_event)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "calculates end time based on start_time and duration" do
|
57
|
+
expect(schedule.end_time).to eq(schedule.start_time + 1.hour)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
49
61
|
end
|
@@ -11,6 +11,7 @@ SUMMARY:Every week
|
|
11
11
|
X-ALT-DESC;FMTTYPE=text/html:<html><body></body></html>
|
12
12
|
ORGANIZER;CN=Jordan Raine:mailto:foo@sfu.ca
|
13
13
|
DTSTART;VALUE=DATE:20140210
|
14
|
+
DURATION:PT1H0M0S
|
14
15
|
STATUS:CONFIRMED
|
15
16
|
CLASS:PUBLIC
|
16
17
|
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
|
@@ -20,4 +21,4 @@ LAST-MODIFIED:20140113T200625Z
|
|
20
21
|
DTSTAMP:20140113T200625Z
|
21
22
|
SEQUENCE:0
|
22
23
|
END:VEVENT
|
23
|
-
END:VCALENDAR
|
24
|
+
END:VCALENDAR
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icalendar-recurrence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Raine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: icalendar
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.2.2
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: Provides recurrence to icalendar gem.
|