Skip to content

JonathonMA/iuri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IURI - Immuatble URI class in ruby

I often want to write something like this:

URI.parse("http://example.com").tap do |uri|
  uri.scheme = "https"
end

But I would rather write:

URI.parse("http://example.com").with scheme: 'https'

Installation

Add this line to your application's Gemfile:

gem 'iuri'

And then execute:

$ bundle

Or install it yourself as:

$ gem install iuri

Usage

uri = IURI.parse "http://example.com"
secure_uri = uri.with scheme: 'https'

Contributing

  1. Fork it ( http://github.com//iuri/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Languages