absolutely 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9b505d4787ad0998d9d275e566fe601dc553657
4
- data.tar.gz: 4665126a8c9960502979c5d4dac82040eefc30a2
3
+ metadata.gz: 4963a03132b55c8a4baaafc53ade13535e8330e1
4
+ data.tar.gz: 534d96de67767fd4fa1583e6fd1f41cdf8403c8b
5
5
  SHA512:
6
- metadata.gz: 9c7cbe7389db5618cb519b0c5791d75fce293c0f0ce36aa2954d1d391736fb32fcdea2d55a290e637153b74d6eb2bd5cd87993d1e3151bd0e021cc2077bdc9ac
7
- data.tar.gz: 48c62d0900071f7cdbfa3e99c62c09d49cc7fd4bdea43bf77d23f2a2430ba5053c6bbdd1856f5ce2190febfe88d187d409b0f824196d150acb1d79281bfab5a7
6
+ metadata.gz: 2f756f5ad8de83f144928b4db0b80e9279d4fadaf573759c3b3841eb9299ea944ffe6e17477c60ef0219ac2855b90cc3e76bccc6d926843b97d7354d45562298
7
+ data.tar.gz: 27742f498491e1e26e285ef0a63c800fbc6efe70d2d7844be93f9d5e53b900bfaf7d20959e1b35a9050de7900555e6c26a3524518d2890bf74eff35c0aaad8fb
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 / 2018-07-05
4
+
5
+ - **Breaking Change:** Return value passed as `relative` if `relative` is to determined to be an absolute URI, regardless of the value passed as `base`. ([e3996eb](https://github.com/jgarber623/absolutely/commit/e3996eb))
6
+ - Update documentation to demonstrate new `relative` parameter behavior.
7
+
8
+ ## 0.1.0 / 2018-07-04
9
+
10
+ - Initial release!
data/README.md CHANGED
@@ -62,6 +62,16 @@ uri = Absolutely.to_absolute_uri(base: 'https://example.com', relative: '/foo')
62
62
  puts uri # returns String: 'https://example.com/foo'
63
63
  ```
64
64
 
65
+ 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`:
66
+
67
+ ```ruby
68
+ require 'absolutely'
69
+
70
+ uri = Absolute.to_absolute_uri(base: 'https://example.com', relative: 'https://example.com/foo')
71
+
72
+ puts uri # returns String: 'https://example.com/foo'
73
+ ```
74
+
65
75
  ### Advanced Usage
66
76
 
67
77
  Should the need arise, you may work directly with the `Absolutely::URI` class:
@@ -10,7 +10,8 @@ module Absolutely
10
10
  @relative = relative
11
11
 
12
12
  raise ArgumentError, 'base must be an absolute URI (e.g. https://example.com)' unless base_uri.absolute?
13
- raise ArgumentError, 'relative must be a relative URI (e.g. /example)' unless relative_uri.relative?
13
+
14
+ relative_uri
14
15
  end
15
16
 
16
17
  def base_uri
@@ -26,6 +27,8 @@ module Absolutely
26
27
  end
27
28
 
28
29
  def to_absolute_uri
30
+ return relative_uri.to_s if relative_uri.absolute?
31
+
29
32
  (base_uri + relative_uri).to_s
30
33
  end
31
34
  end
@@ -1,3 +1,3 @@
1
1
  module Absolutely
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: absolutely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Garber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-04 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -155,6 +155,7 @@ files:
155
155
  - ".ruby-version"
156
156
  - ".simplecov"
157
157
  - ".travis.yml"
158
+ - CHANGELOG.md
158
159
  - CONTRIBUTING.md
159
160
  - Gemfile
160
161
  - LICENSE