icalendar 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 1.2.3 2013-03-09
2
+ * Call `super` from Component#method_missing
3
+ * Clean up warnings in test suite
4
+ * Add Gemfile for installing development dependencies
5
+
1
6
  === 1.2.2 2013-02-16
2
7
  * added TZURL property to Timezone component - spacepixels
3
8
  * correct days in RRule ("[TU,WE]" -> "TU,WE") - Christoph Finkensiep
@@ -2,7 +2,6 @@ COPYING
2
2
  GPL
3
3
  History.txt
4
4
  Manifest.txt
5
- PostInstall.txt
6
5
  README.rdoc
7
6
  Rakefile
8
7
  config/website.yml
@@ -22,7 +21,6 @@ lib/icalendar/component/journal.rb
22
21
  lib/icalendar/component/timezone.rb
23
22
  lib/icalendar/component/todo.rb
24
23
  lib/icalendar/conversions.rb
25
- lib/icalendar/conversions.rb.orig
26
24
  lib/icalendar/helpers.rb
27
25
  lib/icalendar/parameter.rb
28
26
  lib/icalendar/parser.rb
@@ -35,9 +33,6 @@ script/generate
35
33
  script/recur1.ics
36
34
  script/tryit.rb
37
35
  script/txt2html
38
- test.ical
39
- test.ics
40
- test.rb
41
36
  test/component/test_event.rb
42
37
  test/component/test_timezone.rb
43
38
  test/component/test_todo.rb
@@ -53,7 +48,6 @@ test/test_conversions.rb
53
48
  test/test_helper.rb
54
49
  test/test_parameter.rb
55
50
  test/test_parser.rb
56
- test2.rb
57
51
  website/index.html
58
52
  website/index.txt
59
53
  website/javascripts/rounded_corners_lite.inc.js
@@ -1,6 +1,6 @@
1
1
  = iCalendar -- Internet calendaring, Ruby style
2
2
 
3
- * http://github.com/sdague/icalendar
3
+ * http://github.com/icalendar/icalendar
4
4
 
5
5
  == DESCRIPTION
6
6
 
@@ -75,8 +75,8 @@ transport such as infrared might also be used.
75
75
  dtend Date.new(2005, 04, 28)
76
76
  summary "This is a summary with params.", params
77
77
  end
78
-
79
- # We can output the calendar as a string to write to a file,
78
+
79
+ # We can output the calendar as a string to write to a file,
80
80
  # network port, database etc.
81
81
  cal_string = cal.to_ical
82
82
  puts cal_string
@@ -97,7 +97,7 @@ transport such as infrared might also be used.
97
97
  trigger "-PT15M" # 15 minutes before
98
98
  add_attach "ftp://host.com/novo-procs/felizano.exe", {"FMTTYPE" => "application/binary"} # email attachments (optional)
99
99
  end
100
-
100
+
101
101
  alarm do
102
102
  action "DISPLAY" # This line isn't necessary, it's the default
103
103
  summary "Alarm notification"
@@ -128,7 +128,7 @@ transport such as infrared might also be used.
128
128
  # TRIGGER:-P1DT0H0M0S
129
129
  # SUMMARY:Alarm notification
130
130
  # END:VALARM
131
- #
131
+ #
132
132
  # BEGIN:VALARM
133
133
  # ACTION:AUDIO
134
134
  # ATTACH;VALUE=URI:Basso
@@ -136,7 +136,7 @@ transport such as infrared might also be used.
136
136
  # END:VALARM
137
137
 
138
138
  == Timezones
139
-
139
+
140
140
  # Create a timezone definition (previous convention)
141
141
  cal = Calendar.new
142
142
  timezone = Icalendar::Timezone.new
@@ -182,9 +182,9 @@ transport such as infrared might also be used.
182
182
  add_recurrence_rule "YEARLY;BYMONTH=11;BYDAY=1SU"
183
183
  end
184
184
  end
185
-
185
+
186
186
  # Both conventions output
187
-
187
+
188
188
  # BEGIN:VTIMEZONE
189
189
  # TZID:America/Chicago
190
190
  # BEGIN:DAYLIGHT
@@ -205,20 +205,20 @@ transport such as infrared might also be used.
205
205
 
206
206
  == Unicode
207
207
  Add `$KCODE = 'u'` to make icalender work correctly with Utf8 texts
208
-
208
+
209
209
  == Parsing iCalendars:
210
-
210
+
211
211
  # Open a file or pass a string to the parser
212
212
  cal_file = File.open("single_event.ics")
213
-
213
+
214
214
  # Parser returns an array of calendars because a single file
215
215
  # can have multiple calendars.
216
216
  cals = Icalendar.parse(cal_file)
217
217
  cal = cals.first
218
-
218
+
219
219
  # Now you can access the cal object in just the same way I created it
220
220
  event = cal.events.first
221
-
221
+
222
222
  puts "start date-time: " + event.dtstart
223
223
  puts "summary: " + event.summary
224
224
 
@@ -227,7 +227,7 @@ Add `$KCODE = 'u'` to make icalender work correctly with Utf8 texts
227
227
  Often times in web apps and other interactive applications you'll need to
228
228
  lookup items in a calendar to make changes or get details. Now you can find
229
229
  everything by the unique id automatically associated with all components.
230
-
230
+
231
231
  cal = Calendar.new
232
232
  10.times { cal.event } # Create 10 events with only default data.
233
233
  some_event = cal.events[5] # Grab it from the array of events
@@ -261,18 +261,13 @@ $ sudo gem install icalendar
261
261
 
262
262
  == Testing
263
263
 
264
- You cannot use the most recent version of rake (10.x +), so you must install an
265
- older version, such as 0.9.2.2:
266
-
267
- gem install rake -v=0.9.2.2
268
-
269
264
  The gem `hoe` is required as well:
270
265
 
271
266
  gem install hoe
272
267
 
273
268
  To run the tests:
274
269
 
275
- rake _0.9.2.2_ test
270
+ rake test
276
271
 
277
272
  == License
278
273
 
@@ -280,7 +275,7 @@ This library is released under the same license as Ruby itself.
280
275
 
281
276
  == Support & Contributions
282
277
 
283
- The iCalendar library homepage is http://icalendar.rubyforge.org/
278
+ The iCalendar library homepage is http://icalendar.rubyforge.org/
284
279
 
285
280
  There is an icalendar-devel@rubyforge.org mailing list that can be
286
281
  used for asking questions, making comments or submitting patches.
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
- gem 'hoe', '>= 2.1.0'
3
1
  require 'hoe'
4
2
  require 'fileutils'
5
3
  require './lib/icalendar'
@@ -10,11 +8,8 @@ Hoe.plugin :website
10
8
  # Generate all the Rake tasks
11
9
  # Run 'rake -T' to see list of generated tasks (from gem root directory)
12
10
  $hoe = Hoe.spec 'icalendar' do
13
- self.developer 'Sean Dague', 'sean@dague.net'
14
- self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
15
- self.rubyforge_name = self.name # TODO this is default value
16
- self.extra_rdoc_files = ["README.rdoc"]
17
- self.readme_file = "README.rdoc"
11
+ developer 'Ryan Ahearn', 'ryan.c.ahearn@gmail.com'
12
+ self.extra_rdoc_files += %w[COPYING GPL]
18
13
  end
19
14
 
20
15
  if ENV['UNDER_HUDSON']
@@ -1,21 +1,14 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "icalendar"
3
3
  s.version = "1.2"
4
+
4
5
  s.homepage = "http://icalendar.rubyforge.org/"
5
6
  s.platform = Gem::Platform::RUBY
6
7
  s.summary = "A ruby implementation of the iCalendar specification (RFC-2445)."
7
8
  s.description = "Implements the iCalendar specification (RFC-2445) in Ruby. This allows for the generation and parsing of .ics files, which are used by a variety of calendaring applications."
8
9
 
9
- s.files = `git ls-files`.split("\n")
10
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
11
-
12
- s.require_path = "lib"
13
- s.autorequire = "icalendar"
14
- s.has_rdoc = true
15
- s.extra_rdoc_files = ["README", "COPYING", "GPL"]
16
- s.rdoc_options.concat ['--main', 'README']
17
-
18
- s.author = "Sean Dague"
19
- s.email = "sean@dague.net"
10
+ s.add_development_dependency 'hoe', '~> 3.5'
11
+ s.add_development_dependency 'newgem', '~> 1.5'
12
+ s.add_development_dependency 'rubyforge', '~> 2.0'
20
13
  end
21
14
 
@@ -1,6 +1,7 @@
1
1
  =begin
2
2
  Copyright (C) 2005 Jeff Rose
3
3
  Copyright (C) 2009-2010 Sean Dague
4
+ Copyright (C) 2013- Ryan Ahearn
4
5
 
5
6
  This library is free software; you can redistribute it and/or modify it
6
7
  under the same terms as the ruby language itself, see the file COPYING for
@@ -10,7 +11,7 @@ require 'logger'
10
11
 
11
12
  module Icalendar #:nodoc:
12
13
 
13
- VERSION = '1.2.2'
14
+ VERSION = '1.2.3'
14
15
 
15
16
  # A simple error class to differentiate iCalendar library exceptions
16
17
  # from ruby language exceptions or others.
@@ -134,7 +134,7 @@ module Icalendar
134
134
  if key =~ /ip_.*/
135
135
  key = key[3..-1]
136
136
  end
137
-
137
+
138
138
  # Property name
139
139
  unless multiline_property?(key)
140
140
  prelude = "#{key.gsub(/_/, '-').upcase}" +
@@ -412,13 +412,11 @@ module Icalendar
412
412
  end
413
413
  end
414
414
 
415
- def method_missing(method_name, *args)
415
+ def method_missing(method, *args)
416
416
  @@logger.debug("Inside method_missing...")
417
- method_name = method_name.to_s.downcase
417
+ method_name = method.to_s.downcase
418
418
 
419
- unless method_name =~ /x_.*/
420
- raise NoMethodError, "Method Name: #{method_name}"
421
- end
419
+ super unless method_name =~ /x_.*/
422
420
 
423
421
  # x-properties are accessed with underscore but stored with a dash so
424
422
  # they output correctly and we don't have to special case the
@@ -20,8 +20,6 @@ module Icalendar
20
20
  # New York City starting from 1967. Each line represents a description
21
21
  # or rule for a particular observance.
22
22
  class Timezone < Component
23
- ical_component :standard, :daylight
24
-
25
23
  # Single properties
26
24
  ical_property :dtstart, :start
27
25
  ical_property :tzoffsetto, :timezone_offset_to
@@ -63,6 +63,12 @@ class TestComponent < Test::Unit::TestCase
63
63
  assert_equal("my-custom-property", @event.x_foobar)
64
64
  end
65
65
 
66
+ def test_method_missing_no_x
67
+ assert_raise NoMethodError do
68
+ @event.there_is_no_such_method
69
+ end
70
+ end
71
+
66
72
  def test_respond_to_missing
67
73
  component = Icalendar::Component.new('name')
68
74
  assert !component.respond_to?(:there_is_no_such_method)
@@ -34,45 +34,30 @@
34
34
  <div class="sidebar">
35
35
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/icalendar"; return false'>
36
36
  <p>Get Version</p>
37
- <a href="http://rubyforge.org/projects/icalendar" class="numbers">1.2.1</a>
37
+ <a href="http://rubyforge.org/projects/icalendar" class="numbers">1.2.2</a>
38
38
  </div>
39
39
  </div>
40
40
  <h2>What</h2>
41
+ <p>This gem implements the iCalendar specification (<span class="caps">RFC</span>-2445) in Ruby. This allows for the generation and parsing of .ics files, which are used by a variety of calendaring applications.</p>
42
+ <h2>How</h2>
43
+ <p>Please see <a href="https://github.com/icalendar/icalendar/blob/master/README.rdoc">the <span class="caps">README</span></a> for more information.</p>
41
44
  <h2>Installing</h2>
42
45
  <p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">icalendar</span></pre></p>
43
- <h2>The basics</h2>
44
- <h2>Demonstration of usage</h2>
45
- <h2>Forum</h2>
46
- <p><a href="http://groups.google.com/group/icalendar">http://groups.google.com/group/icalendar</a></p>
47
- <p><span class="caps">TODO</span> &#8211; create Google Group &#8211; icalendar</p>
48
46
  <h2>How to submit patches</h2>
49
- <p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
50
- <p><span class="caps">TODO</span> &#8211; pick <span class="caps">SVN</span> or Git instructions</p>
51
- <p>The trunk repository is <code>svn://rubyforge.org/var/svn/icalendar/trunk</code> for anonymous access.</p>
52
- <p><span class="caps">OOOORRRR</span></p>
53
- <p>You can fetch the source from either:</p>
47
+ <p>Please submit pull requests on github from a rebased topic branch</p>
54
48
  <ul>
55
- <li>rubyforge: <a href="http://rubyforge.org/scm/?group_id=540">http://rubyforge.org/scm/?group_id=540</a></li>
56
- </ul>
57
- <pre>git clone git://rubyforge.org/icalendar.git</pre>
58
- <ul>
59
- <li>github: <a href="http://github.com/sdague/icalendar/tree/master">http://github.com/sdague/icalendar/tree/master</a></li>
49
+ <li><a href="http://github.com/icalendar/icalendar/">http://github.com/icalendar/icalendar/</a></li>
60
50
  </ul>
61
51
  <pre>git clone git://github.com/sdague/icalendar.git</pre>
62
- <ul>
63
- <li>gitorious: <a href="git://gitorious.org/icalendar/mainline.git">git://gitorious.org/icalendar/mainline.git</a></li>
64
- </ul>
65
- <pre>git clone git://gitorious.org/icalendar/mainline.git</pre>
66
52
  <h3>Build and test instructions</h3>
67
53
  <pre>cd icalendar
68
54
  rake test
69
55
  rake install_gem</pre>
70
56
  <h2>License</h2>
71
- <p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
72
- <h2>Contact</h2>
73
- <p>Comments are welcome. Send an email to <a href="mailto:FIXME"><span class="caps">FIXME</span> full name</a> email via the <a href="http://groups.google.com/group/icalendar">forum</a></p>
57
+ <p>This code is free to use under the terms of the <span class="caps">GPL</span> or <span class="caps">BSD</span> licenses.</p>
58
+ <p>Please see the <a href="https://github.com/icalendar/icalendar/blob/master/COPYING"><span class="caps">COPYING</span></a> file for more information.</p>
74
59
  <p class="coda">
75
- <a href="FIXME email">FIXME full name</a>, 10th March 2010<br>
60
+ <a href="mailto:ryan@coshx.com">Ryan Ahearn</a>, 9th March 2013<br>
76
61
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
77
62
  </p>
78
63
  </div>
@@ -1,79 +1,34 @@
1
1
  h1. icalendar
2
2
 
3
-
4
3
  h2. What
5
4
 
5
+ This gem implements the iCalendar specification (RFC-2445) in Ruby. This allows for the generation and parsing of .ics files, which are used by a variety of calendaring applications.
6
6
 
7
- h2. Installing
8
-
9
- <pre syntax="ruby">sudo gem install icalendar</pre>
10
-
11
- h2. The basics
12
-
13
-
14
- h2. Demonstration of usage
15
-
7
+ h2. How
16
8
 
9
+ Please see "the README":https://github.com/icalendar/icalendar/blob/master/README.rdoc for more information.
17
10
 
18
- h2. Forum
19
-
20
- "http://groups.google.com/group/icalendar":http://groups.google.com/group/icalendar
11
+ h2. Installing
21
12
 
22
- TODO - create Google Group - icalendar
13
+ <pre syntax="ruby">sudo gem install icalendar</pre>
23
14
 
24
15
  h2. How to submit patches
25
16
 
26
- Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
27
-
28
- TODO - pick SVN or Git instructions
29
-
30
- The trunk repository is <code>svn://rubyforge.org/var/svn/icalendar/trunk</code> for anonymous access.
31
-
32
- OOOORRRR
33
-
34
- You can fetch the source from either:
17
+ Please submit pull requests on github from a rebased topic branch
35
18
 
36
- <% if rubyforge_project_id %>
37
-
38
- * rubyforge: "http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>":http://rubyforge.org/scm/?group_id=<%= rubyforge_project_id %>
39
-
40
- <pre>git clone git://rubyforge.org/icalendar.git</pre>
41
-
42
- <% else %>
43
-
44
- * rubyforge: MISSING IN ACTION
45
-
46
- TODO - You can not created a RubyForge project, OR have not run <code>rubyforge config</code>
47
- yet to refresh your local rubyforge data with this projects' id information.
48
-
49
- When you do this, this message will magically disappear!
50
-
51
- Or you can hack website/index.txt and make it all go away!!
52
-
53
- <% end %>
54
-
55
- * github: "http://github.com/sdague/icalendar/tree/master":http://github.com/sdague/icalendar/tree/master
19
+ * "http://github.com/icalendar/icalendar/":http://github.com/icalendar/icalendar/
56
20
 
57
21
  <pre>git clone git://github.com/sdague/icalendar.git</pre>
58
22
 
59
-
60
-
61
- * gitorious: "git://gitorious.org/icalendar/mainline.git":git://gitorious.org/icalendar/mainline.git
62
-
63
- <pre>git clone git://gitorious.org/icalendar/mainline.git</pre>
64
-
65
23
  h3. Build and test instructions
66
24
 
67
25
  <pre>cd icalendar
68
26
  rake test
69
27
  rake install_gem</pre>
70
28
 
71
-
72
29
  h2. License
73
30
 
74
- This code is free to use under the terms of the MIT license.
75
-
76
- h2. Contact
31
+ This code is free to use under the terms of the GPL or BSD licenses.
77
32
 
78
- Comments are welcome. Send an email to "FIXME full name":mailto:FIXME email via the "forum":http://groups.google.com/group/icalendar
33
+ Please see the "COPYING":https://github.com/icalendar/icalendar/blob/master/COPYING file for more information.
79
34
 
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  <%= body %>
41
41
  <p class="coda">
42
- <a href="FIXME email">FIXME full name</a>, <%= modified.pretty %><br>
42
+ <a href="mailto:ryan@coshx.com">Ryan Ahearn</a>, <%= modified.pretty %><br>
43
43
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
44
44
  </p>
45
45
  </div>
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icalendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Sean Dague
8
+ - Ryan Ahearn
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-16 00:00:00.000000000 Z
12
+ date: 2013-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '3.3'
53
+ version: '3.5'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '3.3'
61
+ version: '3.5'
62
62
  description: ! "This is a Ruby library for dealing with iCalendar files. Rather than\nexplaining
63
63
  myself, here is the introduction from RFC-2445, which\ndefines the format:\n\nThe
64
64
  use of calendaring and scheduling has grown considerably in the\nlast decade. Enterprise
@@ -80,21 +80,21 @@ description: ! "This is a Ruby library for dealing with iCalendar files. Rather
80
80
  wired-network transport, or some form of unwired\ntransport such as infrared might
81
81
  also be used."
82
82
  email:
83
- - sean@dague.net
83
+ - ryan.c.ahearn@gmail.com
84
84
  executables: []
85
85
  extensions: []
86
86
  extra_rdoc_files:
87
87
  - History.txt
88
88
  - Manifest.txt
89
- - PostInstall.txt
90
89
  - README.rdoc
91
90
  - website/index.txt
91
+ - COPYING
92
+ - GPL
92
93
  files:
93
94
  - COPYING
94
95
  - GPL
95
96
  - History.txt
96
97
  - Manifest.txt
97
- - PostInstall.txt
98
98
  - README.rdoc
99
99
  - Rakefile
100
100
  - config/website.yml
@@ -114,7 +114,6 @@ files:
114
114
  - lib/icalendar/component/timezone.rb
115
115
  - lib/icalendar/component/todo.rb
116
116
  - lib/icalendar/conversions.rb
117
- - lib/icalendar/conversions.rb.orig
118
117
  - lib/icalendar/helpers.rb
119
118
  - lib/icalendar/parameter.rb
120
119
  - lib/icalendar/parser.rb
@@ -127,9 +126,6 @@ files:
127
126
  - script/recur1.ics
128
127
  - script/tryit.rb
129
128
  - script/txt2html
130
- - test.ical
131
- - test.ics
132
- - test.rb
133
129
  - test/component/test_event.rb
134
130
  - test/component/test_timezone.rb
135
131
  - test/component/test_todo.rb
@@ -145,16 +141,15 @@ files:
145
141
  - test/test_helper.rb
146
142
  - test/test_parameter.rb
147
143
  - test/test_parser.rb
148
- - test2.rb
149
144
  - website/index.html
150
145
  - website/index.txt
151
146
  - website/javascripts/rounded_corners_lite.inc.js
152
147
  - website/stylesheets/screen.css
153
148
  - website/template.html.erb
154
149
  - .gemtest
155
- homepage: http://github.com/sdague/icalendar
150
+ homepage: http://github.com/icalendar/icalendar
156
151
  licenses: []
157
- post_install_message: PostInstall.txt
152
+ post_install_message:
158
153
  rdoc_options:
159
154
  - --main
160
155
  - README.rdoc
@@ -166,25 +161,31 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
161
  - - ! '>='
167
162
  - !ruby/object:Gem::Version
168
163
  version: '0'
164
+ segments:
165
+ - 0
166
+ hash: -3884597809888146880
169
167
  required_rubygems_version: !ruby/object:Gem::Requirement
170
168
  none: false
171
169
  requirements:
172
170
  - - ! '>='
173
171
  - !ruby/object:Gem::Version
174
172
  version: '0'
173
+ segments:
174
+ - 0
175
+ hash: -3884597809888146880
175
176
  requirements: []
176
177
  rubyforge_project: icalendar
177
- rubygems_version: 1.8.23
178
+ rubygems_version: 1.8.25
178
179
  signing_key:
179
180
  specification_version: 3
180
181
  summary: This is a Ruby library for dealing with iCalendar files
181
182
  test_files:
183
+ - test/component/test_event.rb
184
+ - test/component/test_timezone.rb
185
+ - test/component/test_todo.rb
182
186
  - test/test_calendar.rb
183
- - test/test_conversions.rb
184
187
  - test/test_component.rb
188
+ - test/test_conversions.rb
185
189
  - test/test_helper.rb
186
- - test/component/test_todo.rb
187
- - test/component/test_timezone.rb
188
- - test/component/test_event.rb
189
190
  - test/test_parameter.rb
190
191
  - test/test_parser.rb
@@ -1,5 +0,0 @@
1
-
2
- For more information on icalendar, see http://icalendar.rubyforge.org
3
-
4
-
5
-
@@ -1,144 +0,0 @@
1
- =begin
2
- Copyright (C) 2005 Jeff Rose
3
-
4
- This library is free software; you can redistribute it and/or modify it
5
- under the same terms as the ruby language itself, see the file COPYING for
6
- details.
7
- =end
8
-
9
- require 'date'
10
-
11
- ### Add some to_ical methods to classes
12
-
13
- # class Object
14
- # def to_ical
15
- # raise(NotImplementedError, "This object does not implement the to_ical method!")
16
- # end
17
- # end
18
-
19
- module Icalendar
20
- module TzidSupport
21
- attr_accessor :icalendar_tzid
22
- end
23
- end
24
-
25
- require 'uri/generic'
26
-
27
- class String
28
- def to_ical
29
- self
30
- end
31
- end
32
-
33
- class Fixnum
34
- def to_ical
35
- "#{self}"
36
- end
37
- end
38
-
39
- class Float
40
- def to_ical
41
- "#{self}"
42
- end
43
- end
44
-
45
- # From the spec: "Values in a list of values MUST be separated by a COMMA
46
- # character (US-ASCII decimal 44)."
47
- class Array
48
- def to_ical
49
- map{|elem| elem.to_ical}.join ','
50
- end
51
- end
52
-
53
- module URI
54
- class Generic
55
- def to_ical
56
- "#{self}"
57
- end
58
- end
59
- end
60
-
61
- class DateTime < Date
62
- attr_accessor :ical_params
63
- include Icalendar::TzidSupport
64
-
65
- def to_ical
66
- s = ""
67
-
68
- # 4 digit year
69
- s << self.year.to_s
70
-
71
- # Double digit month
72
- s << "0" unless self.month > 9
73
- s << self.month.to_s
74
-
75
- # Double digit day
76
- s << "0" unless self.day > 9
77
- s << self.day.to_s
78
-
79
- s << "T"
80
-
81
- # Double digit hour
82
- s << "0" unless self.hour > 9
83
- s << self.hour.to_s
84
-
85
- # Double digit minute
86
- s << "0" unless self.min > 9
87
- s << self.min.to_s
88
-
89
- # Double digit second
90
- s << "0" unless self.sec > 9
91
- s << self.sec.to_s
92
-
93
- # UTC time gets a Z suffix
94
- if icalendar_tzid == "UTC"
95
- s << "Z"
96
- end
97
-
98
- s
99
- end
100
- end
101
-
102
- class Date
103
- attr_accessor :ical_params
104
- def to_ical(utc = false)
105
- s = ""
106
-
107
- # 4 digit year
108
- s << self.year.to_s
109
-
110
- # Double digit month
111
- s << "0" unless self.month > 9
112
- s << self.month.to_s
113
-
114
- # Double digit day
115
- s << "0" unless self.day > 9
116
- s << self.day.to_s
117
- end
118
- end
119
-
120
- class Time
121
- attr_accessor :ical_params
122
- def to_ical(utc = false)
123
- s = ""
124
-
125
- # Double digit hour
126
- s << "0" unless self.hour > 9
127
- s << self.hour.to_s
128
-
129
- # Double digit minute
130
- s << "0" unless self.min > 9
131
- s << self.min.to_s
132
-
133
- # Double digit second
134
- s << "0" unless self.sec > 9
135
- s << self.sec.to_s
136
-
137
- # UTC time gets a Z suffix
138
- if utc
139
- s << "Z"
140
- end
141
-
142
- s
143
- end
144
- end
data/test.ical DELETED
@@ -1,33 +0,0 @@
1
- BEGIN:VCALENDAR
2
- VERSION:2.0
3
- CALSCALE:GREGORIAN
4
- PRODID:iCalendar-Ruby
5
- BEGIN:VTIMEZONE
6
- TZID:America/Chicago
7
- BEGIN:DAYLIGHT
8
- TZOFFSETTO:-0500
9
- RRULE:FREQ=YEARLY\;BYMONTH=3\;BYDAY=2SU
10
- DTSTART:19700308TO20000
11
- TZOFFSETFROM:-0600
12
- TZNAME:CDT
13
- END:DAYLIGHT
14
- BEGIN:STANDARD
15
- TZOFFSETTO:-0600
16
- RRULE:YEARLY\;BYMONTH=11\;BYDAY=1SU
17
- DTSTART:19701101T020000
18
- TZOFFSETFROM:-0500
19
- TZNAME:CST
20
- END:STANDARD
21
- END:VTIMEZONE
22
- BEGIN:VEVENT
23
- SEQUENCE:0
24
- TZID:America/Chicago
25
- CLASS:PRIVATE
26
- DTEND:20081229T110000
27
- DTSTART:20081229T080000
28
- UID:2008-12-27T18:18:15-05:00_885675612@orac
29
- DTSTAMP:20081227T181815
30
- DESCRIPTION:Have a long lunch meeting and decide nothing...
31
- SUMMARY:Meeting with the man.
32
- END:VEVENT
33
- END:VCALENDAR
data/test.ics DELETED
@@ -1,33 +0,0 @@
1
- BEGIN:VCALENDAR
2
- VERSION:2.0
3
- CALSCALE:GREGORIAN
4
- PRODID:iCalendar-Ruby
5
- BEGIN:VTIMEZONE
6
- TZID:America/Chicago
7
- BEGIN:DAYLIGHT
8
- TZOFFSETTO:-0500
9
- RRULE:FREQ=YEARLY\;BYMONTH=3\;BYDAY=2SU
10
- DTSTART:19700308TO20000
11
- TZOFFSETFROM:-0600
12
- TZNAME:CDT
13
- END:DAYLIGHT
14
- BEGIN:STANDARD
15
- TZOFFSETTO:-0600
16
- RRULE:YEARLY\;BYMONTH=11\;BYDAY=1SU
17
- DTSTART:19701101T020000
18
- TZOFFSETFROM:-0500
19
- TZNAME:CST
20
- END:STANDARD
21
- END:VTIMEZONE
22
- BEGIN:VEVENT
23
- SEQUENCE:0
24
- TZID:America/Chicago
25
- CLASS:PRIVATE
26
- DTEND;TZID=America/Chicago:20081229T110000
27
- DTSTART;TZID=America/Chicago:20081229T080000
28
- UID:2008-12-27T19:01:31-05:00_71550387@orac
29
- DTSTAMP:20081227T190131
30
- DESCRIPTION:Have a long lunch meeting and decide nothing...
31
- SUMMARY:Meeting with the man.
32
- END:VEVENT
33
- END:VCALENDAR
data/test.rb DELETED
@@ -1,48 +0,0 @@
1
- #!/usr/bin/ruby
2
- require "rubygems"
3
- require "icalendar"
4
- include Icalendar
5
-
6
-
7
- # Now, you can make timezones like this
8
- cal = Calendar.new
9
- cal.timezone do
10
- timezone_id "America/Chicago"
11
- x_lic_location "America/Chicago"
12
-
13
- daylight do
14
- timezone_offset_from "-0600"
15
- timezone_offset_to "-0500"
16
- timezone_name "CDT"
17
- dtstart "19700308TO20000"
18
- add_recurrence_rule "FREQ=YEARLY;BYMONTH=3;BYDAY=2SU"
19
- end
20
-
21
- standard do
22
- timezone_offset_from "-0500"
23
- timezone_offset_to "-0600"
24
- timezone_name "CST"
25
- dtstart "19701101T020000"
26
- add_recurrence_rule "YEARLY;BYMONTH=11;BYDAY=1SU"
27
- end
28
- end
29
-
30
- e = cal.event do
31
- dtstart DateTime.new(2008, 12, 29, 8, 0, 0)
32
- dtend DateTime.new(2008, 12, 29, 11, 0, 0)
33
- summary "Meeting with the man."
34
- description "Have a long lunch meeting and decide nothing..."
35
- klass "PRIVATE"
36
- end
37
-
38
-
39
- e.dtstart = DateTime.new(2008, 12, 29, 8, 30)
40
- e.dtend = DateTime.new(2008, 12, 29, 9, 30)
41
- cal.events << e
42
-
43
-
44
- #e.dtstart.ical_params = {"TZID" => "America/Chicago"}
45
- #e.dtend.ical_params = {"TZID" => "America/Chicago"}
46
-
47
- puts cal.to_ical
48
-
data/test2.rb DELETED
@@ -1,28 +0,0 @@
1
- #!/usr/bin/ruby
2
- require "rubygems"
3
- require "icalendar"
4
- require "tzinfo"
5
- require "icalendar/tzinfo"
6
- include Icalendar
7
-
8
-
9
- # Now, you can make timezones like this
10
- tz = TZInfo::Timezone.get("America/Chicago")
11
-
12
- cal = Calendar.new
13
-
14
- cal.add(tz.ical_timezone(DateTime.now))
15
-
16
- e = cal.event do
17
- dtstart DateTime.new(2008, 12, 29, 8, 0, 0)
18
- dtend DateTime.new(2008, 12, 29, 11, 0, 0)
19
- summary "Meeting with the man."
20
- description "Have a long lunch meeting and decide nothing..."
21
- klass "PRIVATE"
22
- end
23
-
24
- #e.dtstart.ical_params = {"TZID" => "America/Chicago"}
25
- #e.dtend.ical_params = {"TZID" => "America/Chicago"}
26
-
27
- puts cal.to_ical
28
-