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 +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +10 -0
- data/lib/absolutely/uri.rb +4 -1
- data/lib/absolutely/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4963a03132b55c8a4baaafc53ade13535e8330e1
|
4
|
+
data.tar.gz: 534d96de67767fd4fa1583e6fd1f41cdf8403c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
data/lib/absolutely/uri.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/absolutely/version.rb
CHANGED
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:
|
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-
|
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
|