webclient 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/webclient/version.rb +1 -1
- data/lib/webclient/webclient.rb +12 -1
- 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: 6e556a9e6949903368d71f7b0eec721c772edbf5
|
4
|
+
data.tar.gz: bf7fa4bf5f66eba5a31d1b5be692d09b4693ee7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 575883f59d791b4326d9dc88184875fb2e120a5676d946088dffc59aa9f4e493412621dc7b77e9b15c9cbb8edd611f0ad0ce25fdeae33b6248f574f9d3962a28
|
7
|
+
data.tar.gz: 40a53603700a3d12a55bca74071d8dbd48ebfea04bda68b0889c5cac135aca17e82aab9ab08cdf5c24f0c749fb9f24ea3a7ca64ad154d267881ef3406897dae2
|
data/README.md
CHANGED
@@ -7,6 +7,7 @@ webclient gem - yet (another) universal network client interface for world wide
|
|
7
7
|
* bugs :: [github.com/rubycoco/webclient/issues](https://github.com/rubycoco/webclient/issues)
|
8
8
|
* gem :: [rubygems.org/gems/webclient](https://rubygems.org/gems/webclient)
|
9
9
|
* rdoc :: [rubydoc.info/gems/webclient](http://rubydoc.info/gems/webclient)
|
10
|
+
* forum :: [groups.google.com/group/wwwmake](https://groups.google.com/group/wwwmake)
|
10
11
|
|
11
12
|
|
12
13
|
|
data/lib/webclient/version.rb
CHANGED
data/lib/webclient/webclient.rb
CHANGED
@@ -47,7 +47,7 @@ class Webclient
|
|
47
47
|
end # (nested) class Response
|
48
48
|
|
49
49
|
|
50
|
-
def self.get( url, headers: {} )
|
50
|
+
def self.get( url, headers: {}, auth: [] )
|
51
51
|
|
52
52
|
uri = URI.parse( url )
|
53
53
|
http = Net::HTTP.new( uri.host, uri.port )
|
@@ -75,6 +75,17 @@ def self.get( url, headers: {} )
|
|
75
75
|
end
|
76
76
|
|
77
77
|
|
78
|
+
if auth.size == 2 ## e.g. ['user', 'password']
|
79
|
+
## always assume basic auth for now
|
80
|
+
## auth[0] => user
|
81
|
+
## auth[1] => password
|
82
|
+
request.basic_auth( auth[0], auth[1] )
|
83
|
+
puts " using basic auth - user: #{auth[0]}, password: ***"
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
puts "GET #{uri}..."
|
88
|
+
|
78
89
|
response = http.request( request )
|
79
90
|
|
80
91
|
## note: return "unified" wrapped response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|