icalendar 0.96.4 → 0.97
Sign up to get free protection for your applications and to get access to all the features.
- data/README +66 -53
- data/Rakefile +33 -24
- data/docs/api/classes/Array.html +9 -11
- data/docs/api/classes/Array.src/M000002.html +18 -0
- data/docs/api/classes/Date.html +2 -22
- data/docs/api/classes/Date.src/M000004.html +29 -0
- data/docs/api/classes/DateTime.html +2 -43
- data/docs/api/classes/DateTime.src/M000005.html +50 -0
- data/docs/api/classes/Fixnum.html +2 -11
- data/docs/api/classes/Fixnum.src/M000011.html +18 -0
- data/docs/api/classes/Float.html +2 -11
- data/docs/api/classes/Float.src/M000003.html +18 -0
- data/docs/api/classes/HashAttrs.html +15 -60
- data/docs/api/classes/HashAttrs.src/M000068.html +26 -0
- data/docs/api/classes/HashAttrs.src/M000069.html +27 -0
- data/docs/api/classes/HashAttrs.src/M000070.html +19 -0
- data/docs/api/classes/Icalendar/Alarm.html +5 -15
- data/docs/api/classes/Icalendar/Alarm.src/M000020.html +22 -0
- data/docs/api/classes/Icalendar/Base.html +41 -0
- data/docs/api/classes/Icalendar/Base.src/M000022.html +18 -0
- data/docs/api/classes/Icalendar/Base.src/M000023.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.html +116 -116
- data/docs/api/classes/Icalendar/Calendar.src/M000054.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000055.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000056.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000057.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000058.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000059.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000060.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000061.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000062.html +18 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000063.html +23 -0
- data/docs/api/classes/Icalendar/Calendar.src/M000064.html +19 -0
- data/docs/api/classes/Icalendar/Component.html +200 -367
- data/docs/api/classes/Icalendar/Component.src/M000029.html +22 -0
- data/docs/api/classes/Icalendar/Component.src/M000030.html +24 -0
- data/docs/api/classes/Icalendar/Component.src/M000035.html +22 -0
- data/docs/api/classes/Icalendar/Component.src/M000040.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000041.html +24 -0
- data/docs/api/classes/Icalendar/Component.src/M000042.html +28 -0
- data/docs/api/classes/Icalendar/Component.src/M000043.html +37 -0
- data/docs/api/classes/Icalendar/Component.src/M000044.html +37 -0
- data/docs/api/classes/Icalendar/Component.src/M000045.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000046.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000047.html +18 -0
- data/docs/api/classes/Icalendar/Component.src/M000048.html +26 -0
- data/docs/api/classes/Icalendar/Component.src/M000049.html +29 -0
- data/docs/api/classes/Icalendar/Component.src/M000050.html +22 -0
- data/docs/api/classes/Icalendar/DateProp.html +2 -12
- data/docs/api/classes/Icalendar/DateProp.src/M000013.html +19 -0
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.html +2 -59
- data/docs/api/classes/Icalendar/DateProp/ClassMethods.src/M000014.html +66 -0
- data/docs/api/classes/Icalendar/Daylight.html +5 -14
- data/docs/api/classes/Icalendar/Daylight.src/M000051.html +18 -0
- data/docs/api/classes/Icalendar/Event.html +30 -37
- data/docs/api/classes/Icalendar/Event.src/M000052.html +23 -0
- data/docs/api/classes/Icalendar/Event.src/M000053.html +23 -0
- data/docs/api/classes/Icalendar/Freebusy.html +5 -14
- data/docs/api/classes/Icalendar/Freebusy.src/M000065.html +21 -0
- data/docs/api/classes/Icalendar/Geo.html +192 -0
- data/docs/api/classes/Icalendar/Geo.src/M000024.html +19 -0
- data/docs/api/classes/Icalendar/Geo.src/M000025.html +18 -0
- data/docs/api/classes/Icalendar/Journal.html +2 -11
- data/docs/api/classes/Icalendar/Journal.src/M000016.html +22 -0
- data/docs/api/classes/Icalendar/Parameter.html +5 -23
- data/docs/api/classes/Icalendar/Parameter.src/M000066.html +27 -0
- data/docs/api/classes/Icalendar/Parser.html +36 -212
- data/docs/api/classes/Icalendar/Parser.src/M000017.html +32 -0
- data/docs/api/classes/Icalendar/Parser.src/M000018.html +43 -0
- data/docs/api/classes/Icalendar/Parser.src/M000019.html +33 -0
- data/docs/api/classes/Icalendar/Standard.html +2 -11
- data/docs/api/classes/Icalendar/Standard.src/M000015.html +18 -0
- data/docs/api/classes/Icalendar/Timezone.html +16 -48
- data/docs/api/classes/Icalendar/Timezone.src/M000026.html +19 -0
- data/docs/api/classes/Icalendar/Timezone.src/M000027.html +22 -0
- data/docs/api/classes/Icalendar/Timezone.src/M000028.html +18 -0
- data/docs/api/classes/Icalendar/Todo.html +5 -14
- data/docs/api/classes/Icalendar/Todo.src/M000021.html +22 -0
- data/docs/api/classes/Object.html +10 -59
- data/docs/api/classes/Object.src/M000006.html +20 -0
- data/docs/api/classes/Object.src/M000007.html +18 -0
- data/docs/api/classes/Object.src/M000008.html +20 -0
- data/docs/api/classes/Object.src/M000009.html +18 -0
- data/docs/api/classes/Object.src/M000010.html +18 -0
- data/docs/api/classes/String.html +2 -11
- data/docs/api/classes/String.src/M000012.html +18 -0
- data/docs/api/classes/Time.html +2 -26
- data/docs/api/classes/Time.src/M000001.html +37 -0
- data/docs/api/classes/URI/Generic.html +5 -14
- data/docs/api/classes/URI/Generic.src/M000067.html +18 -0
- data/docs/api/created.rid +1 -1
- data/docs/api/files/COPYING.html +1 -1
- data/docs/api/files/GPL.html +1 -1
- data/docs/api/files/README.html +76 -64
- data/docs/api/files/lib/hash_attrs_rb.html +1 -1
- data/docs/api/files/lib/icalendar/base_rb.html +1 -1
- data/docs/api/files/lib/icalendar/calendar_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/alarm_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/event_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/freebusy_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/journal_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/timezone_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/todo_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component_rb.html +8 -1
- data/docs/api/files/lib/icalendar/conversions_rb.html +1 -1
- data/docs/api/files/lib/icalendar/helpers_rb.html +1 -1
- data/docs/api/files/lib/icalendar/parameter_rb.html +1 -1
- data/docs/api/files/lib/icalendar/parser_rb.html +2 -1
- data/docs/api/files/lib/icalendar_rb.html +1 -1
- data/docs/api/files/lib/meta_rb.html +1 -1
- data/docs/api/fr_class_index.html +1 -0
- data/docs/api/fr_method_index.html +57 -41
- data/docs/rfcs/itip_notes.txt +69 -0
- data/examples/create_cal.rb +33 -32
- data/examples/parse_cal.rb +2 -2
- data/lib/icalendar/base.rb +8 -0
- data/lib/icalendar/calendar.rb +32 -3
- data/lib/icalendar/component.rb +187 -113
- data/lib/icalendar/component/alarm.rb +3 -0
- data/lib/icalendar/component/event.rb +9 -3
- data/lib/icalendar/component/freebusy.rb +3 -0
- data/lib/icalendar/component/journal.rb +4 -0
- data/lib/icalendar/component/todo.rb +4 -0
- data/lib/icalendar/conversions.rb +7 -1
- data/lib/icalendar/parser.rb +68 -90
- data/test/calendar_test.rb +32 -8
- data/test/component/event_test.rb +4 -7
- data/test/component/todo_test.rb +13 -0
- data/test/component_test.rb +21 -34
- data/test/conversions_test.rb +66 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-hash_attrs_rb.html +574 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-base_rb.html +575 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-calendar_rb.html +629 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-alarm_rb.html +581 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-event_rb.html +658 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-freebusy_rb.html +574 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-journal_rb.html +597 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-timezone_rb.html +625 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component-todo_rb.html +600 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-component_rb.html +924 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-conversions_rb.html +667 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar-parser_rb.html +938 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-icalendar_rb.html +576 -0
- data/test/coverage/-home-rosejn-projects-icalendar-lib-meta_rb.html +572 -0
- data/test/coverage/calendar_test_rb.html +590 -0
- data/test/coverage/component_test_rb.html +602 -0
- data/test/coverage/index.html +1009 -0
- data/test/coverage/lib-hash_attrs_rb.html +574 -0
- data/test/coverage/lib-icalendar-base_rb.html +583 -0
- data/test/coverage/lib-icalendar-calendar_rb.html +631 -0
- data/test/coverage/lib-icalendar-component-alarm_rb.html +581 -0
- data/test/coverage/lib-icalendar-component-event_rb.html +661 -0
- data/test/coverage/lib-icalendar-component-freebusy_rb.html +576 -0
- data/test/coverage/lib-icalendar-component-journal_rb.html +599 -0
- data/test/coverage/lib-icalendar-component-timezone_rb.html +625 -0
- data/test/coverage/lib-icalendar-component-todo_rb.html +602 -0
- data/test/coverage/lib-icalendar-component_rb.html +941 -0
- data/test/coverage/lib-icalendar-conversions_rb.html +673 -0
- data/test/coverage/lib-icalendar-parser_rb.html +916 -0
- data/test/coverage/lib-icalendar_rb.html +576 -0
- data/test/coverage/lib-meta_rb.html +572 -0
- data/test/coverage/parameter_test_rb.html +569 -0
- data/test/coverage/parser_test_rb.html +623 -0
- data/test/coverage/test-calendar_test_rb.html +590 -0
- data/test/coverage/test-component-event_test_rb.html +584 -0
- data/test/coverage/test-component_test_rb.html +606 -0
- data/test/coverage/test-conversions_test_rb.html +603 -0
- data/test/coverage/test-parameter_test_rb.html +569 -0
- data/test/coverage/test-parser_test_rb.html +624 -0
- data/test/interactive.rb +3 -1
- data/test/life.ics +46 -1092
- data/test/parameter_test.rb +11 -2
- data/test/parser_test.rb +12 -11
- metadata +259 -126
- data/test/old_life.ics +0 -46
- data/test/rw.ics +0 -947
data/README
CHANGED
@@ -30,68 +30,86 @@ transport such as infrared might also be used.
|
|
30
30
|
|
31
31
|
Now for some examples:
|
32
32
|
|
33
|
-
|
33
|
+
## Probably want to start with this
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
35
|
+
require 'rubygems' # Unless you install from the tarball or zip.
|
36
|
+
require 'icalendar'
|
37
|
+
require 'date'
|
38
|
+
|
39
|
+
include Icalendar # Probably do this in your class to limit namespace overlap
|
40
|
+
|
41
|
+
## Creating calendars and events is easy.
|
42
|
+
|
43
|
+
# Create a calendar with an event (standard method)
|
44
|
+
cal = Calendar.new
|
45
|
+
cal.event do
|
46
|
+
dtstart Date.new(2005, 04, 29)
|
47
|
+
dtend Date.new(2005, 04, 28)
|
48
|
+
summary "Meeting with the man."
|
49
|
+
description "Have a long lunch meeting and decide nothing..."
|
50
|
+
klass "PRIVATE"
|
51
|
+
end
|
52
|
+
|
53
|
+
## Or you can make events like this
|
54
|
+
event = Event.new
|
55
|
+
event.start = DateTime.civil(2006, 6, 23, 8, 30)
|
56
|
+
event.summary = "A great event!"
|
57
|
+
cal.add_event(event)
|
58
|
+
|
59
|
+
event2 = cal.event # This automatically adds the event to the calendar
|
60
|
+
event2.start = DateTime.civil(2006, 6, 24, 8, 30)
|
61
|
+
event2.summary = "Another great event!"
|
62
|
+
|
63
|
+
# Now with support for property parameters
|
64
|
+
params = {"ALTREP" =>['"http://my.language.net"'], "LANGUAGE" => ["SPANISH"]}
|
65
|
+
|
66
|
+
cal.event do
|
67
|
+
dtstart Date.new(2005, 04, 29)
|
68
|
+
dtend Date.new(2005, 04, 28)
|
69
|
+
summary "This is a summary with params.", params
|
70
|
+
end
|
62
71
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
72
|
+
# We can output the calendar as a string to write to a file,
|
73
|
+
# network port, database etc.
|
74
|
+
cal_string = cal.to_ical
|
75
|
+
puts cal_string
|
67
76
|
|
68
77
|
== Parsing iCalendars:
|
69
78
|
|
70
|
-
|
71
|
-
require 'date'
|
72
|
-
|
73
|
-
# Open a file or string to parse
|
79
|
+
# Open a file or pass a string to the parser
|
74
80
|
cal_file = File.open("single_event.ics")
|
75
81
|
|
76
82
|
# Parser returns an array of calendars because a single file
|
77
|
-
# can have multiple
|
78
|
-
cals = Icalendar
|
83
|
+
# can have multiple calendars.
|
84
|
+
cals = Icalendar.parse(cal_file)
|
79
85
|
cal = cals.first
|
80
86
|
|
81
87
|
# Now you can access the cal object in just the same way I created it
|
82
88
|
event = cal.events.first
|
83
89
|
|
84
|
-
puts "
|
90
|
+
puts "start date-time: " + event.dtstart
|
85
91
|
puts "summary: " + event.summary
|
92
|
+
|
93
|
+
== Finders:
|
94
|
+
|
95
|
+
Often times in web apps and other interactive applications you'll need to
|
96
|
+
lookup items in a calendar to make changes or get details. Now you can find
|
97
|
+
everything by the unique id automatically associated with all components.
|
86
98
|
|
87
|
-
|
99
|
+
cal = Calendar.new
|
100
|
+
10.times { cal.event } # Create 10 events with only default data.
|
101
|
+
some_event = cal.events[5] # Grab it from the array of events
|
88
102
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
103
|
+
# Use the uid as the key in your app
|
104
|
+
key = some_event.uid
|
105
|
+
|
106
|
+
# so later you can find it.
|
107
|
+
same_event = cal.find_event(key)
|
108
|
+
|
109
|
+
== Examples:
|
110
|
+
|
111
|
+
Check the unit tests for examples of most things you'll want to do, but please
|
112
|
+
send me example code or let me know what's missing.
|
95
113
|
|
96
114
|
== Download
|
97
115
|
|
@@ -99,20 +117,15 @@ The latest release version of this library can be found at
|
|
99
117
|
|
100
118
|
* http://rubyforge.org/projects/icalendar/
|
101
119
|
|
102
|
-
If you would like to help with development or use the most current version
|
103
|
-
you can check out the tree from the subversion repository:
|
104
|
-
|
105
|
-
* svn co https://rosejn.net/svn/icalendar icalendar
|
106
|
-
|
107
120
|
Documentation can be found at
|
108
121
|
|
109
122
|
* http://icalendar.rubyforge.org/
|
110
123
|
|
111
124
|
== Installation
|
112
125
|
|
113
|
-
|
126
|
+
It's all about rubygems:
|
114
127
|
|
115
|
-
$ gem install icalendar
|
128
|
+
$ sudo gem install icalendar
|
116
129
|
|
117
130
|
== License
|
118
131
|
|
data/Rakefile
CHANGED
@@ -2,8 +2,10 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'rake/testtask'
|
4
4
|
require 'rake/rdoctask'
|
5
|
+
require 'rake/clean'
|
6
|
+
require 'rake/contrib/sshpublisher'
|
5
7
|
|
6
|
-
PKG_VERSION = "0.
|
8
|
+
PKG_VERSION = "0.97"
|
7
9
|
|
8
10
|
$VERBOSE = nil
|
9
11
|
TEST_CHANGES_SINCE = Time.now - 600 # Recent tests = changed in last 10 minutes
|
@@ -11,28 +13,6 @@ TEST_CHANGES_SINCE = Time.now - 600 # Recent tests = changed in last 10 minutes
|
|
11
13
|
desc "Run all the unit tests"
|
12
14
|
task :default => [ :test, :lines ]
|
13
15
|
|
14
|
-
# Look up tests for recently modified sources.
|
15
|
-
def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
|
16
|
-
FileList[source_pattern].map do |path|
|
17
|
-
if File.mtime(path) > touched_since
|
18
|
-
test = "#{test_path}/#{File.basename(path, '.rb')}_test.rb"
|
19
|
-
test if File.exists?(test)
|
20
|
-
end
|
21
|
-
end.compact
|
22
|
-
end
|
23
|
-
|
24
|
-
desc 'Test recent changes.'
|
25
|
-
Rake::TestTask.new(:rtest) do |t|
|
26
|
-
since = TEST_CHANGES_SINCE
|
27
|
-
touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } +
|
28
|
-
recent_tests('lib/icalendar/*.rb', 'test', since) +
|
29
|
-
recent_tests('lib/icalendar/component/*.rb', 'test/component', since)
|
30
|
-
|
31
|
-
t.libs << 'test'
|
32
|
-
t.verbose = true
|
33
|
-
t.test_files = touched.uniq
|
34
|
-
end
|
35
|
-
|
36
16
|
desc "Run the unit tests in test"
|
37
17
|
Rake::TestTask.new(:test) { |t|
|
38
18
|
t.libs << "test"
|
@@ -40,6 +20,30 @@ Rake::TestTask.new(:test) { |t|
|
|
40
20
|
t.verbose = true
|
41
21
|
}
|
42
22
|
|
23
|
+
# rcov code coverage
|
24
|
+
rcov_path = '/usr/local/bin/rcov'
|
25
|
+
rcov_test_output = "./test/coverage"
|
26
|
+
rcov_exclude = "interactive.rb,read_write.rb,single_event.ics,simplecal,life.ics"
|
27
|
+
|
28
|
+
# Add our created paths to the 'rake clobber' list
|
29
|
+
CLOBBER.include(rcov_test_output)
|
30
|
+
|
31
|
+
desc 'Removes all previous unit test coverage information'
|
32
|
+
task (:reset_unit_test_coverage) do |t|
|
33
|
+
rm_rf rcov_unit_test_output
|
34
|
+
mkdir rcov_unit_test_output
|
35
|
+
end
|
36
|
+
|
37
|
+
desc 'Run all unit tests with Rcov to measure coverage'
|
38
|
+
Rake::TestTask.new(:rcov) do |t|
|
39
|
+
t.libs << "test"
|
40
|
+
t.pattern = 'test/**/*_test.rb'
|
41
|
+
t.ruby_opts << rcov_path
|
42
|
+
t.ruby_opts << "-o #{rcov_test_output}"
|
43
|
+
t.ruby_opts << "-x #{rcov_exclude}"
|
44
|
+
t.verbose = true
|
45
|
+
end
|
46
|
+
|
43
47
|
# Generate the RDoc documentation
|
44
48
|
Rake::RDocTask.new(:doc) { |rdoc|
|
45
49
|
rdoc.main = 'README'
|
@@ -47,7 +51,7 @@ Rake::RDocTask.new(:doc) { |rdoc|
|
|
47
51
|
rdoc.rdoc_files.include('GPL', 'COPYING')
|
48
52
|
rdoc.rdoc_dir = 'docs/api'
|
49
53
|
rdoc.title = "iCalendar -- Internet Calendaring for Ruby"
|
50
|
-
rdoc.options << "--include
|
54
|
+
rdoc.options << "--include=examples --line-numbers --inline-source"
|
51
55
|
rdoc.options << "--accessor=ical_component,ical_property,ical_multi_property"
|
52
56
|
}
|
53
57
|
|
@@ -80,6 +84,11 @@ Rake::GemPackageTask.new(spec) do |pkg|
|
|
80
84
|
pkg.need_zip = true
|
81
85
|
end
|
82
86
|
|
87
|
+
desc 'Install the gem globally (requires sudo)'
|
88
|
+
task :install => :package do |t|
|
89
|
+
`sudo gem install pkg/icalendar-#{PKG_VERSION}.gem`
|
90
|
+
end
|
91
|
+
|
83
92
|
task :lines do
|
84
93
|
lines = 0
|
85
94
|
codelines = 0
|
data/docs/api/classes/Array.html
CHANGED
@@ -80,6 +80,13 @@
|
|
80
80
|
|
81
81
|
<div id="contextContent">
|
82
82
|
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
From the spec: "Values in a list of values MUST be separated by a
|
86
|
+
COMMA character (US-ASCII decimal 44)."
|
87
|
+
</p>
|
88
|
+
|
89
|
+
</div>
|
83
90
|
|
84
91
|
|
85
92
|
</div>
|
@@ -114,22 +121,13 @@
|
|
114
121
|
<a name="M000002"></a>
|
115
122
|
|
116
123
|
<div class="method-heading">
|
117
|
-
<a href="
|
124
|
+
<a href="Array.src/M000002.html" target="Code" class="method-signature"
|
125
|
+
onclick="popupCode('Array.src/M000002.html');return false;">
|
118
126
|
<span class="method-name">to_ical</span><span class="method-args">()</span>
|
119
127
|
</a>
|
120
128
|
</div>
|
121
129
|
|
122
130
|
<div class="method-description">
|
123
|
-
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
125
|
-
<div class="method-source-code" id="M000002-source">
|
126
|
-
<pre>
|
127
|
-
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 40</span>
|
128
|
-
40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
|
129
|
-
41: <span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">elem</span><span class="ruby-operator">|</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">to_ical</span>}.<span class="ruby-identifier">join</span> <span class="ruby-value str">','</span>
|
130
|
-
42: <span class="ruby-keyword kw">end</span>
|
131
|
-
</pre>
|
132
|
-
</div>
|
133
131
|
</div>
|
134
132
|
</div>
|
135
133
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_ical (Array)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 42</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
|
15
|
+
<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">elem</span><span class="ruby-operator">|</span> <span class="ruby-identifier">elem</span>.<span class="ruby-identifier">to_ical</span>}.<span class="ruby-identifier">join</span> <span class="ruby-value str">','</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
data/docs/api/classes/Date.html
CHANGED
@@ -114,33 +114,13 @@
|
|
114
114
|
<a name="M000004"></a>
|
115
115
|
|
116
116
|
<div class="method-heading">
|
117
|
-
<a href="
|
117
|
+
<a href="Date.src/M000004.html" target="Code" class="method-signature"
|
118
|
+
onclick="popupCode('Date.src/M000004.html');return false;">
|
118
119
|
<span class="method-name">to_ical</span><span class="method-args">(utc = false)</span>
|
119
120
|
</a>
|
120
121
|
</div>
|
121
122
|
|
122
123
|
<div class="method-description">
|
123
|
-
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
125
|
-
<div class="method-source-code" id="M000004-source">
|
126
|
-
<pre>
|
127
|
-
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 92</span>
|
128
|
-
92: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>(<span class="ruby-identifier">utc</span> = <span class="ruby-keyword kw">false</span>)
|
129
|
-
93: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
130
|
-
94:
|
131
|
-
95: <span class="ruby-comment cmt"># 4 digit year</span>
|
132
|
-
96: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_s</span>
|
133
|
-
97:
|
134
|
-
98: <span class="ruby-comment cmt"># Double digit month</span>
|
135
|
-
99: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
136
|
-
100: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_s</span>
|
137
|
-
101:
|
138
|
-
102: <span class="ruby-comment cmt"># Double digit day</span>
|
139
|
-
103: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
140
|
-
104: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_s</span>
|
141
|
-
105: <span class="ruby-keyword kw">end</span>
|
142
|
-
</pre>
|
143
|
-
</div>
|
144
124
|
</div>
|
145
125
|
</div>
|
146
126
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_ical (Date)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 94</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>(<span class="ruby-identifier">utc</span> = <span class="ruby-keyword kw">false</span>)
|
15
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
16
|
+
|
17
|
+
<span class="ruby-comment cmt"># 4 digit year</span>
|
18
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_s</span>
|
19
|
+
|
20
|
+
<span class="ruby-comment cmt"># Double digit month</span>
|
21
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
22
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_s</span>
|
23
|
+
|
24
|
+
<span class="ruby-comment cmt"># Double digit day</span>
|
25
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
26
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_s</span>
|
27
|
+
<span class="ruby-keyword kw">end</span></pre>
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -114,54 +114,13 @@
|
|
114
114
|
<a name="M000005"></a>
|
115
115
|
|
116
116
|
<div class="method-heading">
|
117
|
-
<a href="
|
117
|
+
<a href="DateTime.src/M000005.html" target="Code" class="method-signature"
|
118
|
+
onclick="popupCode('DateTime.src/M000005.html');return false;">
|
118
119
|
<span class="method-name">to_ical</span><span class="method-args">(utc = false)</span>
|
119
120
|
</a>
|
120
121
|
</div>
|
121
122
|
|
122
123
|
<div class="method-description">
|
123
|
-
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
125
|
-
<div class="method-source-code" id="M000005-source">
|
126
|
-
<pre>
|
127
|
-
<span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 54</span>
|
128
|
-
54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>(<span class="ruby-identifier">utc</span> = <span class="ruby-keyword kw">false</span>)
|
129
|
-
55: <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
130
|
-
56:
|
131
|
-
57: <span class="ruby-comment cmt"># 4 digit year</span>
|
132
|
-
58: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_s</span>
|
133
|
-
59:
|
134
|
-
60: <span class="ruby-comment cmt"># Double digit month</span>
|
135
|
-
61: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
136
|
-
62: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_s</span>
|
137
|
-
63:
|
138
|
-
64: <span class="ruby-comment cmt"># Double digit day</span>
|
139
|
-
65: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
140
|
-
66: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_s</span>
|
141
|
-
67:
|
142
|
-
68: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"T"</span>
|
143
|
-
69:
|
144
|
-
70: <span class="ruby-comment cmt"># Double digit hour</span>
|
145
|
-
71: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hour</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
146
|
-
72: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hour</span>.<span class="ruby-identifier">to_s</span>
|
147
|
-
73:
|
148
|
-
74: <span class="ruby-comment cmt"># Double digit minute</span>
|
149
|
-
75: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
150
|
-
76: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min</span>.<span class="ruby-identifier">to_s</span>
|
151
|
-
77:
|
152
|
-
78: <span class="ruby-comment cmt"># Double digit second</span>
|
153
|
-
79: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sec</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
154
|
-
80: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sec</span>.<span class="ruby-identifier">to_s</span>
|
155
|
-
81:
|
156
|
-
82: <span class="ruby-comment cmt"># UTC time gets a Z suffix</span>
|
157
|
-
83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">utc</span>
|
158
|
-
84: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"Z"</span>
|
159
|
-
85: <span class="ruby-keyword kw">end</span>
|
160
|
-
86:
|
161
|
-
87: <span class="ruby-identifier">s</span>
|
162
|
-
88: <span class="ruby-keyword kw">end</span>
|
163
|
-
</pre>
|
164
|
-
</div>
|
165
124
|
</div>
|
166
125
|
</div>
|
167
126
|
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_ical (DateTime)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/icalendar/conversions.rb, line 56</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>(<span class="ruby-identifier">utc</span> = <span class="ruby-keyword kw">false</span>)
|
15
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
16
|
+
|
17
|
+
<span class="ruby-comment cmt"># 4 digit year</span>
|
18
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">year</span>.<span class="ruby-identifier">to_s</span>
|
19
|
+
|
20
|
+
<span class="ruby-comment cmt"># Double digit month</span>
|
21
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
22
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">month</span>.<span class="ruby-identifier">to_s</span>
|
23
|
+
|
24
|
+
<span class="ruby-comment cmt"># Double digit day</span>
|
25
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
26
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">day</span>.<span class="ruby-identifier">to_s</span>
|
27
|
+
|
28
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"T"</span>
|
29
|
+
|
30
|
+
<span class="ruby-comment cmt"># Double digit hour</span>
|
31
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hour</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
32
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hour</span>.<span class="ruby-identifier">to_s</span>
|
33
|
+
|
34
|
+
<span class="ruby-comment cmt"># Double digit minute</span>
|
35
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
36
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">min</span>.<span class="ruby-identifier">to_s</span>
|
37
|
+
|
38
|
+
<span class="ruby-comment cmt"># Double digit second</span>
|
39
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"0"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sec</span> <span class="ruby-operator">></span> <span class="ruby-value">9</span>
|
40
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sec</span>.<span class="ruby-identifier">to_s</span>
|
41
|
+
|
42
|
+
<span class="ruby-comment cmt"># UTC time gets a Z suffix</span>
|
43
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">utc</span>
|
44
|
+
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"Z"</span>
|
45
|
+
<span class="ruby-keyword kw">end</span>
|
46
|
+
|
47
|
+
<span class="ruby-identifier">s</span>
|
48
|
+
<span class="ruby-keyword kw">end</span></pre>
|
49
|
+
</body>
|
50
|
+
</html>
|