README.md in absolutely-2.0.0 vs README.md in absolutely-2.1.0
- old
+ new
@@ -16,11 +16,11 @@
## Getting Started
Before installing and using Absolutely, you'll want to have [Ruby](https://www.ruby-lang.org) 2.4 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
-Absolutely is developed using Ruby 2.4.6 and is additionally tested against Ruby 2.5.5 and 2.6.2 using [Travis CI](https://travis-ci.com/jgarber623/absolutely).
+Absolutely is developed using Ruby 2.4.6 and is additionally tested against Ruby 2.5.5 and 2.6.3 using [Travis CI](https://travis-ci.com/jgarber623/absolutely).
## Installation
If you're using [Bundler](https://bundler.io), add Absolutely to your project's `Gemfile`:
@@ -43,35 +43,35 @@
With Absolutely added to your project's `Gemfile` and installed, you may convert relative URIs to absolute URIs by doing:
```ruby
require 'absolutely'
-uri = Absolutely.uri(base: 'https://example.com', relative: '/foo').to_absolute_uri
+uri = Absolutely.uri(base: 'https://example.com', relative: '/foo').to_abs
-puts uri # returns String: 'https://example.com/foo'
+puts uri # => String: 'https://example.com/foo'
```
This example combines the supplied `base` value (`https://example.com`) and combines it with the supplied `relative` value (`/foo`), returning the string `https://example.com/foo`.
You may obtain the same results using this slightly shorter version:
```ruby
require 'absolutely'
-uri = Absolutely.to_absolute_uri(base: 'https://example.com', relative: '/foo')
+uri = Absolutely.to_abs(base: 'https://example.com', relative: '/foo')
-puts uri # returns String: 'https://example.com/foo'
+puts uri # => 'https://example.com/foo'
```
Note that if the value passed as `relative` is determined to be an absolute URI, Absolutely will return the value of `relative` regardless of the value passed as `base`:
```ruby
require 'absolutely'
-uri = Absolute.to_absolute_uri(base: 'https://example.com', relative: 'https://example.com/foo')
+uri = Absolute.to_abs(base: 'https://example.com', relative: 'https://example.com/foo')
-puts uri # returns String: 'https://example.com/foo'
+puts uri # => 'https://example.com/foo'
```
### Advanced Usage
Should the need arise, you may work directly with the `Absolutely::URI` class:
@@ -79,21 +79,21 @@
```ruby
require 'absolutely'
uri = Absolutely::URI.new(base: 'https://example.com', relative: '/foo')
-puts uri # returns Absolutely::URI
+puts uri # => #<Absolutely::URI>
-puts uri.base # returns String: 'https://example.com'
-puts uri.relative # returns String: '/foo'
+puts uri.base # => 'https://example.com'
+puts uri.relative # => '/foo'
-puts uri.base_uri # returns Addressable::URI
-puts uri.relative_uri # returns Addressable::URI
+puts uri.base_uri # => #<Addressable::URI URI:https://example.com>
+puts uri.relative_uri # => #<Addressable::URI URI:/foo>
-puts uri.to_absolute_uri # returns String: 'https://example.com/foo'
+puts uri.to_abs # => 'https://example.com/foo'
```
-The `base_uri` and `relative_uri` methods return instances of `Addressable::URI` for convenience. For more on this class' available methods, see [the Addressable Ruby gem's source code](https://github.com/sporkmonger/addressable).
+For convenience, the `base_uri` and `relative_uri` methods return instances of the `Addressable::URI` class. For more on this class' available methods, see [the Addressable Ruby gem's source code](https://github.com/sporkmonger/addressable).
## Contributing
Interested in helping improve Absolutely? Awesome! Your help is greatly appreciated. See [CONTRIBUTING.md](https://github.com/jgarber623/absolutely/blob/master/CONTRIBUTING.md) for details.