excon-addressable 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +7 -0
- data/.wercker.yml +7 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/excon-addressable.gemspec +1 -0
- data/lib/excon/addressable/version.rb +1 -1
- data/lib/excon/addressable.rb +3 -4
- data/test/excon/addressable_test.rb +7 -0
- data/test/test_helper.rb +1 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fb78674bba0eea1c3c0375e89057353d0a0ab2c
|
4
|
+
data.tar.gz: 7d7fbe6b86458feeb6d4df55607060c2d2741205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ea5018b4786f5c980043e760d0a4fc2ee358de76d6fa188168aae6625eab58d82159d43b92294c737bcbb5d8b584a0a9d3ea9bfd8be3bdfc475b72a6bd32bc5
|
7
|
+
data.tar.gz: 350853bfb125a5b8fb56b737b78fd67a8ce5bb6908eccf3092bce45aee830c58b5a492beb8b1ff9c846c16fe123d637d7197bd5d015a23aeb347fa1970e20d16
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/.wercker.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Excon::Addressable
|
1
|
+
# Excon::Addressable [](https://app.wercker.com/project/bykey/3868c162aa140566b830f517c45d528a)
|
2
2
|
|
3
3
|
Sets [Addressable][] as the default URI parser. Supports parsing [templated uris][].
|
4
4
|
|
data/Rakefile
CHANGED
data/excon-addressable.gemspec
CHANGED
data/lib/excon/addressable.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'addressable
|
3
|
-
require 'addressable/template'
|
2
|
+
require 'addressable'
|
4
3
|
require 'excon'
|
5
4
|
require 'excon/addressable/version'
|
6
5
|
|
@@ -12,8 +11,8 @@ module Excon
|
|
12
11
|
#
|
13
12
|
module Addressable
|
14
13
|
def new(url, params = {})
|
15
|
-
if (
|
16
|
-
url =
|
14
|
+
if (template = ::Addressable::Template.new(url)) && template.variables.any?
|
15
|
+
url = template.expand(params.delete(:expand).to_h)
|
17
16
|
end
|
18
17
|
|
19
18
|
super
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_relative '../test_helper'
|
2
3
|
|
3
4
|
module Excon
|
@@ -18,6 +19,12 @@ module Excon
|
|
18
19
|
assert_equal 200, conn.get.status
|
19
20
|
end
|
20
21
|
|
22
|
+
def test_templated_uri_with_optional_query_parameters
|
23
|
+
conn = Excon.new('http://www.example.com/{?uid}')
|
24
|
+
|
25
|
+
assert_equal '/', conn.data[:path]
|
26
|
+
end
|
27
|
+
|
21
28
|
def teardown
|
22
29
|
Excon.stubs.clear
|
23
30
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon-addressable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean
|
@@ -117,6 +117,8 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- ".gitignore"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".wercker.yml"
|
120
122
|
- CODE_OF_CONDUCT.md
|
121
123
|
- Gemfile
|
122
124
|
- LICENSE.txt
|