icalendar 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/icalendar/base.rb +1 -1
- data/lib/icalendar/calendar.rb +3 -3
- data/test/test_calendar.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840281a09af33da66b8c292c3eedda0aafd3ce60
|
4
|
+
data.tar.gz: 2f5c282164f680485f8f6cc16dfacc0874e542bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf6e5b790341c0f4cf523d08b19b67590d631ab4740246ae2f56fcb486e3261f302d59d6e8ed4eb689fa80b1290c11605e62bfc64f1197c6a8a0013d8ae3390d
|
7
|
+
data.tar.gz: b52091e873332de047e71bcfbc6b2c75b2f54a01b8c40dc98964c8f850f0ef9b4ae25d4f62368a5018ea5341aac991e351e62c2b9b2ee7f9b6f159717c8c594c
|
data/History.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
=== 1.5.2 2014-02-22
|
2
|
+
* Output timezone components first
|
3
|
+
* Fix undefined local variable or method 'e' - Jason Stirk
|
4
|
+
|
1
5
|
=== 1.5.1 2014-02-27
|
2
6
|
* Check for dtend existence before setting timezone - Jonas Grau
|
3
7
|
* Clean up and refactor components - Kasper Timm Hansen
|
data/lib/icalendar/base.rb
CHANGED
data/lib/icalendar/calendar.rb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
module Icalendar
|
10
10
|
|
11
11
|
class Calendar < Component
|
12
|
-
ical_component :events, :todos, :journals, :freebusys
|
12
|
+
ical_component :timezones, :events, :todos, :journals, :freebusys
|
13
13
|
|
14
14
|
ical_property :calscale, :calendar_scale
|
15
15
|
ical_property :prodid, :product_id
|
@@ -42,8 +42,8 @@ module Icalendar
|
|
42
42
|
if block
|
43
43
|
instance_eval(&block)
|
44
44
|
if tzid
|
45
|
-
dtstart.ical_params = { "TZID" =>
|
46
|
-
dtend.ical_params = { "TZID" =>
|
45
|
+
dtstart.ical_params = { "TZID" => tzid }
|
46
|
+
dtend.ical_params = { "TZID" => tzid } unless dtend.nil?
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/test/test_calendar.rb
CHANGED
@@ -43,6 +43,26 @@ class TestCalendar < Test::Unit::TestCase
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
def test_block_creation_with_timezone
|
47
|
+
cal = Calendar.new
|
48
|
+
|
49
|
+
event_start = DateTime.new 1997, 9, 3, 19, 0, 0
|
50
|
+
tz = TZInfo::Timezone.get "Europe/Copenhagen"
|
51
|
+
timezone = tz.ical_timezone event_start
|
52
|
+
cal.add timezone
|
53
|
+
|
54
|
+
cal.event do
|
55
|
+
dtstart event_start
|
56
|
+
dtend "19970903T190000Z"
|
57
|
+
summary "This is my summary"
|
58
|
+
end
|
59
|
+
|
60
|
+
cal.events.each do |ev|
|
61
|
+
assert_equal(event_start, ev.dtstart)
|
62
|
+
assert_equal("19970903T190000Z", ev.dtend)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
46
66
|
def test_create_multiple_event_calendar
|
47
67
|
# Create a fresh calendar
|
48
68
|
Timecop.freeze DateTime.new(2013, 12, 26, 5, 0, 0, '+0000')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icalendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Ahearn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|