This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chronic' | |
module Chronic | |
class << self | |
def scan(text) | |
return enum_for(:scan, text) unless block_given? | |
# words is lossless. We need to be able to join('') this and get | |
# the original string back | |
words = scan_by_re(text, /\s+/).to_a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extracted from the following library | |
# http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ | |
#-- | |
# Utility for creating Google Maps Encoded GPolylines | |
# License: You may distribute this code under the same terms as Ruby itself | |
# Author: Joel Rosenberg | |
class DouglasPeucker | |
# The minimum distance from the line that a point must exceed to avoid | |
# elimination under the DP Algorithm. |
NewerOlder