icalendar 1.1.6 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/COPYING +8 -4
- data/Rakefile +1 -1
- data/icalendar.gemspec +15 -49
- data/lib/icalendar/base.rb +2 -2
- data/lib/icalendar/conversions.rb +3 -51
- data/test/component/test_todo.rb +17 -17
- data/website/index.html +83 -11
- metadata +28 -32
data/.gemtest
ADDED
File without changes
|
data/COPYING
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
As of Ruby 1.9.3, the Ruby Language went from a Dual GPL/Ruby license
|
4
|
+
to Dual BSD/Ruby license. The intent of the icalendar license is that
|
5
|
+
it is provided under the same terms as Ruby itself. The way we're
|
6
|
+
going to interpret this is the software can be redistributed under any
|
7
|
+
of the 3 licenses, GPL, BSD, or the conditions below, at your option:
|
4
8
|
|
5
9
|
1. You may make and give away verbatim copies of the source form of the
|
6
10
|
software without restriction, provided that you duplicate all of the
|
@@ -44,9 +48,9 @@ You can redistribute it and/or modify it under either the terms of the GPL
|
|
44
48
|
For the list of those files and their copying conditions, see the
|
45
49
|
file LEGAL.
|
46
50
|
|
47
|
-
5. The scripts and library files supplied as input to or produced as
|
51
|
+
5. The scripts and library files supplied as input to or produced as
|
48
52
|
output from the software do not automatically fall under the
|
49
|
-
copyright of the software, but belong to whomever generated them,
|
53
|
+
copyright of the software, but belong to whomever generated them,
|
50
54
|
and may be sold commercially, and may be aggregated with this
|
51
55
|
software.
|
52
56
|
|
data/Rakefile
CHANGED
data/icalendar.gemspec
CHANGED
@@ -1,55 +1,21 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = "icalendar"
|
3
|
-
s.version = "1.
|
4
|
-
s.homepage = "http://icalendar.rubyforge.org/"
|
5
|
-
s.platform = Gem::Platform::RUBY
|
6
|
-
s.summary = "A ruby implementation of the iCalendar specification (RFC-2445)."
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "icalendar"
|
3
|
+
s.version = "1.2"
|
4
|
+
s.homepage = "http://icalendar.rubyforge.org/"
|
5
|
+
s.platform = Gem::Platform::RUBY
|
6
|
+
s.summary = "A ruby implementation of the iCalendar specification (RFC-2445)."
|
7
7
|
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
8
|
|
9
|
-
s.files
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"test/fixtures/folding.ics",
|
16
|
-
"test/fixtures/simplecal.ics",
|
17
|
-
"test/fixtures/life.ics", "test/component",
|
18
|
-
"test/component/timezone_test.rb",
|
19
|
-
"test/component/todo_test.rb",
|
20
|
-
"test/component/event_test.rb", "test/coverage",
|
21
|
-
"test/coverage/STUB", "lib/icalendar",
|
22
|
-
"lib/icalendar/parameter.rb",
|
23
|
-
"lib/icalendar/component.rb",
|
24
|
-
"lib/icalendar/base.rb", "lib/icalendar/parser.rb",
|
25
|
-
"lib/icalendar/calendar.rb",
|
26
|
-
"lib/icalendar/component",
|
27
|
-
"lib/icalendar/component/alarm.rb",
|
28
|
-
"lib/icalendar/component/todo.rb",
|
29
|
-
"lib/icalendar/component/event.rb",
|
30
|
-
"lib/icalendar/component/journal.rb",
|
31
|
-
"lib/icalendar/component/timezone.rb",
|
32
|
-
"lib/icalendar/component/freebusy.rb",
|
33
|
-
"lib/icalendar/conversions.rb",
|
34
|
-
"lib/icalendar/rrule.rb",
|
35
|
-
"lib/icalendar/tzinfo.rb",
|
36
|
-
"lib/icalendar/helpers.rb", "lib/meta.rb",
|
37
|
-
"lib/icalendar.rb", "lib/hash_attrs.rb", "docs/rfcs",
|
38
|
-
"docs/rfcs/rfc2446.pdf", "docs/rfcs/rfc2426.pdf",
|
39
|
-
"docs/rfcs/itip_notes.txt", "docs/rfcs/rfc2447.pdf",
|
40
|
-
"docs/rfcs/rfc2425.pdf", "docs/rfcs/rfc2445.pdf",
|
41
|
-
"docs/rfcs/rfc3283.txt", "docs/api", "docs/api/STUB",
|
42
|
-
"examples/single_event.ics", "examples/parse_cal.rb",
|
43
|
-
"examples/create_cal.rb"]
|
44
|
-
|
45
|
-
s.files += ["Rakefile", "README", "COPYING", "GPL" ]
|
46
|
-
s.require_path = "lib"
|
47
|
-
s.autorequire = "icalendar"
|
48
|
-
s.has_rdoc = true
|
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
|
49
15
|
s.extra_rdoc_files = ["README", "COPYING", "GPL"]
|
50
16
|
s.rdoc_options.concat ['--main', 'README']
|
51
17
|
|
52
|
-
s.author = "Sean Dague"
|
53
|
-
s.email = "sean@dague.net"
|
54
|
-
end
|
18
|
+
s.author = "Sean Dague"
|
19
|
+
s.email = "sean@dague.net"
|
20
|
+
end
|
55
21
|
|
data/lib/icalendar/base.rb
CHANGED
@@ -10,8 +10,8 @@ require 'logger'
|
|
10
10
|
|
11
11
|
module Icalendar #:nodoc:
|
12
12
|
|
13
|
-
VERSION = '1.
|
14
|
-
|
13
|
+
VERSION = '1.2'
|
14
|
+
|
15
15
|
# A simple error class to differentiate iCalendar library exceptions
|
16
16
|
# from ruby language exceptions or others.
|
17
17
|
class IcalendarError < StandardError #:nodoc:
|
@@ -69,32 +69,7 @@ class DateTime < Date
|
|
69
69
|
include Icalendar::TzidSupport
|
70
70
|
|
71
71
|
def to_ical
|
72
|
-
s =
|
73
|
-
|
74
|
-
# 4 digit year
|
75
|
-
s << self.year.to_s
|
76
|
-
|
77
|
-
# Double digit month
|
78
|
-
s << "0" unless self.month > 9
|
79
|
-
s << self.month.to_s
|
80
|
-
|
81
|
-
# Double digit day
|
82
|
-
s << "0" unless self.day > 9
|
83
|
-
s << self.day.to_s
|
84
|
-
|
85
|
-
s << "T"
|
86
|
-
|
87
|
-
# Double digit hour
|
88
|
-
s << "0" unless self.hour > 9
|
89
|
-
s << self.hour.to_s
|
90
|
-
|
91
|
-
# Double digit minute
|
92
|
-
s << "0" unless self.min > 9
|
93
|
-
s << self.min.to_s
|
94
|
-
|
95
|
-
# Double digit second
|
96
|
-
s << "0" unless self.sec > 9
|
97
|
-
s << self.sec.to_s
|
72
|
+
s = strftime '%Y%m%dT%H%M%S'
|
98
73
|
|
99
74
|
# UTC time gets a Z suffix
|
100
75
|
if icalendar_tzid == "UTC"
|
@@ -108,37 +83,14 @@ end
|
|
108
83
|
class Date
|
109
84
|
attr_accessor :ical_params
|
110
85
|
def to_ical(utc = false)
|
111
|
-
|
112
|
-
|
113
|
-
# 4 digit year
|
114
|
-
s << self.year.to_s
|
115
|
-
|
116
|
-
# Double digit month
|
117
|
-
s << "0" unless self.month > 9
|
118
|
-
s << self.month.to_s
|
119
|
-
|
120
|
-
# Double digit day
|
121
|
-
s << "0" unless self.day > 9
|
122
|
-
s << self.day.to_s
|
86
|
+
strftime '%Y%m%d'
|
123
87
|
end
|
124
88
|
end
|
125
89
|
|
126
90
|
class Time
|
127
91
|
attr_accessor :ical_params
|
128
92
|
def to_ical(utc = false)
|
129
|
-
s =
|
130
|
-
|
131
|
-
# Double digit hour
|
132
|
-
s << "0" unless self.hour > 9
|
133
|
-
s << self.hour.to_s
|
134
|
-
|
135
|
-
# Double digit minute
|
136
|
-
s << "0" unless self.min > 9
|
137
|
-
s << self.min.to_s
|
138
|
-
|
139
|
-
# Double digit second
|
140
|
-
s << "0" unless self.sec > 9
|
141
|
-
s << self.sec.to_s
|
93
|
+
s = strftime '%H%M%S'
|
142
94
|
|
143
95
|
# UTC time gets a Z suffix
|
144
96
|
if utc
|
data/test/component/test_todo.rb
CHANGED
@@ -3,29 +3,29 @@ require File.dirname(__FILE__) + '/../test_helper.rb'
|
|
3
3
|
require 'date'
|
4
4
|
|
5
5
|
class TestTodo < Test::Unit::TestCase
|
6
|
-
|
6
|
+
include Icalendar
|
7
7
|
|
8
|
-
|
8
|
+
def test_todo_fields
|
9
9
|
|
10
|
-
|
10
|
+
cal = Calendar.new
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
t = cal.todo do
|
13
|
+
summary "Plan next vacations"
|
14
|
+
description "Let's have a break"
|
15
|
+
percent 50
|
16
|
+
seq 1
|
17
|
+
add_category "TRAVEL"
|
18
|
+
add_category "SPORTS"
|
19
|
+
end
|
20
20
|
|
21
|
-
|
21
|
+
calString = cal.to_ical
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
assert_match(/PERCENT-COMPLETE:50/, calString)
|
24
|
+
assert_match(/DESCRIPTION:Let's have a break/, calString)
|
25
|
+
assert_match(/CATEGORIES:TRAVEL,SPORTS/, calString)
|
26
|
+
assert_match(/SEQUENCE:1/, calString)
|
27
27
|
|
28
|
-
|
28
|
+
end
|
29
29
|
end
|
30
30
|
|
31
31
|
|
data/website/index.html
CHANGED
@@ -1,11 +1,83 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<title>
|
8
|
+
icalendar
|
9
|
+
</title>
|
10
|
+
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
+
<style>
|
12
|
+
|
13
|
+
</style>
|
14
|
+
<script type="text/javascript">
|
15
|
+
window.onload = function() {
|
16
|
+
settings = {
|
17
|
+
tl: { radius: 10 },
|
18
|
+
tr: { radius: 10 },
|
19
|
+
bl: { radius: 10 },
|
20
|
+
br: { radius: 10 },
|
21
|
+
antiAlias: true,
|
22
|
+
autoPad: true,
|
23
|
+
validTags: ["div"]
|
24
|
+
}
|
25
|
+
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
+
versionBox.applyCornersToAll();
|
27
|
+
}
|
28
|
+
</script>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="main">
|
32
|
+
|
33
|
+
<h1>icalendar</h1>
|
34
|
+
<div class="sidebar">
|
35
|
+
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/icalendar"; return false'>
|
36
|
+
<p>Get Version</p>
|
37
|
+
<a href="http://rubyforge.org/projects/icalendar" class="numbers">1.1.6</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<h2>What</h2>
|
41
|
+
<h2>Installing</h2>
|
42
|
+
<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> – create Google Group – icalendar</p>
|
48
|
+
<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’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> – 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>
|
54
|
+
<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>
|
60
|
+
</ul>
|
61
|
+
<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
|
+
<h3>Build and test instructions</h3>
|
67
|
+
<pre>cd icalendar
|
68
|
+
rake test
|
69
|
+
rake install_gem</pre>
|
70
|
+
<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>
|
74
|
+
<p class="coda">
|
75
|
+
<a href="FIXME email">FIXME full name</a>, 10th March 2010<br>
|
76
|
+
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
77
|
+
</p>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<!-- insert site tracking codes here, like Google Urchin -->
|
81
|
+
|
82
|
+
</body>
|
83
|
+
</html>
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icalendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 11
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 1.1.6
|
8
|
+
- 2
|
9
|
+
version: "1.2"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Sean Dague
|
@@ -15,39 +14,37 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
17
|
+
date: 2012-08-31 00:00:00 Z
|
20
18
|
dependencies:
|
21
19
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
20
|
+
name: rdoc
|
23
21
|
prerelease: false
|
24
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
23
|
none: false
|
26
24
|
requirements:
|
27
|
-
- -
|
25
|
+
- - ~>
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
27
|
+
hash: 19
|
30
28
|
segments:
|
31
|
-
- 2
|
32
|
-
- 0
|
33
29
|
- 3
|
34
|
-
|
30
|
+
- 10
|
31
|
+
version: "3.10"
|
35
32
|
type: :development
|
36
33
|
version_requirements: *id001
|
37
34
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
35
|
+
name: newgem
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
38
|
none: false
|
42
39
|
requirements:
|
43
40
|
- - ">="
|
44
41
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
42
|
+
hash: 5
|
46
43
|
segments:
|
47
|
-
-
|
44
|
+
- 1
|
45
|
+
- 5
|
48
46
|
- 3
|
49
|
-
|
50
|
-
version: 0.3.0
|
47
|
+
version: 1.5.3
|
51
48
|
type: :development
|
52
49
|
version_requirements: *id002
|
53
50
|
- !ruby/object:Gem::Dependency
|
@@ -56,14 +53,13 @@ dependencies:
|
|
56
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
54
|
none: false
|
58
55
|
requirements:
|
59
|
-
- -
|
56
|
+
- - ~>
|
60
57
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
58
|
+
hash: 7
|
62
59
|
segments:
|
63
|
-
-
|
64
|
-
- 5
|
60
|
+
- 3
|
65
61
|
- 0
|
66
|
-
version:
|
62
|
+
version: "3.0"
|
67
63
|
type: :development
|
68
64
|
version_requirements: *id003
|
69
65
|
description: |-
|
@@ -104,8 +100,8 @@ extra_rdoc_files:
|
|
104
100
|
- History.txt
|
105
101
|
- Manifest.txt
|
106
102
|
- PostInstall.txt
|
107
|
-
- website/index.txt
|
108
103
|
- README.rdoc
|
104
|
+
- website/index.txt
|
109
105
|
files:
|
110
106
|
- COPYING
|
111
107
|
- GPL
|
@@ -168,7 +164,7 @@ files:
|
|
168
164
|
- website/javascripts/rounded_corners_lite.inc.js
|
169
165
|
- website/stylesheets/screen.css
|
170
166
|
- website/template.html.erb
|
171
|
-
|
167
|
+
- .gemtest
|
172
168
|
homepage: http://github.com/sdague/icalendar
|
173
169
|
licenses: []
|
174
170
|
|
@@ -199,17 +195,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
195
|
requirements: []
|
200
196
|
|
201
197
|
rubyforge_project: icalendar
|
202
|
-
rubygems_version: 1.
|
198
|
+
rubygems_version: 1.8.15
|
203
199
|
signing_key:
|
204
200
|
specification_version: 3
|
205
201
|
summary: This is a Ruby library for dealing with iCalendar files
|
206
202
|
test_files:
|
207
|
-
- test/
|
208
|
-
- test/test_conversions.rb
|
209
|
-
- test/test_parser.rb
|
210
|
-
- test/component/test_todo.rb
|
203
|
+
- test/test_component.rb
|
211
204
|
- test/component/test_timezone.rb
|
205
|
+
- test/component/test_todo.rb
|
212
206
|
- test/component/test_event.rb
|
213
|
-
- test/test_helper.rb
|
214
207
|
- test/test_calendar.rb
|
215
|
-
- test/
|
208
|
+
- test/test_helper.rb
|
209
|
+
- test/test_conversions.rb
|
210
|
+
- test/test_parser.rb
|
211
|
+
- test/test_parameter.rb
|