Skip to content

Commit

Permalink
don't use Exception, StandardError is the way to go
Browse files Browse the repository at this point in the history
  • Loading branch information
reactormonk authored and LouisStAmour committed Sep 28, 2010
1 parent f423cd8 commit a59f9ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ri_cal/parser.rb
Expand Up @@ -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:
Expand Down Expand Up @@ -142,4 +142,4 @@ def parse_one(start, parent_component) #:nodoc:
result
end
end
end
end
4 changes: 2 additions & 2 deletions lib/ri_cal/property_value.rb
Expand Up @@ -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))
Expand Down

0 comments on commit a59f9ff

Please sign in to comment.