Permalink
Browse files

fixed bug in String::last_part_without_params

  • Loading branch information...
1 parent 2db147f commit 3a816e4286b99cce54a44d9b11ad06279554623b @rdulepet committed Jun 21, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 global.rb
View
@@ -71,11 +71,12 @@ def last_part
self[self.rindex('/')+1..-1]
end
def last_part_without_params
- sig_pos = self.rindex("?Signature") - 1
- if sig_pos > 2
- self[self[0..sig_pos].rindex('/')+1..sig_pos]
- else
+ sig_pos = self.rindex("?Signature")
+ if sig_pos.nil?
self.last_part
+ else
+ sig_pos -= 1
+ self[self[0..sig_pos].rindex('/')+1..sig_pos]
end
end
end

0 comments on commit 3a816e4

Please sign in to comment.