excon-addressable 0.1.0 → 0.1.1

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: 756d84584c38d848ee4e1331c47838d51dc47f31
4
- data.tar.gz: 33156a1fef3e240325a506f6cd65f0157bbc4c85
3
+ metadata.gz: 2fb78674bba0eea1c3c0375e89057353d0a0ab2c
4
+ data.tar.gz: 7d7fbe6b86458feeb6d4df55607060c2d2741205
5
5
  SHA512:
6
- metadata.gz: eaf013eec260603b681e7633f107563492d75fa1036601923196e763c2d36c76ab5cea668d2b2e43de76165e7246eb57ca2ca5c86baae18c7932d1dea77b2ffc
7
- data.tar.gz: bab491e6ac390c5e2997058e671f1d389dd48b5e5df44dbae8f0067fbc3e9a8235fbbe352e604c684cce180d1534ad16031dfe312112f4dfe1425b9b2907e067
6
+ metadata.gz: 5ea5018b4786f5c980043e760d0a4fc2ee358de76d6fa188168aae6625eab58d82159d43b92294c737bcbb5d8b584a0a9d3ea9bfd8be3bdfc475b72a6bd32bc5
7
+ data.tar.gz: 350853bfb125a5b8fb56b737b78fd67a8ce5bb6908eccf3092bce45aee830c58b5a492beb8b1ff9c846c16fe123d637d7197bd5d015a23aeb347fa1970e20d16
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  /.bundle/
2
+ /.wercker/
2
3
  /Gemfile.lock
3
4
  /pkg/
data/.rubocop.yml ADDED
@@ -0,0 +1,7 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Exclude:
4
+ - '.wercker/**/*'
5
+
6
+ Metrics/LineLength:
7
+ Max: 100
data/.wercker.yml ADDED
@@ -0,0 +1,7 @@
1
+ box: ruby:2.3
2
+ build:
3
+ steps:
4
+ - bundle-install
5
+ - script:
6
+ name: tests
7
+ code: bundle exec rake
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Excon::Addressable
1
+ # Excon::Addressable [![wercker status](https://app.wercker.com/status/3868c162aa140566b830f517c45d528a/s/master "wercker status")](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
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'bundler/gem_tasks'
2
3
  require 'rake/testtask'
3
4
  require 'rubocop/rake_task'
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'excon/addressable/version'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Excon
3
3
  module Addressable
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'addressable/uri'
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 (variables = params.delete(:expand))
16
- url = ::Addressable::Template.new(url).expand(variables)
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
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
3
  require 'excon/addressable'
3
4
  require 'minitest/autorun'
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.0
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