icalendar 0.96.2 → 0.96.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake'
3
3
  require 'rake/testtask'
4
4
  require 'rake/rdoctask'
5
5
 
6
- PKG_VERSION = "0.96.2"
6
+ PKG_VERSION = "0.96.3"
7
7
 
8
8
  $VERBOSE = nil
9
9
  TEST_CHANGES_SINCE = Time.now - 600 # Recent tests = changed in last 10 minutes
@@ -115,7 +115,7 @@ A module which adds some generators for hash based accessors.
115
115
 
116
116
  <div class="method-heading">
117
117
  <a href="#M000053" class="method-signature">
118
- <span class="method-name">hash_accessor</span><span class="method-args">(hash, syms)</span>
118
+ <span class="method-name">hash_accessor</span><span class="method-args">(hash, *syms)</span>
119
119
  </a>
120
120
  </div>
121
121
 
@@ -124,11 +124,11 @@ A module which adds some generators for hash based accessors.
124
124
  onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
125
125
  <div class="method-source-code" id="M000053-source">
126
126
  <pre>
127
- <span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 26</span>
128
- 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_accessor</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
129
- 27: <span class="ruby-identifier">hash_reader</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
130
- 28: <span class="ruby-identifier">hash_writer</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
131
- 29: <span class="ruby-keyword kw">end</span>
127
+ <span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 29</span>
128
+ 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_accessor</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>)
129
+ 30: <span class="ruby-identifier">hash_reader</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
130
+ 31: <span class="ruby-identifier">hash_writer</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
131
+ 32: <span class="ruby-keyword kw">end</span>
132
132
  </pre>
133
133
  </div>
134
134
  </div>
@@ -139,7 +139,7 @@ A module which adds some generators for hash based accessors.
139
139
 
140
140
  <div class="method-heading">
141
141
  <a href="#M000051" class="method-signature">
142
- <span class="method-name">hash_reader</span><span class="method-args">(hash, syms)</span>
142
+ <span class="method-name">hash_reader</span><span class="method-args">(hash_sym, syms)</span>
143
143
  </a>
144
144
  </div>
145
145
 
@@ -148,12 +148,18 @@ A module which adds some generators for hash based accessors.
148
148
  onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
149
149
  <div class="method-source-code" id="M000051-source">
150
150
  <pre>
151
- <span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 4</span>
152
- 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_reader</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
153
- 5: <span class="ruby-identifier">syms</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span>
154
- 6: <span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def \#{id.to_s.downcase}\nreturn @\#{hash.to_s}[:\#{id.to_s.downcase}]\nend\n&quot;</span>
155
- 7: <span class="ruby-keyword kw">end</span>
156
- 8: <span class="ruby-keyword kw">end</span>
151
+ <span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 4</span>
152
+ 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_reader</span>(<span class="ruby-identifier">hash_sym</span>, <span class="ruby-identifier">syms</span>)
153
+ 5: <span class="ruby-identifier">syms</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span>
154
+ 6: <span class="ruby-identifier">id</span> = <span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
155
+ 7: <span class="ruby-identifier">func</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
156
+ 8: <span class="ruby-identifier">hash</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">hash_sym</span>)
157
+ 9: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_sym</span>]
158
+ 10: <span class="ruby-keyword kw">end</span>
159
+ 11:
160
+ 12: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:define_method</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">func</span>)
161
+ 13: <span class="ruby-keyword kw">end</span>
162
+ 14: <span class="ruby-keyword kw">end</span>
157
163
  </pre>
158
164
  </div>
159
165
  </div>
@@ -164,7 +170,7 @@ A module which adds some generators for hash based accessors.
164
170
 
165
171
  <div class="method-heading">
166
172
  <a href="#M000052" class="method-signature">
167
- <span class="method-name">hash_writer</span><span class="method-args">(hash, syms)</span>
173
+ <span class="method-name">hash_writer</span><span class="method-args">(hash_sym, syms)</span>
168
174
  </a>
169
175
  </div>
170
176
 
@@ -173,12 +179,19 @@ A module which adds some generators for hash based accessors.
173
179
  onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
174
180
  <div class="method-source-code" id="M000052-source">
175
181
  <pre>
176
- <span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 15</span>
177
- 15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_writer</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-identifier">syms</span>)
178
- 16: <span class="ruby-identifier">syms</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span>
179
- 17: <span class="ruby-identifier">class_eval</span> <span class="ruby-value str">&quot;def \#{id.to_s.downcase}=(val)\nreturn @\#{hash.to_s}[:\#{id.to_s.downcase}] = val\nend\n&quot;</span>
180
- 18: <span class="ruby-keyword kw">end</span>
181
- 19: <span class="ruby-keyword kw">end</span>
182
+ <span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 16</span>
183
+ 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_writer</span>(<span class="ruby-identifier">hash_sym</span>, <span class="ruby-identifier">syms</span>)
184
+ 17: <span class="ruby-identifier">syms</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span>
185
+ 18: <span class="ruby-identifier">id</span> = <span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
186
+ 19:
187
+ 20: <span class="ruby-identifier">func</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
188
+ 21: <span class="ruby-identifier">hash</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">hash_sym</span>)
189
+ 22: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">val</span>
190
+ 23: <span class="ruby-keyword kw">end</span>
191
+ 24:
192
+ 25: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:define_method</span>, <span class="ruby-identifier">id</span><span class="ruby-operator">+</span><span class="ruby-value str">'='</span>, <span class="ruby-identifier">func</span>)
193
+ 26: <span class="ruby-keyword kw">end</span>
194
+ 27: <span class="ruby-keyword kw">end</span>
182
195
  </pre>
183
196
  </div>
184
197
  </div>
@@ -209,7 +209,7 @@ Make it protected so we can monitor usage&#8230;
209
209
  <pre>
210
210
  <span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 129</span>
211
211
  129: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_component</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>)
212
- 130: <span class="ruby-identifier">hash_accessor</span> <span class="ruby-identifier">:components</span>, <span class="ruby-identifier">syms</span>
212
+ 130: <span class="ruby-identifier">hash_accessor</span> <span class="ruby-identifier">:@components</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>
213
213
  131: <span class="ruby-keyword kw">end</span>
214
214
  </pre>
215
215
  </div>
@@ -348,15 +348,7 @@ Access classification (PUBLIC, PRIVATE, CONFIDENTIAL&#8230;)
348
348
  </td>
349
349
  </tr>
350
350
  <tr class="top-aligned-row context-row">
351
- <td class="context-item-name">last_mod</td>
352
- <td class="context-item-value">&nbsp;&nbsp;</td>
353
- <td class="context-item-desc">
354
- <a href="../Date.html">Date</a> &amp; time this item was last modified
355
-
356
- </td>
357
- </tr>
358
- <tr class="top-aligned-row context-row">
359
- <td class="context-item-name">last_modification</td>
351
+ <td class="context-item-name">last_modified</td>
360
352
  <td class="context-item-value">&nbsp;&nbsp;</td>
361
353
  <td class="context-item-desc">
362
354
  <a href="../Date.html">Date</a> &amp; time this item was last modified
@@ -267,12 +267,7 @@ Single properties
267
267
  </td>
268
268
  </tr>
269
269
  <tr class="top-aligned-row context-row">
270
- <td class="context-item-name">last_mod</td>
271
- <td class="context-item-value">&nbsp;&nbsp;</td>
272
- <td class="context-item-desc"></td>
273
- </tr>
274
- <tr class="top-aligned-row context-row">
275
- <td class="context-item-name">last_modification</td>
270
+ <td class="context-item-name">last_modified</td>
276
271
  <td class="context-item-value">&nbsp;&nbsp;</td>
277
272
  <td class="context-item-desc"></td>
278
273
  </tr>
@@ -289,12 +289,7 @@ Single properties
289
289
  </td>
290
290
  </tr>
291
291
  <tr class="top-aligned-row context-row">
292
- <td class="context-item-name">last_mod</td>
293
- <td class="context-item-value">&nbsp;&nbsp;</td>
294
- <td class="context-item-desc"></td>
295
- </tr>
296
- <tr class="top-aligned-row context-row">
297
- <td class="context-item-name">last_modification</td>
292
+ <td class="context-item-name">last_modified</td>
298
293
  <td class="context-item-value">&nbsp;&nbsp;</td>
299
294
  <td class="context-item-desc"></td>
300
295
  </tr>
@@ -1 +1 @@
1
- Mon Oct 31 00:26:04 CET 2005
1
+ Tue Nov 29 16:10:39 CET 2005
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Oct 20 00:15:23 CEST 2005</td>
59
+ <td>Mon Oct 31 16:38:25 CET 2005</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Oct 30 23:41:02 CET 2005</td>
59
+ <td>Tue Nov 29 16:07:05 CET 2005</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Oct 30 23:41:42 CET 2005</td>
59
+ <td>Tue Nov 29 16:07:39 CET 2005</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Oct 30 23:42:22 CET 2005</td>
59
+ <td>Tue Nov 29 16:08:11 CET 2005</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Oct 31 00:04:27 CET 2005</td>
59
+ <td>Mon Oct 31 16:38:43 CET 2005</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -1,27 +1,32 @@
1
1
  # A module which adds some generators for hash based accessors.
2
2
  module HashAttrs
3
3
 
4
- def hash_reader(hash, syms)
4
+ def hash_reader(hash_sym, syms)
5
5
  syms.each do |id|
6
- class_eval <<-"stop"
7
- def #{id.to_s.downcase}
8
- return @#{hash.to_s}[:#{id.to_s.downcase}]
9
- end
10
- stop
6
+ id = id.to_s.downcase
7
+ func = Proc.new do
8
+ hash = instance_variable_get(hash_sym)
9
+ hash[id.to_sym]
10
+ end
11
+
12
+ self.send(:define_method, id, func)
11
13
  end
12
14
  end
13
15
 
14
- def hash_writer(hash, syms)
16
+ def hash_writer(hash_sym, syms)
15
17
  syms.each do |id|
16
- class_eval <<-"stop"
17
- def #{id.to_s.downcase}=(val)
18
- return @#{hash.to_s}[:#{id.to_s.downcase}] = val
19
- end
20
- stop
18
+ id = id.to_s.downcase
19
+
20
+ func = Proc.new do |val|
21
+ hash = instance_variable_get(hash_sym)
22
+ hash[id.to_sym] = val
23
+ end
24
+
25
+ self.send(:define_method, id+'=', func)
21
26
  end
22
27
  end
23
28
 
24
- def hash_accessor(hash, syms)
29
+ def hash_accessor(hash, *syms)
25
30
  hash_reader(hash, syms)
26
31
  hash_writer(hash, syms)
27
32
  end
@@ -127,7 +127,7 @@ module Icalendar
127
127
  protected
128
128
 
129
129
  def Component.ical_component(*syms)
130
- hash_accessor :components, syms
130
+ hash_accessor :@components, *syms
131
131
  end
132
132
 
133
133
  # Define a set of methods supporting a new property
@@ -34,7 +34,7 @@ module Icalendar
34
34
  ical_property :geo
35
35
 
36
36
  # Date & time this item was last modified
37
- ical_property :last_mod, :last_modification
37
+ ical_property :last_modified
38
38
 
39
39
  # Specifies the intended venue for this activity
40
40
  ical_property :location
@@ -24,7 +24,7 @@ module Icalendar
24
24
  ical_property :created
25
25
  ical_property :description
26
26
  ical_property :dtstart, :start
27
- ical_property :last_mod, :last_modification
27
+ ical_property :last_modified
28
28
  ical_property :organizer
29
29
  ical_property :dtstamp, :timestamp
30
30
  ical_property :seq, :sequence
@@ -22,7 +22,7 @@ module Icalendar
22
22
  ical_property :dtstamp, :timestamp
23
23
  ical_property :dtstart, :start
24
24
  ical_property :geo
25
- ical_property :last_mod, :last_modification
25
+ ical_property :last_modified
26
26
  ical_property :location
27
27
  ical_property :organizer
28
28
  ical_property :percent
@@ -39,6 +39,7 @@ class TestCalendar < Test::Unit::TestCase
39
39
  event.dtend = "19970903T190000Z"
40
40
  event.summary = "This is my summary"
41
41
 
42
+ # breakpoint
42
43
  ev = cal.events.each do |ev|
43
44
  assert_equal("19970903T190000Z", ev.dtend)
44
45
  end
@@ -27,6 +27,7 @@ UID:bsuidfortestabc123
27
27
  ORGANIZER:mailto:joebob@random.net
28
28
  ATTACH:http://bush.sucks.org/impeach/him.rhtml
29
29
  ATTACH:http://corporations-dominate.existence.net/why.rhtml
30
+ LAST-MODIFIED:20050825T194346Z
30
31
  SUMMARY:This is a really long summary
31
32
  to test the method of unfolding lines
32
33
  so I'm just going to ma
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: icalendar
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.96.2
7
- date: 2005-10-31 00:00:00 +01:00
6
+ version: 0.96.3
7
+ date: 2005-11-29 00:00:00 +01:00
8
8
  summary: A ruby implementation of the iCalendar specification (RFC-2445).
9
9
  require_paths:
10
10
  - lib