gpd-request 0.2.6 → 0.3.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: 406187fac015ba0e44080d5a63be3b163946654c
4
- data.tar.gz: 407c54ba6c8896275219666d2b58e6ec4e61eda9
3
+ metadata.gz: 5a6420a7d41bdcbd2413c51b3c60536d4eb40474
4
+ data.tar.gz: c8fba7dba67253dfc789c30106101c34ac930b77
5
5
  SHA512:
6
- metadata.gz: c1f316a3dac6ba47453fa1f96d041904d33d564995105be937cedabec9a9761e88577cbca3389fb53b9f5bc290bb1f652a9f1d1246c89966dca5a60e8d9cf49d
7
- data.tar.gz: 65fb89e7b0405b06434ee8ffe1500f6711e8e59fa280d321e14a8fece0303355f8fb858677542605dacb9fef518b252ba55218f1b6027ac678d35de39bbcab46
6
+ metadata.gz: 8e9cd2be28ae7164106d05e61070ff165bbd9241c376814504ce17e7eeebb0bc933b21723d6d635e912891f4f0d2bf987b242a6c23aabc3ab74cede3bd1ba535
7
+ data.tar.gz: 5d227fc31ea08303b7aa0367ea6db9783aa10ecd96f1e35a807c20feb31bc41479b295f648ed6d603fbc6fc38fdfbafc18e9d57d546659626ddba6204594ed43
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -25,16 +25,28 @@ class GPDRequest
25
25
  response
26
26
  end
27
27
 
28
- def get(uri)
28
+ def get(uri, params={})
29
29
 
30
30
  if uri =~ /^http:/ then
31
- request(uri) {|url| Net::HTTP::Get.new url.path, @headers }
31
+
32
+ request(uri) do |url|
33
+
34
+ if params.any? then
35
+
36
+ encoded_params = URI.encode_www_form(params)
37
+ Net::HTTP::Get.new [url.path, encoded_params].join('?'), @headers
38
+
39
+ else
40
+ Net::HTTP::Get.new url.path, @headers
41
+ end
42
+ end
32
43
  elsif uri =~ /^https:/
33
44
  Net::HTTP.get_response(URI.parse(uri))
34
45
  end
35
46
  end
36
47
 
37
48
  def post(uri, form_data={})
49
+
38
50
  request(uri) do |url|
39
51
  req = Net::HTTP::Post.new(url.path, @headers)
40
52
  req.set_form_data form_data unless form_data.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpd-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  5kgV31ryhm+mzvSnIN8PPLwwIM5uEYTrHytfjeeXQkpmsteTsitHqtzKFEKTQ69m
32
32
  ZZmiIrzZdraCEg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-06-11 00:00:00.000000000 Z
34
+ date: 2016-04-25 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@r0bertson.co.uk
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 2.4.6
63
+ rubygems_version: 2.4.8
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: GPD-Request is a convenient Net::HTTP wrapper
metadata.gz.sig CHANGED
Binary file