Sha256: 6f33d0daa7c272da60414ab9759d2c8ae51a7aef8649184bee5507070f101dad

Contents?: true

Size: 178 Bytes

Versions: 7

Compression:

Stored size: 178 Bytes

Contents

module UrlReader::UrlFixer
  extend ActiveSupport::Concern

  def fixed_url(url)
    url.gsub(/[^[:ascii:]]| /) { |c| URI.encode(c) }.gsub('[', '%5B').gsub(']', '%5D')
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
url_reader-0.2.5 lib/url_reader/url_fixer.rb
url_reader-0.2.4 lib/url_reader/url_fixer.rb
url_reader-0.2.3 lib/url_reader/url_fixer.rb
url_reader-0.2.2 lib/url_reader/url_fixer.rb
url_reader-0.2.1 lib/url_reader/url_fixer.rb
url_reader-0.2.0 lib/url_reader/url_fixer.rb
url_reader-0.1.0 lib/url_reader/url_fixer.rb