rubyredrick-ri_cal 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. data/History.txt +3 -0
  2. data/Manifest.txt +122 -0
  3. data/README.txt +271 -0
  4. data/Rakefile +31 -0
  5. data/bin/ri_cal +8 -0
  6. data/component_attributes/alarm.yml +10 -0
  7. data/component_attributes/calendar.yml +4 -0
  8. data/component_attributes/component_property_defs.yml +180 -0
  9. data/component_attributes/event.yml +45 -0
  10. data/component_attributes/freebusy.yml +16 -0
  11. data/component_attributes/journal.yml +35 -0
  12. data/component_attributes/timezone.yml +3 -0
  13. data/component_attributes/timezone_period.yml +11 -0
  14. data/component_attributes/todo.yml +46 -0
  15. data/copyrights.txt +2 -0
  16. data/docs/draft-ietf-calsify-2446bis-08.txt +7280 -0
  17. data/docs/draft-ietf-calsify-rfc2445bis-09.txt +10416 -0
  18. data/docs/incrementers.txt +7 -0
  19. data/docs/rfc2445.pdf +0 -0
  20. data/lib/ri_cal/component/alarm.rb +22 -0
  21. data/lib/ri_cal/component/calendar.rb +199 -0
  22. data/lib/ri_cal/component/event.rb +30 -0
  23. data/lib/ri_cal/component/freebusy.rb +19 -0
  24. data/lib/ri_cal/component/journal.rb +22 -0
  25. data/lib/ri_cal/component/t_z_info_timezone.rb +124 -0
  26. data/lib/ri_cal/component/timezone/daylight_period.rb +26 -0
  27. data/lib/ri_cal/component/timezone/standard_period.rb +24 -0
  28. data/lib/ri_cal/component/timezone/timezone_period.rb +54 -0
  29. data/lib/ri_cal/component/timezone.rb +193 -0
  30. data/lib/ri_cal/component/todo.rb +26 -0
  31. data/lib/ri_cal/component.rb +224 -0
  32. data/lib/ri_cal/core_extensions/array/conversions.rb +15 -0
  33. data/lib/ri_cal/core_extensions/array.rb +7 -0
  34. data/lib/ri_cal/core_extensions/date/conversions.rb +27 -0
  35. data/lib/ri_cal/core_extensions/date.rb +13 -0
  36. data/lib/ri_cal/core_extensions/date_time/conversions.rb +27 -0
  37. data/lib/ri_cal/core_extensions/date_time.rb +13 -0
  38. data/lib/ri_cal/core_extensions/object/conversions.rb +20 -0
  39. data/lib/ri_cal/core_extensions/object.rb +8 -0
  40. data/lib/ri_cal/core_extensions/string/conversions.rb +32 -0
  41. data/lib/ri_cal/core_extensions/string.rb +8 -0
  42. data/lib/ri_cal/core_extensions/time/calculations.rb +153 -0
  43. data/lib/ri_cal/core_extensions/time/conversions.rb +27 -0
  44. data/lib/ri_cal/core_extensions/time/week_day_predicates.rb +88 -0
  45. data/lib/ri_cal/core_extensions/time.rb +11 -0
  46. data/lib/ri_cal/core_extensions.rb +6 -0
  47. data/lib/ri_cal/invalid_timezone_identifer.rb +20 -0
  48. data/lib/ri_cal/occurrence_enumerator.rb +172 -0
  49. data/lib/ri_cal/parser.rb +138 -0
  50. data/lib/ri_cal/properties/alarm.rb +390 -0
  51. data/lib/ri_cal/properties/calendar.rb +164 -0
  52. data/lib/ri_cal/properties/event.rb +1526 -0
  53. data/lib/ri_cal/properties/freebusy.rb +594 -0
  54. data/lib/ri_cal/properties/journal.rb +1240 -0
  55. data/lib/ri_cal/properties/timezone.rb +151 -0
  56. data/lib/ri_cal/properties/timezone_period.rb +416 -0
  57. data/lib/ri_cal/properties/todo.rb +1562 -0
  58. data/lib/ri_cal/property_value/array.rb +19 -0
  59. data/lib/ri_cal/property_value/cal_address.rb +12 -0
  60. data/lib/ri_cal/property_value/date.rb +119 -0
  61. data/lib/ri_cal/property_value/date_time/additive_methods.rb +43 -0
  62. data/lib/ri_cal/property_value/date_time/time_machine.rb +180 -0
  63. data/lib/ri_cal/property_value/date_time/timezone_support.rb +65 -0
  64. data/lib/ri_cal/property_value/date_time.rb +324 -0
  65. data/lib/ri_cal/property_value/duration.rb +106 -0
  66. data/lib/ri_cal/property_value/geo.rb +12 -0
  67. data/lib/ri_cal/property_value/integer.rb +13 -0
  68. data/lib/ri_cal/property_value/occurrence_list.rb +82 -0
  69. data/lib/ri_cal/property_value/period.rb +63 -0
  70. data/lib/ri_cal/property_value/recurrence_rule/enumeration_support_methods.rb +98 -0
  71. data/lib/ri_cal/property_value/recurrence_rule/enumerator.rb +77 -0
  72. data/lib/ri_cal/property_value/recurrence_rule/initialization_methods.rb +149 -0
  73. data/lib/ri_cal/property_value/recurrence_rule/negative_setpos_enumerator.rb +54 -0
  74. data/lib/ri_cal/property_value/recurrence_rule/numbered_span.rb +32 -0
  75. data/lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb +794 -0
  76. data/lib/ri_cal/property_value/recurrence_rule/recurring_day.rb +132 -0
  77. data/lib/ri_cal/property_value/recurrence_rule/recurring_month_day.rb +61 -0
  78. data/lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb +34 -0
  79. data/lib/ri_cal/property_value/recurrence_rule/recurring_year_day.rb +50 -0
  80. data/lib/ri_cal/property_value/recurrence_rule/validations.rb +126 -0
  81. data/lib/ri_cal/property_value/recurrence_rule.rb +146 -0
  82. data/lib/ri_cal/property_value/text.rb +41 -0
  83. data/lib/ri_cal/property_value/uri.rb +12 -0
  84. data/lib/ri_cal/property_value/utc_offset.rb +34 -0
  85. data/lib/ri_cal/property_value.rb +110 -0
  86. data/lib/ri_cal/required_timezones.rb +56 -0
  87. data/lib/ri_cal/time_with_floating_timezone.rb +59 -0
  88. data/lib/ri_cal.rb +134 -0
  89. data/ri_cal.gemspec +47 -0
  90. data/sample_ical_files/from_ical_dot_app/test1.ics +38 -0
  91. data/script/console +10 -0
  92. data/script/destroy +14 -0
  93. data/script/generate +14 -0
  94. data/script/txt2html +71 -0
  95. data/spec/ri_cal/component/alarm_spec.rb +13 -0
  96. data/spec/ri_cal/component/calendar_spec.rb +55 -0
  97. data/spec/ri_cal/component/event_spec.rb +157 -0
  98. data/spec/ri_cal/component/freebusy_spec.rb +13 -0
  99. data/spec/ri_cal/component/journal_spec.rb +13 -0
  100. data/spec/ri_cal/component/t_z_info_timezone_spec.rb +37 -0
  101. data/spec/ri_cal/component/timezone_spec.rb +155 -0
  102. data/spec/ri_cal/component/todo_spec.rb +61 -0
  103. data/spec/ri_cal/component_spec.rb +212 -0
  104. data/spec/ri_cal/core_extensions/time/calculations_spec.rb +189 -0
  105. data/spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb +46 -0
  106. data/spec/ri_cal/occurrence_enumerator_spec.rb +218 -0
  107. data/spec/ri_cal/parser_spec.rb +304 -0
  108. data/spec/ri_cal/property_value/date_spec.rb +22 -0
  109. data/spec/ri_cal/property_value/date_time_spec.rb +448 -0
  110. data/spec/ri_cal/property_value/duration_spec.rb +80 -0
  111. data/spec/ri_cal/property_value/period_spec.rb +50 -0
  112. data/spec/ri_cal/property_value/recurrence_rule/recurring_year_day_spec.rb +22 -0
  113. data/spec/ri_cal/property_value/recurrence_rule_spec.rb +1815 -0
  114. data/spec/ri_cal/property_value/text_spec.rb +14 -0
  115. data/spec/ri_cal/property_value/utc_offset_spec.rb +49 -0
  116. data/spec/ri_cal/property_value_spec.rb +111 -0
  117. data/spec/ri_cal/required_timezones_spec.rb +68 -0
  118. data/spec/ri_cal_spec.rb +54 -0
  119. data/spec/spec.opts +4 -0
  120. data/spec/spec_helper.rb +24 -0
  121. data/tasks/ri_cal.rake +403 -0
  122. data/tasks/spec.rake +35 -0
  123. metadata +201 -0
data/tasks/ri_cal.rake ADDED
@@ -0,0 +1,403 @@
1
+ #require 'active_support'
2
+ require 'yaml'
3
+ #- ©2009 Rick DeNatale
4
+ #- All rights reserved. Refer to the file README.txt for the license
5
+ #
6
+ # code stolen from ActiveSupport Gem
7
+ unless String.instance_methods.include?("camelize")
8
+ def camelize
9
+ self.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
10
+ end
11
+ end
12
+
13
+ class VEntityUpdater
14
+ Pluralization = {
15
+ "attach" => "attachments",
16
+ "categories" => "multiple_categories",
17
+ "free_busy" => "free_busies",
18
+ "security_class" => "security_classes",
19
+ "request_status" => "request_statuses",
20
+ "related_to" => "multiple_related_to",
21
+ "resources" => "multiple_resources"
22
+ }
23
+ def initialize(target, defs_file)
24
+ @target = target
25
+ @name=File.basename(target).sub(".rb","")
26
+ @indent = ""
27
+ @property_map = {}
28
+ @property_defs = YAML.load_file(defs_file)
29
+ @all_props = {}
30
+ @date_time_props = []
31
+ end
32
+
33
+ def property(prop_name_or_hash)
34
+ if Hash === prop_name_or_hash
35
+ name = prop_name_or_hash.keys[0]
36
+ override_options = prop_name_or_hash[name] || {}
37
+ else
38
+ name = prop_name_or_hash
39
+ override_options = {}
40
+ end
41
+ standard_options = @property_defs[name]
42
+ unless standard_options
43
+ puts "**** WARNING, no definition found for property #{name}"
44
+ standard_options = {}
45
+ end
46
+ options = {'type' => 'Text', 'ruby_name' => name}.merge(standard_options).merge(override_options)
47
+ named_property(name, options)
48
+ end
49
+
50
+ def indent(string)
51
+ @outfile.puts("#{@indent}#{string}")
52
+ end
53
+
54
+ def comment(*strings)
55
+ strings.each do |string|
56
+ indent("\# #{string}")
57
+ end
58
+ end
59
+
60
+ def no_doc(string)
61
+ indent("#{string} \# :nodoc:")
62
+ end
63
+
64
+ def blank_line
65
+ @outfile.puts
66
+ end
67
+
68
+ def describe_type(type)
69
+ case type
70
+ when 'date_time_or_date'
71
+ "either DateTime or Date"
72
+ when 'Text'
73
+ 'String'
74
+ else
75
+ type
76
+ end
77
+ end
78
+
79
+ def describe_property(type)
80
+ case type
81
+ when 'date_time_or_date'
82
+ "either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date"
83
+ else
84
+ "RiCal::PropertyValue#{type}"
85
+ end
86
+ end
87
+
88
+ def type_class(type)
89
+ if type == 'date_time_or_date'
90
+ "RiCal::PropertyValue::DateTime"
91
+ else
92
+ "RiCal::PropertyValue::#{type}"
93
+ end
94
+ end
95
+
96
+ def cast_value(ruby_val, type)
97
+ "#{type_class(type)}.convert(self, #{ruby_val.inspect})"
98
+ end
99
+
100
+ def lazy_init_var(var, options)
101
+ const_val = options["constant_value"]
102
+ default_val = options["default_value"]
103
+ if options["multi"]
104
+ puts("*** Warning default_value of #{default_val} for multi-value property #{name} ignored") if default_val
105
+ puts("*** Warning const_value of #{const_val} for multi-value property #{name} ignored") if const_val
106
+ if var
107
+ "@#{var} ||= []"
108
+ else
109
+ "[]"
110
+ end
111
+ else
112
+ puts("*** Warning default_value of #{default_val} for property #{name} with constant_value of #{const_val}") if const_val && default_val
113
+ init_val = const_val || default_val
114
+ if init_val
115
+ if var
116
+ "@#{var} ||= #{cast_value(init_val, options["type"])}"
117
+ else
118
+ init_val.inspect
119
+ end
120
+ else
121
+ "@#{var}"
122
+ end
123
+ end
124
+ end
125
+
126
+ def pluralize(name)
127
+ Pluralization[name] || "#{name}s"
128
+ end
129
+
130
+ def named_property(name, options)
131
+ ruby_name = options['ruby_name']
132
+ multi = options['multi']
133
+ type = options['type']
134
+ rfc_ref = options['rfc_ref']
135
+ conflicts = options['conflicts_with']
136
+ type_constraint = options['type_constraint']
137
+ options.keys.each do |opt_key|
138
+ unless %w{
139
+ ruby_name
140
+ type
141
+ multi
142
+ rfc_ref
143
+ conflicts_with
144
+ purpose
145
+ constant_value
146
+ default_value
147
+ }.include?(opt_key)
148
+ puts "**** WARNING: unprocessed option key #{opt_key} for property #{name}"
149
+ end
150
+ end
151
+ if conflicts
152
+ mutually_exclusive(name, *conflicts)
153
+ end
154
+ needs_tz_access = %w{OccurrenceList date_time_or_date DateTime Date}.include?(type)
155
+ ruby_name = ruby_name.tr("-", "_")
156
+ ruby_method = ruby_name.downcase
157
+ property = "#{name.tr("-", "_").downcase}_property"
158
+ if type_constraint != 'must_be_utc' && %w[date_time_or_date DateTime Period OccurrenceList].include?(type)
159
+ @date_time_props << property
160
+ end
161
+ @all_props[property] = name.upcase
162
+ @property_map[name.upcase] = :"#{property}_from_string"
163
+ parent_set = needs_tz_access ? ".for_parent(self)" : ""
164
+ if type == 'date_time_or_date'
165
+ line_evaluator = "RiCal::PropertyValue::DateTime.or_date(self, line)"
166
+ else
167
+ line_evaluator = "#{type_class(type)}.new(self, line)"
168
+ end
169
+ blank_line
170
+ if multi
171
+ comment(
172
+ "return the the #{name.upcase} property",
173
+ "which will be an array of instances of #{describe_property(type)}"
174
+ )
175
+ comment("", "[purpose (from RFC 2445)]", options["purpose"]) if options["purpose"]
176
+ comment("", "see RFC 2445 #{rfc_ref}") if rfc_ref
177
+ indent("def #{property}")
178
+ indent(" #{lazy_init_var(property,options)}")
179
+ indent("end")
180
+ unless (options["constant_value"])
181
+ plural_ruby_method = pluralize(ruby_method)
182
+ blank_line
183
+ comment("set the the #{name.upcase} property")
184
+ comment("one or more instances of #{describe_property(type)} may be passed to this method")
185
+ indent("def #{property}=(*property_values)")
186
+ if needs_tz_access
187
+ indent(" @#{property}= property_values.map{|prop| prop.for_parent(self)}")
188
+ else
189
+ indent(" @#{property}= property_values")
190
+ end
191
+ indent("end")
192
+ blank_line
193
+ comment("set the value of the #{name.upcase} property to multiple values")
194
+ comment("one or more instances of #{describe_type(type)} may be passed to this method")
195
+ indent("def #{plural_ruby_method}=(*ruby_values)")
196
+ indent(" @#{property} = ruby_values.map {|val| #{type_class(type)}.convert(self, val)}")
197
+ indent("end")
198
+ blank_line
199
+ comment("set the value of the #{name.upcase} property to a single value")
200
+ comment("one instance of #{describe_type(type)} may be passed to this method")
201
+ indent("def #{ruby_method}=(ruby_value)")
202
+ indent(" @#{property} = [#{type_class(type)}.convert(self, ruby_value)]")
203
+ indent("end")
204
+ blank_line
205
+ comment("add one or more values to the #{name.upcase} property")
206
+ comment("one or more instances of #{describe_type(type)} may be passed to this method")
207
+ indent("def add_#{plural_ruby_method}(*ruby_values)")
208
+ indent(" ruby_values.do {|val| self.#{property} << #{type_class(type)}.convert(self, val)}")
209
+ indent("end")
210
+ blank_line
211
+ comment("add one value to the #{name.upcase} property")
212
+ comment("one instances of #{describe_type(type)} may be passed to this method")
213
+ indent("def add_#{ruby_method}(ruby_value)")
214
+ indent(" self.#{property} << #{type_class(type)}.convert(self, ruby_value)")
215
+ indent("end")
216
+ blank_line
217
+ comment("remove one or more values from the #{name.upcase} property")
218
+ comment("one or more instances of #{describe_type(type)} may be passed to this method")
219
+ indent("def remove_#{plural_ruby_method}(*ruby_values)")
220
+ indent(" ruby_values.do {|val| self.#{property}.delete(#{type_class(type)}.convert(self, val))}")
221
+ indent("end")
222
+ blank_line
223
+ comment("remove one value from the #{name.upcase} property")
224
+ comment("one instances of #{describe_type(type)} may be passed to this method")
225
+ indent("def remove_#{ruby_method}(ruby_value)")
226
+ indent(" self.#{property}.delete(#{type_class(type)}.convert(self, ruby_value))")
227
+ indent("end")
228
+ end
229
+ blank_line
230
+ comment("return the value of the #{name.upcase} property")
231
+ comment("which will be an array of instances of #{describe_type(type)}")
232
+ indent("def #{ruby_method}")
233
+ indent(" #{property}.map {|prop| prop ? prop.value : prop}")
234
+ indent("end")
235
+ blank_line
236
+ no_doc("def #{property}_from_string(line)")
237
+ indent(" #{property} << #{line_evaluator}")
238
+ indent("end")
239
+ else
240
+ comment(
241
+ "return the the #{name.upcase} property",
242
+ "which will be an instances of #{describe_property(type)}"
243
+ )
244
+ comment("", "[purpose (from RFC 2445)]", options["purpose"]) if options["purpose"]
245
+ comment("", "see RFC 2445 #{rfc_ref}") if rfc_ref
246
+ indent("def #{property}")
247
+ indent(" #{lazy_init_var(property,options)}")
248
+ indent("end")
249
+ unless (options["constant_value"])
250
+ blank_line
251
+ comment("set the #{name.upcase} property")
252
+ comment("property value should be an instance of #{describe_property(type)}")
253
+ indent("def #{property}=(property_value)")
254
+ indent(" @#{property} = property_value#{parent_set}")
255
+ if conflicts
256
+ conflicts.each do |conflict|
257
+ indent(" @#{conflict}_property = nil")
258
+ end
259
+ end
260
+ indent("end")
261
+ blank_line
262
+ comment("set the value of the #{name.upcase} property")
263
+ indent("def #{ruby_method}=(ruby_value)")
264
+ indent(" self.#{property}= #{type_class(type)}.convert(self, ruby_value)")
265
+ indent("end")
266
+ end
267
+ blank_line
268
+ comment("return the value of the #{name.upcase} property")
269
+ comment("which will be an instance of #{describe_type(type)}")
270
+ indent("def #{ruby_method}")
271
+ indent(" #{property} ? #{property}.ruby_value : nil")
272
+ indent("end")
273
+ blank_line
274
+ no_doc("def #{property}_from_string(line)")
275
+ indent(" @#{property} = #{line_evaluator}")
276
+ indent("end")
277
+ @outfile.puts
278
+ end
279
+ end
280
+
281
+ def mutually_exclusive *prop_names
282
+ exclusives = prop_names.map {|str| :"#{str}_property"}.sort {|a, b| a.to_s <=> b.to_s}
283
+ unless mutually_exclusive_properties.include?(exclusives)
284
+ mutually_exclusive_properties << prop_names.map {|str| :"#{str}_property"}
285
+ end
286
+ end
287
+
288
+ def mutually_exclusive_properties
289
+ @mutually_exclusive_properties ||= []
290
+ end
291
+
292
+ def generate_support_methods
293
+ blank_line
294
+ indent("def export_properties_to(export_stream) #:nodoc:")
295
+ @all_props.each do |prop_attr, prop_name|
296
+ indent(" export_prop_to(export_stream, #{prop_name.inspect}, @#{prop_attr})")
297
+ end
298
+ indent("end")
299
+ blank_line
300
+ indent("def ==(o) #:nodoc:")
301
+ indent(" if o.class == self.class")
302
+ @all_props.keys.each_with_index do |prop_name, i|
303
+ and_str = i < @all_props.length - 1 ? " &&" : ""
304
+ indent(" (#{prop_name} == o.#{prop_name})#{and_str}")
305
+ end
306
+ indent(" else")
307
+ indent(" super")
308
+ indent(" end")
309
+ indent("end")
310
+ blank_line
311
+ indent("def initialize_copy(o) #:nodoc:")
312
+ indent(" super")
313
+ @all_props.each_key do |prop_name|
314
+ indent(" #{prop_name} = #{prop_name} && #{prop_name}.dup")
315
+ end
316
+ indent("end")
317
+ blank_line
318
+ indent("def add_date_times_to(required_timezones) #:nodoc:")
319
+ @date_time_props.each do | prop_name|
320
+ indent(" add_property_date_times_to(required_timezones, #{prop_name})")
321
+ end
322
+ indent("end")
323
+ blank_line
324
+ indent("module ClassMethods #:nodoc:")
325
+ indent(" def property_parser #:nodoc:")
326
+ indent(" #{@property_map.inspect}")
327
+ indent(" end")
328
+ indent("end")
329
+ blank_line
330
+ indent("def self.included(mod) #:nodoc:")
331
+ indent(" mod.extend ClassMethods")
332
+ indent("end")
333
+ blank_line
334
+ indent("def mutual_exclusion_violation #:nodoc:")
335
+ if mutually_exclusive_properties.empty?
336
+ indent(" false")
337
+ else
338
+ mutually_exclusive_properties.each do |mutex_set|
339
+ indent(" return true if #{mutex_set.inspect}.inject(0) {|sum, prop| send(prop) ? sum + 1 : sum} > 1")
340
+ end
341
+ indent(" false")
342
+ end
343
+ indent "end"
344
+ end
345
+
346
+ def update
347
+ File.open(File.join(File.dirname(__FILE__), '..', 'lib', 'ri_cal', 'properties' , "#{@name}.rb"), 'w') do |ruby_out_file|
348
+ @outfile = ruby_out_file
349
+ module_name = @name.camelize
350
+ class_name = module_name.sub(/Properties$/, "")
351
+ ruby_out_file.puts("module RiCal")
352
+ ruby_out_file.puts(" module Properties #:nodoc:")
353
+ @indent = " "
354
+ ruby_out_file.puts(" #- ©2009 Rick DeNatale")
355
+ ruby_out_file.puts(" #- All rights reserved. Refer to the file README.txt for the license")
356
+ ruby_out_file.puts(" #")
357
+ ruby_out_file.puts(" # Properties::#{module_name} provides property accessing methods for the #{class_name} class")
358
+ ruby_out_file.puts(" # This source file is generated by the rical:gen_propmodules rake tasks, DO NOT EDIT")
359
+ ruby_out_file.puts(" module #{module_name}")
360
+ @indent = " "
361
+ YAML.load_file(File.join(File.dirname(__FILE__), '..', 'component_attributes', "#{@name}.yml")).each do |att_def|
362
+ property(att_def)
363
+ end
364
+ generate_support_methods
365
+ ruby_out_file.puts(" end")
366
+ ruby_out_file.puts(" end")
367
+ ruby_out_file.puts("end")
368
+ end
369
+ @outfile = nil
370
+ end
371
+ end
372
+
373
+ def updateTask srcGlob, taskSymbol
374
+ targetDir = File.join(File.dirname(__FILE__), '..', 'lib', 'ri_cal', 'properties')
375
+ defsFile = File.join(File.dirname(__FILE__), '..', 'component_attributes', 'component_property_defs.yml')
376
+ FileList[srcGlob].each do |f|
377
+ unless f == defsFile
378
+ target = File.join targetDir, File.basename(f).gsub(".yml", ".rb")
379
+ file target => [f, defsFile, __FILE__] do |t|
380
+ VEntityUpdater.new(target, defsFile).update
381
+ end
382
+ task taskSymbol => target
383
+ end
384
+ end
385
+ end
386
+
387
+
388
+ namespace :rical do
389
+
390
+ desc '(RE)Generate VEntity attributes'
391
+ task :gen_propmodules do |t|
392
+ end
393
+
394
+ updateTask File.join(File.dirname(__FILE__), '..', '/component_attributes', '*.yml'), :gen_propmodules
395
+
396
+ end # namespace :rical
397
+
398
+ desc 'add or update copyright in code and specs'
399
+ task :copyrights do
400
+ require 'mmcopyrights'
401
+ MM::Copyrights.process('lib', "rb", "#-", IO.read('copyrights.txt'))
402
+ MM::Copyrights.process('spec', "rb", "#-", IO.read('copyrights.txt'))
403
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,35 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ require 'spec'
6
+ end
7
+ begin
8
+ require 'spec/rake/spectask'
9
+ rescue LoadError
10
+ puts <<-EOS
11
+ To use rspec for testing you must install rspec gem:
12
+ gem install rspec
13
+ EOS
14
+ exit(0)
15
+ end
16
+
17
+ desc "Run the specs under spec/models"
18
+ Spec::Rake::SpecTask.new do |t|
19
+ t.spec_opts = ['--options', "spec/spec.opts"]
20
+ t.spec_files = FileList['spec/**/*_spec.rb']
21
+ end
22
+
23
+
24
+
25
+ if RUBY_VERSION.match(/^1\.8\./)
26
+ desc 'Run all specs with RCov'
27
+ Spec::Rake::SpecTask.new(:rcov) do |t|
28
+ t.spec_opts = ['--options', "spec/spec.opts"]
29
+ t.spec_files = FileList['spec/**/*_spec.rb']
30
+ t.rcov = true
31
+ t.rcov_dir = "coverage"
32
+ t.rcov_opts = ['--exclude', 'spec']
33
+ end
34
+ end
35
+
metadata ADDED
@@ -0,0 +1,201 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubyredrick-ri_cal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - author=Rick DeNatale
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-06 00:00:00 -07:00
13
+ default_executable: ri_cal
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: newgem
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.3.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.8.0
34
+ version:
35
+ description: This is an UNOFFICIAL version. The public official version will be released on RubyForge. Github will be used for interim versions. USE THIS VERSION AT YOUR OWN RISK. A new Ruby implementation of RFC2445 iCalendar. The existing Ruby iCalendar libraries (e.g. icalendar, vpim) provide for parsing and generating icalendar files, but do not support important things like enumerating occurrences of repeating events. This is a clean-slate implementation of RFC2445.
36
+ email:
37
+ - rick.denatale@gmail.com
38
+ executables:
39
+ - ri_cal
40
+ extensions: []
41
+
42
+ extra_rdoc_files:
43
+ - History.txt
44
+ - Manifest.txt
45
+ - README.txt
46
+ - copyrights.txt
47
+ - docs/draft-ietf-calsify-2446bis-08.txt
48
+ - docs/draft-ietf-calsify-rfc2445bis-09.txt
49
+ - docs/incrementers.txt
50
+ files:
51
+ - History.txt
52
+ - Manifest.txt
53
+ - README.txt
54
+ - Rakefile
55
+ - bin/ri_cal
56
+ - component_attributes/alarm.yml
57
+ - component_attributes/calendar.yml
58
+ - component_attributes/component_property_defs.yml
59
+ - component_attributes/event.yml
60
+ - component_attributes/freebusy.yml
61
+ - component_attributes/journal.yml
62
+ - component_attributes/timezone.yml
63
+ - component_attributes/timezone_period.yml
64
+ - component_attributes/todo.yml
65
+ - copyrights.txt
66
+ - docs/draft-ietf-calsify-2446bis-08.txt
67
+ - docs/draft-ietf-calsify-rfc2445bis-09.txt
68
+ - docs/incrementers.txt
69
+ - docs/rfc2445.pdf
70
+ - lib/ri_cal.rb
71
+ - lib/ri_cal/component.rb
72
+ - lib/ri_cal/component/alarm.rb
73
+ - lib/ri_cal/component/calendar.rb
74
+ - lib/ri_cal/component/event.rb
75
+ - lib/ri_cal/component/freebusy.rb
76
+ - lib/ri_cal/component/journal.rb
77
+ - lib/ri_cal/component/t_z_info_timezone.rb
78
+ - lib/ri_cal/component/timezone.rb
79
+ - lib/ri_cal/component/timezone/daylight_period.rb
80
+ - lib/ri_cal/component/timezone/standard_period.rb
81
+ - lib/ri_cal/component/timezone/timezone_period.rb
82
+ - lib/ri_cal/component/todo.rb
83
+ - lib/ri_cal/core_extensions.rb
84
+ - lib/ri_cal/core_extensions/array.rb
85
+ - lib/ri_cal/core_extensions/array/conversions.rb
86
+ - lib/ri_cal/core_extensions/date.rb
87
+ - lib/ri_cal/core_extensions/date/conversions.rb
88
+ - lib/ri_cal/core_extensions/date_time.rb
89
+ - lib/ri_cal/core_extensions/date_time/conversions.rb
90
+ - lib/ri_cal/core_extensions/object.rb
91
+ - lib/ri_cal/core_extensions/object/conversions.rb
92
+ - lib/ri_cal/core_extensions/string.rb
93
+ - lib/ri_cal/core_extensions/string/conversions.rb
94
+ - lib/ri_cal/core_extensions/time.rb
95
+ - lib/ri_cal/core_extensions/time/calculations.rb
96
+ - lib/ri_cal/core_extensions/time/conversions.rb
97
+ - lib/ri_cal/core_extensions/time/week_day_predicates.rb
98
+ - lib/ri_cal/invalid_timezone_identifer.rb
99
+ - lib/ri_cal/occurrence_enumerator.rb
100
+ - lib/ri_cal/parser.rb
101
+ - lib/ri_cal/properties/alarm.rb
102
+ - lib/ri_cal/properties/calendar.rb
103
+ - lib/ri_cal/properties/event.rb
104
+ - lib/ri_cal/properties/freebusy.rb
105
+ - lib/ri_cal/properties/journal.rb
106
+ - lib/ri_cal/properties/timezone.rb
107
+ - lib/ri_cal/properties/timezone_period.rb
108
+ - lib/ri_cal/properties/todo.rb
109
+ - lib/ri_cal/property_value.rb
110
+ - lib/ri_cal/property_value/array.rb
111
+ - lib/ri_cal/property_value/cal_address.rb
112
+ - lib/ri_cal/property_value/date.rb
113
+ - lib/ri_cal/property_value/date_time.rb
114
+ - lib/ri_cal/property_value/date_time/additive_methods.rb
115
+ - lib/ri_cal/property_value/date_time/time_machine.rb
116
+ - lib/ri_cal/property_value/date_time/timezone_support.rb
117
+ - lib/ri_cal/property_value/duration.rb
118
+ - lib/ri_cal/property_value/geo.rb
119
+ - lib/ri_cal/property_value/integer.rb
120
+ - lib/ri_cal/property_value/occurrence_list.rb
121
+ - lib/ri_cal/property_value/period.rb
122
+ - lib/ri_cal/property_value/recurrence_rule.rb
123
+ - lib/ri_cal/property_value/recurrence_rule/enumeration_support_methods.rb
124
+ - lib/ri_cal/property_value/recurrence_rule/enumerator.rb
125
+ - lib/ri_cal/property_value/recurrence_rule/initialization_methods.rb
126
+ - lib/ri_cal/property_value/recurrence_rule/negative_setpos_enumerator.rb
127
+ - lib/ri_cal/property_value/recurrence_rule/numbered_span.rb
128
+ - lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb
129
+ - lib/ri_cal/property_value/recurrence_rule/recurring_day.rb
130
+ - lib/ri_cal/property_value/recurrence_rule/recurring_month_day.rb
131
+ - lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb
132
+ - lib/ri_cal/property_value/recurrence_rule/recurring_year_day.rb
133
+ - lib/ri_cal/property_value/recurrence_rule/validations.rb
134
+ - lib/ri_cal/property_value/text.rb
135
+ - lib/ri_cal/property_value/uri.rb
136
+ - lib/ri_cal/property_value/utc_offset.rb
137
+ - lib/ri_cal/required_timezones.rb
138
+ - lib/ri_cal/time_with_floating_timezone.rb
139
+ - ri_cal.gemspec
140
+ - sample_ical_files/from_ical_dot_app/test1.ics
141
+ - script/console
142
+ - script/destroy
143
+ - script/generate
144
+ - script/txt2html
145
+ - spec/ri_cal/component/alarm_spec.rb
146
+ - spec/ri_cal/component/calendar_spec.rb
147
+ - spec/ri_cal/component/event_spec.rb
148
+ - spec/ri_cal/component/freebusy_spec.rb
149
+ - spec/ri_cal/component/journal_spec.rb
150
+ - spec/ri_cal/component/t_z_info_timezone_spec.rb
151
+ - spec/ri_cal/component/timezone_spec.rb
152
+ - spec/ri_cal/component/todo_spec.rb
153
+ - spec/ri_cal/component_spec.rb
154
+ - spec/ri_cal/core_extensions/time/calculations_spec.rb
155
+ - spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb
156
+ - spec/ri_cal/occurrence_enumerator_spec.rb
157
+ - spec/ri_cal/parser_spec.rb
158
+ - spec/ri_cal/property_value/date_spec.rb
159
+ - spec/ri_cal/property_value/date_time_spec.rb
160
+ - spec/ri_cal/property_value/duration_spec.rb
161
+ - spec/ri_cal/property_value/period_spec.rb
162
+ - spec/ri_cal/property_value/recurrence_rule/recurring_year_day_spec.rb
163
+ - spec/ri_cal/property_value/recurrence_rule_spec.rb
164
+ - spec/ri_cal/property_value/text_spec.rb
165
+ - spec/ri_cal/property_value/utc_offset_spec.rb
166
+ - spec/ri_cal/property_value_spec.rb
167
+ - spec/ri_cal/required_timezones_spec.rb
168
+ - spec/ri_cal_spec.rb
169
+ - spec/spec.opts
170
+ - spec/spec_helper.rb
171
+ - tasks/ri_cal.rake
172
+ - tasks/spec.rake
173
+ has_rdoc: true
174
+ homepage: http://rical.rubyforge.org/
175
+ post_install_message:
176
+ rdoc_options:
177
+ - --main
178
+ - README.txt
179
+ require_paths:
180
+ - lib
181
+ required_ruby_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: "0"
186
+ version:
187
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: "0"
192
+ version:
193
+ requirements: []
194
+
195
+ rubyforge_project: rical
196
+ rubygems_version: 1.2.0
197
+ signing_key:
198
+ specification_version: 3
199
+ summary: This is an UNOFFICIAL version
200
+ test_files: []
201
+