gpd-request 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -2
- data/lib/gpd-request.rb +11 -8
- metadata +22 -20
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57da85659927d3d37b7d381360db89ee8dc0e9a3
|
4
|
+
data.tar.gz: 86bfadad40cdd856538da424aa9d6dfa4433b29f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc18b2b3dda3ba140cd97e601e0fe938f0f03e2f37dc042796fb3bcc57dc0d0b4afd1c1d0983272a2a3bfea79b0a4e64d1a2f99952e0de5fff0445812606e3b5
|
7
|
+
data.tar.gz: 6c70669c6892038653590b354e60db5956c845a5f2a68c5ab0ebc3c01df97593c90386716aa5816d5fec518b2fa7ebe32616d61b377a6e3814c47ab515db39d1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
����:�ܳs��>����j��ed�0���Y�w�/3�?_[�FFC� �*⏫�zک���`
|
1
|
+
w�HpX%"�~�L�N OAD�"���3��Q©eEB ��v�|i��S��:��P���C���9Ò��T�<,�&s�r�� &�W�����Ȱ�ExU�+F�Q���2�,���Q�ꑻ\�<^M��pi).%�v_2�D;���D�6=eus!R�F�-��4w�.Y ����Ѫ@�[�I1Uy(�'+'Nz:�g��=/���5Ѐ?���h�����( ���_,��I��'��L�I�k8>�\IG�X
|
data/lib/gpd-request.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
|
2
|
-
require 'rexml/document'
|
3
|
-
include REXML
|
1
|
+
#!/usr/bin/env ruby
|
4
2
|
|
5
3
|
# file: gpd-request.rb
|
6
4
|
|
5
|
+
require 'net/http'
|
6
|
+
|
7
|
+
|
7
8
|
class GPDRequest
|
8
9
|
|
9
|
-
def initialize(user, pass, headers={})
|
10
|
+
def initialize(user=nil, pass=nil, headers={})
|
10
11
|
@headers = {
|
11
12
|
"User-Agent" => "Ruby-GPDRequest"
|
12
13
|
}.merge headers
|
@@ -17,9 +18,11 @@ class GPDRequest
|
|
17
18
|
path = uri
|
18
19
|
url = URI.parse(path)
|
19
20
|
req = yield(url)
|
20
|
-
req.basic_auth(@username, @password)
|
21
|
-
response = Net::HTTP.new(url.host, url.port).start
|
22
|
-
|
21
|
+
req.basic_auth(@username, @password) if @user
|
22
|
+
response = Net::HTTP.new(url.host, url.port).start do |http|
|
23
|
+
http.request(req)
|
24
|
+
end
|
25
|
+
response
|
23
26
|
end
|
24
27
|
|
25
28
|
def get(uri)
|
@@ -57,4 +60,4 @@ class GPDRequest
|
|
57
60
|
end
|
58
61
|
end
|
59
62
|
|
60
|
-
end
|
63
|
+
end
|
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.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,26 +10,28 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE0MDIxNzE2MzYzNVoXDTE1MDIxNzE2MzYzNVowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wH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I7R7fEbdFZUJj4weLWqMyuy0nC3A/uM
|
30
|
+
iM3oAbSM9VzmCK2KBIPySx/8r5wMH15fEpTEAXN+po0Q4lHxuBjJdSmpiroJZVXh
|
31
|
+
PoI/B1yMaXhhavQWGSTzINraRwk+XYJNDPM7fqMWPO8A7oKFr1r8V/1FMvGR/n3A
|
32
|
+
tMlmg/7kJi8Gug==
|
31
33
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
34
|
+
date: 2014-02-17 00:00:00.000000000 Z
|
33
35
|
dependencies: []
|
34
36
|
description:
|
35
37
|
email: james@r0bertson.co.uk
|
@@ -48,17 +50,17 @@ require_paths:
|
|
48
50
|
- lib
|
49
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
50
52
|
requirements:
|
51
|
-
- -
|
53
|
+
- - ">="
|
52
54
|
- !ruby/object:Gem::Version
|
53
55
|
version: '0'
|
54
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
57
|
requirements:
|
56
|
-
- -
|
58
|
+
- - ">="
|
57
59
|
- !ruby/object:Gem::Version
|
58
60
|
version: '0'
|
59
61
|
requirements: []
|
60
62
|
rubyforge_project:
|
61
|
-
rubygems_version: 2.
|
63
|
+
rubygems_version: 2.1.11
|
62
64
|
signing_key:
|
63
65
|
specification_version: 4
|
64
66
|
summary: GPD-Request is a convenient Net::HTTP wrapper
|
metadata.gz.sig
CHANGED
Binary file
|