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 +4 -4
- data/lib/dagger.rb +6 -3
- data/lib/dagger/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6896a1e5913e8ce4b9879c37a02d568e72172334
|
4
|
+
data.tar.gz: f2dbc4b93949b5f0d103f51bd60572aee6cdd30a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25f2c0572afc77ee899f76796cdb30d91837b95c3553de77f99105035511fa4478b7beea5b6232d17716dff959a1e7aa58f2522e3fd699e4ee3ef92b07dcd230
|
7
|
+
data.tar.gz: 3addebeece69d685a1f57818ece2e75b3773ddc362385d9a589372085186f83a4982e7f39db0de2b96c04a8b628fce7e04330efa7f74c0c817238c530c5b7270
|
data/lib/dagger.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/dagger/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|