diff --git a/lib/ri_cal/parser.rb b/lib/ri_cal/parser.rb index 99d3dd10..c24a7e60 100644 --- a/lib/ri_cal/parser.rb +++ b/lib/ri_cal/parser.rb @@ -87,7 +87,7 @@ def self.parse(io = StringIO.new("")) #:nodoc: end def invalid #:nodoc: - raise Exception.new("Invalid icalendar file") + raise "Invalid icalendar file" end def still_in(component, separated_line) #:nodoc: @@ -142,4 +142,4 @@ def parse_one(start, parent_component) #:nodoc: result end end -end \ No newline at end of file +end diff --git a/lib/ri_cal/property_value.rb b/lib/ri_cal/property_value.rb index 3ecaed44..9d6d94d8 100644 --- a/lib/ri_cal/property_value.rb +++ b/lib/ri_cal/property_value.rb @@ -57,12 +57,12 @@ def to_options_hash #:nodoc: def self.date_or_date_time(timezone_finder, separated_line) # :nodoc: match = separated_line[:value].match(/(\d\d\d\d)(\d\d)(\d\d)((T?)((\d\d)(\d\d)(\d\d))(Z?))?/) - raise Exception.new("Invalid date") unless match + raise "Invalid date" unless match if match[5] == "T" # date-time time = Time.utc(match[1].to_i, match[2].to_i, match[3].to_i, match[7].to_i, match[8].to_i, match[9].to_i) parms = (separated_line[:params] ||{}).dup if match[10] == "Z" - raise Exception.new("Invalid time, cannot combine Zulu with timezone reference") if parms[:tzid] + raise "Invalid time, cannot combine Zulu with timezone reference" if parms[:tzid] parms['TZID'] = "UTC" end PropertyValue::DateTime.new(timezone_finder, separated_line.merge(:params => parms))