webclient 0.1.0 → 0.1.1

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: 341993a1bad956dda14de5a33dfa94355e7df6a3
4
- data.tar.gz: 3063bac3858324ac7cbcd650e88cf332ce46f5e9
3
+ metadata.gz: 6e556a9e6949903368d71f7b0eec721c772edbf5
4
+ data.tar.gz: bf7fa4bf5f66eba5a31d1b5be692d09b4693ee7e
5
5
  SHA512:
6
- metadata.gz: 4819baa4904dba19cbdc898fb6244806db8fccaffcdc396027f7fe6e0be08b366b40e171f71b972e5c5ccd739e46461074acfc6b7d4edc9d6787d95dcb5244f3
7
- data.tar.gz: 042b1cd3a09e94ca0c791dfe19d9ccecd48a440435a131fdbad4e779c1d68d1d450d82b2eaa7e744fb61b832ce7cf1ba65815901ffa25c6067b1f225b339a171
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
 
@@ -2,7 +2,7 @@
2
2
  class Webclient
3
3
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
  VERSION = [MAJOR,MINOR,PATCH].join('.')
7
7
 
8
8
  def self.version
@@ -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.0
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-06 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc