Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't use Exception, StandardError is the way to go

  • Loading branch information...
commit a59f9ff867b46d2a963872ce75e549af9505075d 1 parent f423cd8
@reactormonk reactormonk authored committed
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/ri_cal/parser.rb
  2. +2 −2 lib/ri_cal/property_value.rb
View
4 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
+end
View
4 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))
Please sign in to comment.
Something went wrong with that request. Please try again.