zanzibar 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/zanzibar.rb +14 -0
- data/lib/zanzibar/version.rb +1 -1
- data/spec/zanzibar_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDRjYjhkOGQwYTY1OGUzMDYzNGM1YWQ2YzI5YjI0YzE1ZGY5MWFmNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWUxNDgyMjg0Njg5MmJkMzcwOTU0NzEwNjRjYTkzZGJiYjM3YmQ4ZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWIwMjY0NTY1ZGFhYjNmZmQxZWRiMGI2Yzc1MTkxZTI5MmZjYzcyMmY0M2Y3
|
10
|
+
M2Y0Mzc3NjA5NDljNTMxN2FkYmY5MjUyZDM2MDBlZTVlYzVjZGEzMTM1YmY4
|
11
|
+
ODI5ZDM0M2ZjNTllZTJmYjE2MWQ1NGVlNGI3MmQ5Y2EwNzdkNGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njg3ZTU5MzkyMWZkNDIxZGNlMjU4ODgwZmJiNDExMmNhNWFmODE2ODkxZmFm
|
14
|
+
ZjVlN2NmMTRhMzRmNjk0MWIwMjE5OGQ2MzhhNWNmMzdiYjZkZmIyZmIwNmM0
|
15
|
+
NTg1ZTk1ZDAzMTk2ZmY4YjBhOWNiMmZlMTI0NmM0MTYxNDZlNTI=
|
data/lib/zanzibar.rb
CHANGED
@@ -13,6 +13,8 @@ module Zanzibar
|
|
13
13
|
def initialize(args = {})
|
14
14
|
if args[:username]
|
15
15
|
@@username = args[:username]
|
16
|
+
elsif ENV['ZANZIBAR_USER']
|
17
|
+
@@username = ENV['ZANZIBAR_USER']
|
16
18
|
else
|
17
19
|
@@username = ENV['USER']
|
18
20
|
end
|
@@ -22,11 +24,15 @@ module Zanzibar
|
|
22
24
|
else
|
23
25
|
@@wsdl = get_wsdl_location
|
24
26
|
end
|
27
|
+
|
25
28
|
if args[:pwd]
|
26
29
|
@@password = args[:pwd]
|
30
|
+
elsif ENV['ZANZIBAR_PASSWORD']
|
31
|
+
@@password = ENV['ZANZIBAR_PASSWORD']
|
27
32
|
else
|
28
33
|
@@password = prompt_for_password
|
29
34
|
end
|
35
|
+
|
30
36
|
if args[:domain]
|
31
37
|
@@domain = args[:domain]
|
32
38
|
else
|
@@ -36,6 +42,14 @@ module Zanzibar
|
|
36
42
|
init_client(args[:globals])
|
37
43
|
end
|
38
44
|
|
45
|
+
def get_client_username
|
46
|
+
@@username
|
47
|
+
end
|
48
|
+
|
49
|
+
def get_client_password
|
50
|
+
@@password
|
51
|
+
end
|
52
|
+
|
39
53
|
## Initializes the Savon client class variable with the wdsl document location and optional global variables
|
40
54
|
# @param globals{}, optional
|
41
55
|
|
data/lib/zanzibar/version.rb
CHANGED
data/spec/zanzibar_spec.rb
CHANGED
@@ -110,4 +110,14 @@ describe 'Zanzibar Test' do
|
|
110
110
|
expect(File.read('attachment.txt')).to eq("I am a secret attachment\n")
|
111
111
|
File.delete('attachment.txt')
|
112
112
|
end
|
113
|
+
|
114
|
+
it 'should use environment variables for credentials' do
|
115
|
+
ENV['ZANZIBAR_USER'] = "environment_user"
|
116
|
+
ENV['ZANZIBAR_PASSWORD'] = "environment_password"
|
117
|
+
client = Zanzibar::Zanzibar.new(domain: 'zanzitest.net', wsdl: 'spec/scrt.wsdl')
|
118
|
+
expect(client.get_client_username).to eq(ENV['ZANZIBAR_USER'])
|
119
|
+
expect(client.get_client_password).to eq(ENV['ZANZIBAR_PASSWORD'])
|
120
|
+
ENV.delete 'ZANZIBAR_PASSWORD'
|
121
|
+
ENV.delete 'ZANZIBAR_USER'
|
122
|
+
end
|
113
123
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zanzibar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Davis-Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyntlm
|