absolution 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +2 -1
- data/lib/absolution/version.rb +1 -1
- data/lib/absolution.rb +4 -1
- data/spec/absolution_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGVjNzcyODYzNTc5ODk1NWM3ZmE5ZWEyMWI2ZTdlOGUxYTI4YmU0YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTQyMTZjMWI3ODQ5ZTI1MWJhMjAxYzkxM2EwNTdhMDA0MmNmZDQ5Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2Y0NGM0NWZjNGRiZmE0ZGM5Mjg0YWMwNmE4NTkzZWI4YTMyZGI0ZjZjYjMx
|
10
|
+
YjAxODcyNDM0NTU1ODk2MDc0NTBjNTNjZmNmY2FlZTExNDZkMTUxNzU0OThh
|
11
|
+
M2U5NTVkOWYzMWFlODU1OThlNGM5Y2Q1NGMxOWVkYTQ4ODA5NGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmJiNzY2ZTVhMjkyYjVjNTQ5YTU2NmY3MmUyZWEyNTNiMDE1YjVlNzA4YzU5
|
14
|
+
NDYxZDU0ZmYzZjMxNTdhMmZiMzBlYjMyMmJkOTU0M2YyN2VjZjUxMzk1YjA5
|
15
|
+
OTZmNGI2N2IyOTU5OGQyY2EyMjc5ODJmZjY0ODM3OTBlZjE0MmI=
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ end
|
|
52
52
|
## Contributing ##
|
53
53
|
|
54
54
|
Do you use git-flow? I sure do. Please base anything you do off of
|
55
|
-
[the develop branch](https://github.com/ess/
|
55
|
+
[the develop branch](https://github.com/ess/absolution/tree/develop).
|
56
56
|
|
57
57
|
1. Fork it.
|
58
58
|
2. Perform some BDD magic. Seriously. Be testing.
|
@@ -60,6 +60,7 @@ Do you use git-flow? I sure do. Please base anything you do off of
|
|
60
60
|
|
61
61
|
## History ##
|
62
62
|
|
63
|
+
* 0.0.4 - Query strings are handled properly
|
63
64
|
* 0.0.2 - Initial release
|
64
65
|
|
65
66
|
## License ##
|
data/lib/absolution/version.rb
CHANGED
data/lib/absolution.rb
CHANGED
@@ -8,7 +8,10 @@ module Absolution
|
|
8
8
|
|
9
9
|
def construct_absolute_url(base_url, path)
|
10
10
|
u = URI.parse(base_url)
|
11
|
-
|
11
|
+
path.split('?').tap do |path_array|
|
12
|
+
u.path = path_array.first.start_with?('/') ? path_array.first : "/#{path_array.first}"
|
13
|
+
u.query = path_array.last if path_array.length > 1
|
14
|
+
end
|
12
15
|
u.to_s
|
13
16
|
end
|
14
17
|
|
data/spec/absolution_spec.rb
CHANGED
@@ -54,6 +54,14 @@ describe Absolution do
|
|
54
54
|
expect(klass.construct_absolute_url(base_url, asset_path)).
|
55
55
|
to eql(expected_url)
|
56
56
|
end
|
57
|
+
|
58
|
+
it 'handles query strings appropriately' do
|
59
|
+
base_url = 'http://fake.url'
|
60
|
+
asset_path = '/asset.file?key=val'
|
61
|
+
expected_url = base_url + asset_path
|
62
|
+
expect(klass.construct_absolute_url(base_url, asset_path)).
|
63
|
+
to eql(expected_url)
|
64
|
+
end
|
57
65
|
end
|
58
66
|
end
|
59
67
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: absolution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Walters
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|