Permalink
Browse files

Play nice with Ruby 1.9

  • Loading branch information...
1 parent 6e5a999 commit cebb60547e6d94933f0bda8eba00ae34c20173cf @joshuaclayton committed Feb 19, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/polylines/base.rb
@@ -64,7 +64,7 @@ def step_10
def step_11
encode! { current_value.map(&:chr).join }
- decode! { current_value.split(//).map {|char| char[0] } }
+ decode! { current_value.split(//).map {|char| char.unpack("U").first } }
end
def encode!
@@ -104,7 +104,7 @@ def self.transform_to_array_of_lat_lng_and_deltas(value)
return value.split(//).inject([]) do |charset, char|
set << char
- if ((char[0] - 63) & 0x20) == 0
+ if ((char.unpack("U").first - 63) & 0x20).zero?
charset << set.join
set = []
end

0 comments on commit cebb605

Please sign in to comment.