ri_cal 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -1
- data/lib/ri_cal.rb +1 -1
- data/lib/ri_cal/property_value.rb +1 -1
- data/lib/ri_cal/property_value/date.rb +11 -0
- data/ri_cal.gemspec +2 -2
- data/spec/ri_cal/bugreports_spec.rb +10 -0
- data/spec/spec_helper.rb +7 -3
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
=== 0.8.
|
1
|
+
=== 0.8.5
|
2
|
+
Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/26
|
3
|
+
events with date parameters failing
|
4
|
+
=== 0.8.4 - 18 September 2009
|
2
5
|
Refactored load structure, should now be conforming to
|
3
6
|
http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices
|
4
7
|
I did finesse the load path issue a bit as a workaround to RSpec not putting lib on $LOADPATH
|
@@ -8,6 +11,8 @@
|
|
8
11
|
please clean your code up to be quiet
|
9
12
|
|
10
13
|
Thanks to Ryan for such a courteous problem report.
|
14
|
+
=== 0.8.3 - 18 September 2009
|
15
|
+
Released with bad gemspec
|
11
16
|
=== 0.8.2 - 4 September 2009
|
12
17
|
Fixes http://rick_denatale.lighthouseapp.com/projects/30941/tickets/23
|
13
18
|
initialization_methodsrb-syntax
|
data/lib/ri_cal.rb
CHANGED
@@ -37,7 +37,7 @@ module RiCal
|
|
37
37
|
autoload :RequiredTimezones, "ri_cal/required_timezones.rb"
|
38
38
|
require "ri_cal/core_extensions.rb"
|
39
39
|
# :stopdoc:
|
40
|
-
VERSION = '0.8.
|
40
|
+
VERSION = '0.8.5'
|
41
41
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
42
42
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
43
43
|
|
@@ -53,7 +53,7 @@ module RiCal
|
|
53
53
|
options_hash = {:value => value}
|
54
54
|
options_hash[:params] = params unless params.empty?
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
def self.date_or_date_time(timezone_finder, separated_line) # :nodoc:
|
58
58
|
match = separated_line[:value].match(/(\d\d\d\d)(\d\d)(\d\d)((T?)((\d\d)(\d\d)(\d\d))(Z?))?/)
|
59
59
|
raise Exception.new("Invalid date") unless match
|
@@ -91,6 +91,17 @@ module RiCal
|
|
91
91
|
self
|
92
92
|
end
|
93
93
|
|
94
|
+
def for_parent(parent) #:nodoc:
|
95
|
+
if timezone_finder.nil?
|
96
|
+
@timezone_finder = parent
|
97
|
+
self
|
98
|
+
elsif parent == timezone_finder
|
99
|
+
self
|
100
|
+
else
|
101
|
+
Date.new(parent, :value => @date_time_value)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
94
105
|
def advance(options) #:nodoc:
|
95
106
|
PropertyValue::Date.new(timezone_finder, :value => @date_time_value.advance(options), :params =>(params ? params.dup : nil) )
|
96
107
|
end
|
data/ri_cal.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{ri_cal}
|
5
|
-
s.version = "0.8.
|
5
|
+
s.version = "0.8.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["author=Rick DeNatale"]
|
9
|
-
s.date = %q{2009-09-
|
9
|
+
s.date = %q{2009-09-27}
|
10
10
|
s.default_executable = %q{ri_cal}
|
11
11
|
s.description = %q{A new Ruby implementation of RFC2445 iCalendar.
|
12
12
|
|
@@ -237,3 +237,13 @@ context "ticket #23" do
|
|
237
237
|
end
|
238
238
|
end
|
239
239
|
end
|
240
|
+
|
241
|
+
context "ticket #26" do
|
242
|
+
context "Date property" do
|
243
|
+
it "should handle for_parent" do
|
244
|
+
lambda {
|
245
|
+
RiCal::PropertyValue::Date.convert(:foo, Date.parse("20090927")).for_parent(:bar)}.should_not raise_error
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
data/spec/spec_helper.rb
CHANGED
@@ -4,10 +4,14 @@ require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib ri_cal]))
|
|
4
4
|
require 'cgi'
|
5
5
|
require 'tzinfo'
|
6
6
|
|
7
|
+
|
7
8
|
module Kernel
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
if ENV.keys.find {|env_var| env_var.match(/^TM_/)}
|
10
|
+
def rputs(*args)
|
11
|
+
puts( *["<pre>", args.collect {|a| CGI.escapeHTML(a.to_s)}, "</pre>"])
|
12
|
+
end
|
13
|
+
else
|
14
|
+
alias_method :rputs, :puts
|
11
15
|
end
|
12
16
|
end
|
13
17
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ri_cal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- author=Rick DeNatale
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-28 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|