Canonicalise URLs
Canonicalises URLs.
Add this line to your application’s Gemfile:
gem 'optic14n'
And then execute:
$ bundle
Or install it yourself as:
$ gem install optic14n
Parse a BLURI
like this:
bluri = BLURI('http://somewhere.com/?a=1&b=2&c=3')
Canonicalize it according to the Previously-Established Rules thusly:
bluri.canonicalize!
You can also do site-specific stuff if you know some of the querystring will be valuable
bluri.canonicalize!(allow_query: :all)
bluri.canonicalize!(allow_query: [:a, :c])
# or
bluri.canonicalize!(allow_query: ['a', 'c'])
This is a gem for canonicalising HTTP URIs such that we can boil our input set of URIs down to something that is much
smaller than it would otherwise be. We do this aggressively by:
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)