dagger 0.8.1 → 0.9.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: f6ad5b2966387630b567d92a4eb54dc526e7a438
4
- data.tar.gz: b20fb218baf727a58c22da843bd8505429063685
3
+ metadata.gz: 6896a1e5913e8ce4b9879c37a02d568e72172334
4
+ data.tar.gz: f2dbc4b93949b5f0d103f51bd60572aee6cdd30a
5
5
  SHA512:
6
- metadata.gz: 9642e40bba7bf9ee0457d1b371dfbb08a80f3e2a7ad047f61a245cba7583ff076c1ac4bc5210a9bbe1cf0ec957a9ec35cb3c6a6265b0bc3f92582996b83b12c7
7
- data.tar.gz: 4e9e1ce44eea6689d8d824ad5bf26e654a06f581c6a6db1300be02f29974e3410dffe823e5299039fd0cdfd090560b09a2abcbcbd6d43f287a4c5ce99f559768
6
+ metadata.gz: 25f2c0572afc77ee899f76796cdb30d91837b95c3553de77f99105035511fa4478b7beea5b6232d17716dff959a1e7aa58f2522e3fd699e4ee3ef92b07dcd230
7
+ data.tar.gz: 3addebeece69d685a1f57818ece2e75b3773ddc362385d9a589372085186f83a4982e7f39db0de2b96c04a8b628fce7e04330efa7f74c0c817238c530c5b7270
@@ -70,7 +70,7 @@ module Dagger
70
70
  opts[:follow] = 10 if opts[:follow] == true
71
71
 
72
72
  path = uri[0] == '/' ? uri : Utils.parse_uri(uri).request_uri
73
- path.sub!(/\?.*|$/, '?' + Utils.encode(opts[:query])) if opts[:query]
73
+ path.sub!(/\?.*|$/, '?' + Utils.encode(opts[:query])) if opts[:query] and opts[:query].any?
74
74
 
75
75
  request = Net::HTTP::Get.new(path, DEFAULT_HEADERS.merge(opts[:headers] || {}))
76
76
  request.basic_auth(opts.delete(:username), opts.delete(:password)) if opts[:username]
@@ -104,7 +104,10 @@ module Dagger
104
104
  end
105
105
 
106
106
  def request(method, uri, data, opts = {})
107
- return get(uri, opts.merge(query: data)) if method.to_s.downcase == 'get'
107
+ if method.to_s.downcase == 'get'
108
+ query = (opts[:query] || {}).merge(data || {})
109
+ return get(uri, opts.merge(query: query))
110
+ end
108
111
 
109
112
  uri = Utils.parse_uri(uri)
110
113
  headers = DEFAULT_HEADERS.merge(opts[:headers] || {})
@@ -142,7 +145,7 @@ module Dagger
142
145
  end
143
146
 
144
147
  def close
145
- @http.finish
148
+ @http.finish if @http.started?
146
149
  end
147
150
 
148
151
  private
@@ -1,7 +1,7 @@
1
1
  module Dagger
2
2
  MAJOR = 0
3
- MINOR = 8
4
- PATCH = 1
3
+ MINOR = 9
4
+ PATCH = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomás Pollak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-24 00:00:00.000000000 Z
11
+ date: 2017-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler