bolster 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bolster/version.rb +1 -1
- data/lib/bolster.rb +10 -7
- 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: 9bd50f6d63dd5b641a4a2005a14513ed8ba33a6a
|
4
|
+
data.tar.gz: caeac49197fb725ab689a8dd6a6a9abc75bb2f32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e84fc7af36466388b87fb9e1012d00bc7a354072c471180ff7a5ef75d582ed537e1ddbc80ddb019999ee3b025d4ab0b8e5c2bc43c832ff156ae365f02b9baf4
|
7
|
+
data.tar.gz: 2691fdbe312995e65e3aead435dc52b7e108dd42f2b29b4c49565ff333e471602c85a89e7124fc82bed319613405cfd8983a208f78bfb8cf6b5b63585365e5a0
|
data/lib/bolster/version.rb
CHANGED
data/lib/bolster.rb
CHANGED
@@ -3,10 +3,11 @@ require 'net/http'
|
|
3
3
|
|
4
4
|
module Bolster
|
5
5
|
class Server
|
6
|
-
def initialize(host, port,
|
7
|
-
@host
|
8
|
-
@port
|
9
|
-
@
|
6
|
+
def initialize(host, port, user = '', pass = '')
|
7
|
+
@host = host
|
8
|
+
@port = port
|
9
|
+
@user = user
|
10
|
+
@pass = pass
|
10
11
|
end
|
11
12
|
|
12
13
|
def delete(uri)
|
@@ -34,7 +35,10 @@ module Bolster
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def request(req)
|
37
|
-
res = Net::HTTP.start(@host, @port)
|
38
|
+
res = Net::HTTP.start(@host, @port) do |h|
|
39
|
+
req.basic_auth(@user, @pass) unless @user.empty
|
40
|
+
h.request(req)
|
41
|
+
end
|
38
42
|
unless res.kind_of?(Net::HTTPSuccess)
|
39
43
|
handle_error(req, res)
|
40
44
|
end
|
@@ -49,5 +53,4 @@ module Bolster
|
|
49
53
|
raise e
|
50
54
|
end
|
51
55
|
end
|
52
|
-
end
|
53
|
-
|
56
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Rische
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|