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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzFjZThiODZlNmZhYWZmYzczNTQ0MjVmNzQzMDk5YmU2MGJiZTBmMg==
4
+ NDRjYjhkOGQwYTY1OGUzMDYzNGM1YWQ2YzI5YjI0YzE1ZGY5MWFmNg==
5
5
  data.tar.gz: !binary |-
6
- MDZhZWU3NWI4ODdkNmJjNmE4MDA1ZjQ5YjExOTRhOWEzYWQxZTZjYQ==
6
+ ZWUxNDgyMjg0Njg5MmJkMzcwOTU0NzEwNjRjYTkzZGJiYjM3YmQ4ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWI4OGI5YjA0OTk0OGQxMDg5MjYzMjk5MzJlYzUxOTJkN2RiZGZjMjEzZmI0
10
- OTA0ZjZlNThiYWU3N2UwOTUzMmRlMDU4YTg2NTZjNWIxMzdlYjFiNjgxNzRj
11
- OGYxMmE2YzA3ZDE1NWE3M2RmNTZlNzM1ZDM3NjY0YThjNTE5OGU=
9
+ ZWIwMjY0NTY1ZGFhYjNmZmQxZWRiMGI2Yzc1MTkxZTI5MmZjYzcyMmY0M2Y3
10
+ M2Y0Mzc3NjA5NDljNTMxN2FkYmY5MjUyZDM2MDBlZTVlYzVjZGEzMTM1YmY4
11
+ ODI5ZDM0M2ZjNTllZTJmYjE2MWQ1NGVlNGI3MmQ5Y2EwNzdkNGY=
12
12
  data.tar.gz: !binary |-
13
- ODc0NmRkMjUyZDg0NjAzOGU0YWM5MTA1ZjE3YjMxOTRiNGZhZWZhY2VmOTI5
14
- ZDlkYzFlNDQ1MDY0ZjNlYTQ3YTViNjQ2NWU1MjEyYWIxMzMwZGY2MDExZDhj
15
- NTdkZDJlYmI0MjllODk1YmM1NTgwMmY4MjkxZDc2YTQ3ZjFjZTc=
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
 
@@ -1,3 +1,3 @@
1
1
  module Zanzibar
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.13'
3
3
  end
@@ -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.12
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-27 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyntlm