baruwa 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8dfcc923c408765ad8b2c312984886b6e9037c46
4
+ data.tar.gz: 137c8da341fe1acff572aeea571df60160a4f9e7
5
+ SHA512:
6
+ metadata.gz: 54901c5a3e69115997722eddbd93b273c5bf027e1bf81ee15bd8f246e8140cf2b73d39e2a079368c6007a16659da2ab60471268bf0647ce6b3a12c57e6ece886
7
+ data.tar.gz: b9d7af783fc271dfa95306f831076fbd64565ebad8a77eec4919f747e17d6c4da9b4e08a2e6d8b2569cf8b663442aeeb268ef72ea2c000b99f108cf0541ac7dc
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.9.2"
4
3
  - "1.9.3"
5
4
  - "2.0.0"
6
5
  - "2.1.4"
data/lib/baruwa.rb CHANGED
@@ -8,6 +8,7 @@
8
8
  # You can obtain one at http://mozilla.org/MPL/2.0/.
9
9
  require "cgi"
10
10
  require "json"
11
+ require "openssl"
11
12
  require "net/http"
12
13
 
13
14
  require "baruwa/version"
@@ -84,6 +85,13 @@ class BaruwaAPI
84
85
  :update => {:name => '/relays/%s', :method => :put},
85
86
  :delete => {:name => '/relays/%s', :method => :delete}
86
87
  },
88
+ :fallbackservers => {
89
+ :list => {:name => '/fallbackservers/list/%s', :method => :get},
90
+ :new => {:name => '/fallbackservers/%s', :method => :post},
91
+ :get => {:name => '/fallbackservers/%s', :method => :get},
92
+ :update => {:name => '/fallbackservers/%s', :method => :put},
93
+ :delete => {:name => '/fallbackservers/%s', :method => :delete}
94
+ },
87
95
  :status => {:name => '/status', :method => :get}
88
96
  }
89
97
  def initialize (url, token, ssl_verify=false)
@@ -332,6 +340,31 @@ class BaruwaAPI
332
340
  call_api(ENDPOINTS[:relays][:delete], [relayid], data)
333
341
  end
334
342
 
343
+ def get_fallbackservers(orgid)
344
+ # get fallback servers
345
+ call_api(ENDPOINTS[:fallbackservers][:list], [orgid])
346
+ end
347
+
348
+ def get_fallbackserver(serverid)
349
+ # get fallback server
350
+ call_api(ENDPOINTS[:fallbackservers][:get], [serverid])
351
+ end
352
+
353
+ def create_fallbackserver(orgid, data)
354
+ # create a fallback server
355
+ call_api(ENDPOINTS[:fallbackservers][:new], [orgid], data)
356
+ end
357
+
358
+ def update_fallbackserver(serverid, data)
359
+ # update a fallback server
360
+ call_api(ENDPOINTS[:fallbackservers][:update], [serverid], data)
361
+ end
362
+
363
+ def delete_fallbackserver(serverid, data)
364
+ # delete a fallback server
365
+ call_api(ENDPOINTS[:fallbackservers][:delete], [serverid], data)
366
+ end
367
+
335
368
  def get_status
336
369
  # get status
337
370
  call_api(ENDPOINTS[:status])
@@ -360,7 +393,6 @@ class BaruwaAPI
360
393
 
361
394
  def set_headers
362
395
  {
363
- 'Content-Type' =>'application/json',
364
396
  'User-Agent' => 'BaruwaAPI-Ruby',
365
397
  'Authorization' => "Bearer #{@baruwa_token}"
366
398
  }
@@ -383,7 +415,7 @@ class BaruwaAPI
383
415
 
384
416
  def parse_response(response)
385
417
  if response.code.to_i == 200 || response.code.to_i == 201
386
- if response.body.nil? || response.body.blank?
418
+ if response.body.nil? || response.body.empty?
387
419
  {:code => response.code.to_i, :message => "Completed successfully"}
388
420
  else
389
421
  JSON.parse(response.body)
@@ -7,5 +7,5 @@
7
7
  # License, v. 2.0. If a copy of the MPL was not distributed with this file,
8
8
  # You can obtain one at http://mozilla.org/MPL/2.0/.
9
9
  module Baruwa
10
- VERSION = "0.0.3"
10
+ VERSION = "0.0.4"
11
11
  end
@@ -14,7 +14,6 @@ describe 'Test Aliases' do
14
14
  stub_request(:get, "https://testbaruwa.com/api/v1/aliasaddresses/#{addressid}").
15
15
  with(:body => false,
16
16
  :headers => {'Accept'=>'*/*',
17
- 'Content-Type'=>'application/json',
18
17
  'User-Agent'=>'BaruwaAPI-Ruby',
19
18
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
20
19
  to_return(:status => 200, :body => "", :headers => {})
@@ -27,7 +26,6 @@ describe 'Test Aliases' do
27
26
  stub_request(:post, "https://testbaruwa.com/api/v1/aliasaddresses/#{addressid}").
28
27
  with(:body => {},
29
28
  :headers => {'Accept'=>'*/*',
30
- 'Content-Type'=>'application/json',
31
29
  'User-Agent'=>'BaruwaAPI-Ruby',
32
30
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
33
31
  to_return(:status => 200, :body => "", :headers => {})
@@ -40,7 +38,6 @@ describe 'Test Aliases' do
40
38
  stub_request(:put, "https://testbaruwa.com/api/v1/aliasaddresses/#{addressid}").
41
39
  with(:body => {},
42
40
  :headers => {'Accept'=>'*/*',
43
- 'Content-Type'=>'application/json',
44
41
  'User-Agent'=>'BaruwaAPI-Ruby',
45
42
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
46
43
  to_return(:status => 200, :body => "", :headers => {})
@@ -53,7 +50,6 @@ describe 'Test Aliases' do
53
50
  stub_request(:delete, "https://testbaruwa.com/api/v1/aliasaddresses/#{addressid}").
54
51
  with(:body => {},
55
52
  :headers => {'Accept'=>'*/*',
56
- 'Content-Type'=>'application/json',
57
53
  'User-Agent'=>'BaruwaAPI-Ruby',
58
54
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
59
55
  to_return(:status => 200, :body => "", :headers => {})
@@ -14,7 +14,6 @@ describe 'Test Authentication Settings' do
14
14
  stub_request(:get, "https://testbaruwa.com/api/v1/authservers/#{domainid}").
15
15
  with(:body => false,
16
16
  :headers => {'Accept'=>'*/*',
17
- 'Content-Type'=>'application/json',
18
17
  'User-Agent'=>'BaruwaAPI-Ruby',
19
18
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
20
19
  to_return(:status => 200, :body => "", :headers => {})
@@ -28,7 +27,6 @@ describe 'Test Authentication Settings' do
28
27
  stub_request(:get, "https://testbaruwa.com/api/v1/authservers/#{domainid}/#{serverid}").
29
28
  with(:body => false,
30
29
  :headers => {'Accept'=>'*/*',
31
- 'Content-Type'=>'application/json',
32
30
  'User-Agent'=>'BaruwaAPI-Ruby',
33
31
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
34
32
  to_return(:status => 200, :body => "", :headers => {})
@@ -41,7 +39,6 @@ describe 'Test Authentication Settings' do
41
39
  stub_request(:post, "https://testbaruwa.com/api/v1/authservers/#{domainid}").
42
40
  with(:body => {},
43
41
  :headers => {'Accept'=>'*/*',
44
- 'Content-Type'=>'application/json',
45
42
  'User-Agent'=>'BaruwaAPI-Ruby',
46
43
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
47
44
  to_return(:status => 200, :body => "", :headers => {})
@@ -55,7 +52,6 @@ describe 'Test Authentication Settings' do
55
52
  stub_request(:put, "https://testbaruwa.com/api/v1/authservers/#{domainid}/#{serverid}").
56
53
  with(:body => {},
57
54
  :headers => {'Accept'=>'*/*',
58
- 'Content-Type'=>'application/json',
59
55
  'User-Agent'=>'BaruwaAPI-Ruby',
60
56
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
61
57
  to_return(:status => 200, :body => "", :headers => {})
@@ -69,7 +65,6 @@ describe 'Test Authentication Settings' do
69
65
  stub_request(:delete, "https://testbaruwa.com/api/v1/authservers/#{domainid}/#{serverid}").
70
66
  with(:body => {},
71
67
  :headers => {'Accept'=>'*/*',
72
- 'Content-Type'=>'application/json',
73
68
  'User-Agent'=>'BaruwaAPI-Ruby',
74
69
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
75
70
  to_return(:status => 200, :body => "", :headers => {})
@@ -14,7 +14,6 @@ describe 'Test Delivery servers' do
14
14
  stub_request(:get, "https://testbaruwa.com/api/v1/deliveryservers/#{domainid}").
15
15
  with(:body => false,
16
16
  :headers => {'Accept'=>'*/*',
17
- 'Content-Type'=>'application/json',
18
17
  'User-Agent'=>'BaruwaAPI-Ruby',
19
18
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
20
19
  to_return(:status => 200, :body => "", :headers => {})
@@ -28,7 +27,6 @@ describe 'Test Delivery servers' do
28
27
  stub_request(:get, "https://testbaruwa.com/api/v1/deliveryservers/#{domainid}/#{serverid}").
29
28
  with(:body => false,
30
29
  :headers => {'Accept'=>'*/*',
31
- 'Content-Type'=>'application/json',
32
30
  'User-Agent'=>'BaruwaAPI-Ruby',
33
31
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
34
32
  to_return(:status => 200, :body => "", :headers => {})
@@ -41,7 +39,6 @@ describe 'Test Delivery servers' do
41
39
  stub_request(:post, "https://testbaruwa.com/api/v1/deliveryservers/#{domainid}").
42
40
  with(:body => {},
43
41
  :headers => {'Accept'=>'*/*',
44
- 'Content-Type'=>'application/json',
45
42
  'User-Agent'=>'BaruwaAPI-Ruby',
46
43
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
47
44
  to_return(:status => 200, :body => "", :headers => {})
@@ -55,7 +52,6 @@ describe 'Test Delivery servers' do
55
52
  stub_request(:put, "https://testbaruwa.com/api/v1/deliveryservers/#{domainid}/#{serverid}").
56
53
  with(:body => {},
57
54
  :headers => {'Accept'=>'*/*',
58
- 'Content-Type'=>'application/json',
59
55
  'User-Agent'=>'BaruwaAPI-Ruby',
60
56
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
61
57
  to_return(:status => 200, :body => "", :headers => {})
@@ -69,7 +65,6 @@ describe 'Test Delivery servers' do
69
65
  stub_request(:delete, "https://testbaruwa.com/api/v1/deliveryservers/#{domainid}/#{serverid}").
70
66
  with(:body => {},
71
67
  :headers => {'Accept'=>'*/*',
72
- 'Content-Type'=>'application/json',
73
68
  'User-Agent'=>'BaruwaAPI-Ruby',
74
69
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
75
70
  to_return(:status => 200, :body => "", :headers => {})
@@ -14,7 +14,6 @@ describe 'Test Domain Aliases' do
14
14
  stub_request(:get, "https://testbaruwa.com/api/v1/domainaliases/#{domainid}").
15
15
  with(:body => false,
16
16
  :headers => {'Accept'=>'*/*',
17
- 'Content-Type'=>'application/json',
18
17
  'User-Agent'=>'BaruwaAPI-Ruby',
19
18
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
20
19
  to_return(:status => 200, :body => "", :headers => {})
@@ -28,7 +27,6 @@ describe 'Test Domain Aliases' do
28
27
  stub_request(:get, "https://testbaruwa.com/api/v1/domainaliases/#{domainid}/#{aliasid}").
29
28
  with(:body => false,
30
29
  :headers => {'Accept'=>'*/*',
31
- 'Content-Type'=>'application/json',
32
30
  'User-Agent'=>'BaruwaAPI-Ruby',
33
31
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
34
32
  to_return(:status => 200, :body => "", :headers => {})
@@ -41,7 +39,6 @@ describe 'Test Domain Aliases' do
41
39
  stub_request(:post, "https://testbaruwa.com/api/v1/domainaliases/#{domainid}").
42
40
  with(:body => {},
43
41
  :headers => {'Accept'=>'*/*',
44
- 'Content-Type'=>'application/json',
45
42
  'User-Agent'=>'BaruwaAPI-Ruby',
46
43
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
47
44
  to_return(:status => 200, :body => "", :headers => {})
@@ -55,7 +52,6 @@ describe 'Test Domain Aliases' do
55
52
  stub_request(:put, "https://testbaruwa.com/api/v1/domainaliases/#{domainid}/#{aliasid}").
56
53
  with(:body => {},
57
54
  :headers => {'Accept'=>'*/*',
58
- 'Content-Type'=>'application/json',
59
55
  'User-Agent'=>'BaruwaAPI-Ruby',
60
56
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
61
57
  to_return(:status => 200, :body => "", :headers => {})
@@ -69,7 +65,6 @@ describe 'Test Domain Aliases' do
69
65
  stub_request(:delete, "https://testbaruwa.com/api/v1/domainaliases/#{domainid}/#{aliasid}").
70
66
  with(:body => {},
71
67
  :headers => {'Accept'=>'*/*',
72
- 'Content-Type'=>'application/json',
73
68
  'User-Agent'=>'BaruwaAPI-Ruby',
74
69
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
75
70
  to_return(:status => 200, :body => "", :headers => {})
@@ -33,7 +33,6 @@ describe 'Test Domains' do
33
33
  stub_request(:get, "https://testbaruwa.com/api/v1/domains").
34
34
  with(:body => false,
35
35
  :headers => {'Accept'=>'*/*',
36
- 'Content-Type'=>'application/json',
37
36
  'User-Agent'=>'BaruwaAPI-Ruby',
38
37
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
39
38
  to_return(:status => 200, :body => "", :headers => {})
@@ -46,7 +45,6 @@ describe 'Test Domains' do
46
45
  stub_request(:get, "https://testbaruwa.com/api/v1/domains/#{domainid}").
47
46
  with(:body => false,
48
47
  :headers => {'Accept'=>'*/*',
49
- 'Content-Type'=>'application/json',
50
48
  'User-Agent'=>'BaruwaAPI-Ruby',
51
49
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
52
50
  to_return(:status => 200, :body => "", :headers => {})
@@ -59,7 +57,6 @@ describe 'Test Domains' do
59
57
  stub_request(:get, "https://testbaruwa.com/api/v1/domains/byname/#{domain_name}").
60
58
  with(:body => false,
61
59
  :headers => {'Accept'=>'*/*',
62
- 'Content-Type'=>'application/json',
63
60
  'User-Agent'=>'BaruwaAPI-Ruby',
64
61
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
65
62
  to_return(:status => 200, :body => "", :headers => {})
@@ -71,7 +68,6 @@ describe 'Test Domains' do
71
68
  stub_request(:post, "https://testbaruwa.com/api/v1/domains").
72
69
  with(:body => @baruwapi.get_params(dom),
73
70
  :headers => {'Accept'=>'*/*',
74
- 'Content-Type'=>'application/json',
75
71
  'User-Agent'=>'BaruwaAPI-Ruby',
76
72
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
77
73
  to_return(:status => 200, :body => "", :headers => {})
@@ -84,7 +80,6 @@ describe 'Test Domains' do
84
80
  stub_request(:put, "https://testbaruwa.com/api/v1/domains/#{domainid}").
85
81
  with(:body => @baruwapi.get_params(dom),
86
82
  :headers => {'Accept'=>'*/*',
87
- 'Content-Type'=>'application/json',
88
83
  'User-Agent'=>'BaruwaAPI-Ruby',
89
84
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
90
85
  to_return(:status => 200, :body => "", :headers => {})
@@ -97,7 +92,6 @@ describe 'Test Domains' do
97
92
  stub_request(:delete, "https://testbaruwa.com/api/v1/domains/#{domainid}").
98
93
  with(:body => false,
99
94
  :headers => {'Accept'=>'*/*',
100
- 'Content-Type'=>'application/json',
101
95
  'User-Agent'=>'BaruwaAPI-Ruby',
102
96
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
103
97
  to_return(:status => 200, :body => "", :headers => {})
@@ -0,0 +1,71 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Test Fallback servers' do
4
+ before(:each) do
5
+ WebMock.reset!
6
+ end
7
+
8
+ before do
9
+ @baruwapi = BaruwaAPI.new('https://testbaruwa.com', '6e2347bc-278e-42f6-a84b-fa1766140cbd')
10
+ end
11
+
12
+ it 'should get Fallback servers' do
13
+ orgid = 10
14
+ stub_request(:get, "https://testbaruwa.com/api/v1/fallbackservers/list/#{orgid}").
15
+ with(:body => false,
16
+ :headers => {'Accept'=>'*/*',
17
+ 'User-Agent'=>'BaruwaAPI-Ruby',
18
+ 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
19
+ to_return(:status => 200, :body => "", :headers => {})
20
+ @baruwapi.get_fallbackservers(orgid)
21
+ expect(WebMock).to have_requested(:get, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/fallbackservers/list/#{orgid}")
22
+ end
23
+
24
+ it 'should get a Fallback server' do
25
+ serverid = 10
26
+ stub_request(:get, "https://testbaruwa.com/api/v1/fallbackservers/#{serverid}").
27
+ with(:body => false,
28
+ :headers => {'Accept'=>'*/*',
29
+ 'User-Agent'=>'BaruwaAPI-Ruby',
30
+ 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
31
+ to_return(:status => 200, :body => "", :headers => {})
32
+ @baruwapi.get_fallbackserver(serverid)
33
+ expect(WebMock).to have_requested(:get, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/fallbackservers/#{serverid}")
34
+ end
35
+
36
+ it 'should create a Fallback server' do
37
+ orgid = 10
38
+ stub_request(:post, "https://testbaruwa.com/api/v1/fallbackservers/#{orgid}").
39
+ with(:body => {},
40
+ :headers => {'Accept'=>'*/*',
41
+ 'User-Agent'=>'BaruwaAPI-Ruby',
42
+ 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
43
+ to_return(:status => 200, :body => "", :headers => {})
44
+ @baruwapi.create_fallbackserver(orgid, {})
45
+ expect(WebMock).to have_requested(:post, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/fallbackservers/#{orgid}")
46
+ end
47
+
48
+ it 'should update a Fallback server' do
49
+ serverid = 10
50
+ stub_request(:put, "https://testbaruwa.com/api/v1/fallbackservers/#{serverid}").
51
+ with(:body => {},
52
+ :headers => {'Accept'=>'*/*',
53
+ 'User-Agent'=>'BaruwaAPI-Ruby',
54
+ 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
55
+ to_return(:status => 200, :body => "", :headers => {})
56
+ @baruwapi.update_fallbackserver(serverid, {})
57
+ expect(WebMock).to have_requested(:put, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/fallbackservers/#{serverid}")
58
+ end
59
+
60
+ it 'should delete a Fallback server' do
61
+ serverid = 10
62
+ stub_request(:delete, "https://testbaruwa.com/api/v1/fallbackservers/#{serverid}").
63
+ with(:body => {},
64
+ :headers => {'Accept'=>'*/*',
65
+ 'User-Agent'=>'BaruwaAPI-Ruby',
66
+ 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
67
+ to_return(:status => 200, :body => "", :headers => {})
68
+ @baruwapi.delete_fallbackserver(serverid, {})
69
+ expect(WebMock).to have_requested(:delete, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/fallbackservers/#{serverid}")
70
+ end
71
+ end
@@ -14,7 +14,6 @@ describe 'Test Exceptions' do
14
14
  stub_request(:get, "https://testbaruwa.com/api/v1/status").
15
15
  with(:body => false,
16
16
  :headers => {'Accept'=>'*/*',
17
- 'Content-Type'=>'application/json',
18
17
  'User-Agent'=>'BaruwaAPI-Ruby',
19
18
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
20
19
  to_return(:status => 500, :body => "", :headers => {})
@@ -16,7 +16,6 @@ describe 'Test AD/LDAP Settings' do
16
16
  stub_request(:get, "https://testbaruwa.com/api/v1/ldapsettings/#{domainid}/#{serverid}/#{settingsid}").
17
17
  with(:body => false,
18
18
  :headers => {'Accept'=>'*/*',
19
- 'Content-Type'=>'application/json',
20
19
  'User-Agent'=>'BaruwaAPI-Ruby',
21
20
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
22
21
  to_return(:status => 200, :body => "", :headers => {})
@@ -30,7 +29,6 @@ describe 'Test AD/LDAP Settings' do
30
29
  stub_request(:post, "https://testbaruwa.com/api/v1/ldapsettings/#{domainid}/#{serverid}").
31
30
  with(:body => {},
32
31
  :headers => {'Accept'=>'*/*',
33
- 'Content-Type'=>'application/json',
34
32
  'User-Agent'=>'BaruwaAPI-Ruby',
35
33
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
36
34
  to_return(:status => 200, :body => "", :headers => {})
@@ -45,7 +43,6 @@ describe 'Test AD/LDAP Settings' do
45
43
  stub_request(:put, "https://testbaruwa.com/api/v1/ldapsettings/#{domainid}/#{serverid}/#{settingsid}").
46
44
  with(:body => {},
47
45
  :headers => {'Accept'=>'*/*',
48
- 'Content-Type'=>'application/json',
49
46
  'User-Agent'=>'BaruwaAPI-Ruby',
50
47
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
51
48
  to_return(:status => 200, :body => "", :headers => {})
@@ -60,7 +57,6 @@ describe 'Test AD/LDAP Settings' do
60
57
  stub_request(:delete, "https://testbaruwa.com/api/v1/ldapsettings/#{domainid}/#{serverid}/#{settingsid}").
61
58
  with(:body => {},
62
59
  :headers => {'Accept'=>'*/*',
63
- 'Content-Type'=>'application/json',
64
60
  'User-Agent'=>'BaruwaAPI-Ruby',
65
61
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
66
62
  to_return(:status => 200, :body => "", :headers => {})
@@ -13,7 +13,6 @@ describe 'Test Organizations' do
13
13
  stub_request(:get, "https://testbaruwa.com/api/v1/organizations").
14
14
  with(:body => false,
15
15
  :headers => {'Accept'=>'*/*',
16
- 'Content-Type'=>'application/json',
17
16
  'User-Agent'=>'BaruwaAPI-Ruby',
18
17
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
19
18
  to_return(:status => 200, :body => "", :headers => {})
@@ -26,7 +25,6 @@ describe 'Test Organizations' do
26
25
  stub_request(:get, "https://testbaruwa.com/api/v1/organizations/#{orgid}").
27
26
  with(:body => false,
28
27
  :headers => {'Accept'=>'*/*',
29
- 'Content-Type'=>'application/json',
30
28
  'User-Agent'=>'BaruwaAPI-Ruby',
31
29
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
32
30
  to_return(:status => 200, :body => "", :headers => {})
@@ -38,7 +36,6 @@ describe 'Test Organizations' do
38
36
  stub_request(:post, "https://testbaruwa.com/api/v1/organizations").
39
37
  with(:body => {},
40
38
  :headers => {'Accept'=>'*/*',
41
- 'Content-Type'=>'application/json',
42
39
  'User-Agent'=>'BaruwaAPI-Ruby',
43
40
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
44
41
  to_return(:status => 200, :body => "", :headers => {})
@@ -51,7 +48,6 @@ describe 'Test Organizations' do
51
48
  stub_request(:put, "https://testbaruwa.com/api/v1/organizations/#{orgid}").
52
49
  with(:body => {},
53
50
  :headers => {'Accept'=>'*/*',
54
- 'Content-Type'=>'application/json',
55
51
  'User-Agent'=>'BaruwaAPI-Ruby',
56
52
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
57
53
  to_return(:status => 200, :body => "", :headers => {})
@@ -64,7 +60,6 @@ describe 'Test Organizations' do
64
60
  stub_request(:delete, "https://testbaruwa.com/api/v1/organizations/#{orgid}").
65
61
  with(:body => false,
66
62
  :headers => {'Accept'=>'*/*',
67
- 'Content-Type'=>'application/json',
68
63
  'User-Agent'=>'BaruwaAPI-Ruby',
69
64
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
70
65
  to_return(:status => 200, :body => "", :headers => {})
@@ -16,7 +16,6 @@ describe 'Test RADIUS Settings' do
16
16
  stub_request(:get, "https://testbaruwa.com/api/v1/radiussettings/#{domainid}/#{serverid}/#{settingsid}").
17
17
  with(:body => false,
18
18
  :headers => {'Accept'=>'*/*',
19
- 'Content-Type'=>'application/json',
20
19
  'User-Agent'=>'BaruwaAPI-Ruby',
21
20
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
22
21
  to_return(:status => 200, :body => "", :headers => {})
@@ -30,7 +29,6 @@ describe 'Test RADIUS Settings' do
30
29
  stub_request(:post, "https://testbaruwa.com/api/v1/radiussettings/#{domainid}/#{serverid}").
31
30
  with(:body => {},
32
31
  :headers => {'Accept'=>'*/*',
33
- 'Content-Type'=>'application/json',
34
32
  'User-Agent'=>'BaruwaAPI-Ruby',
35
33
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
36
34
  to_return(:status => 200, :body => "", :headers => {})
@@ -45,7 +43,6 @@ describe 'Test RADIUS Settings' do
45
43
  stub_request(:put, "https://testbaruwa.com/api/v1/radiussettings/#{domainid}/#{serverid}/#{settingsid}").
46
44
  with(:body => {},
47
45
  :headers => {'Accept'=>'*/*',
48
- 'Content-Type'=>'application/json',
49
46
  'User-Agent'=>'BaruwaAPI-Ruby',
50
47
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
51
48
  to_return(:status => 200, :body => "", :headers => {})
@@ -60,7 +57,6 @@ describe 'Test RADIUS Settings' do
60
57
  stub_request(:delete, "https://testbaruwa.com/api/v1/radiussettings/#{domainid}/#{serverid}/#{settingsid}").
61
58
  with(:body => {},
62
59
  :headers => {'Accept'=>'*/*',
63
- 'Content-Type'=>'application/json',
64
60
  'User-Agent'=>'BaruwaAPI-Ruby',
65
61
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
66
62
  to_return(:status => 200, :body => "", :headers => {})
@@ -14,7 +14,6 @@ describe 'Test Relays' do
14
14
  stub_request(:get, "https://testbaruwa.com/api/v1/relays/#{relayid}").
15
15
  with(:body => false,
16
16
  :headers => {'Accept'=>'*/*',
17
- 'Content-Type'=>'application/json',
18
17
  'User-Agent'=>'BaruwaAPI-Ruby',
19
18
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
20
19
  to_return(:status => 200, :body => "", :headers => {})
@@ -27,7 +26,6 @@ describe 'Test Relays' do
27
26
  stub_request(:post, "https://testbaruwa.com/api/v1/relays/#{orgid}").
28
27
  with(:body => {},
29
28
  :headers => {'Accept'=>'*/*',
30
- 'Content-Type'=>'application/json',
31
29
  'User-Agent'=>'BaruwaAPI-Ruby',
32
30
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
33
31
  to_return(:status => 200, :body => "", :headers => {})
@@ -40,7 +38,6 @@ describe 'Test Relays' do
40
38
  stub_request(:put, "https://testbaruwa.com/api/v1/relays/#{relayid}").
41
39
  with(:body => {},
42
40
  :headers => {'Accept'=>'*/*',
43
- 'Content-Type'=>'application/json',
44
41
  'User-Agent'=>'BaruwaAPI-Ruby',
45
42
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
46
43
  to_return(:status => 200, :body => "", :headers => {})
@@ -53,7 +50,6 @@ describe 'Test Relays' do
53
50
  stub_request(:delete, "https://testbaruwa.com/api/v1/relays/#{relayid}").
54
51
  with(:body => {},
55
52
  :headers => {'Accept'=>'*/*',
56
- 'Content-Type'=>'application/json',
57
53
  'User-Agent'=>'BaruwaAPI-Ruby',
58
54
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
59
55
  to_return(:status => 200, :body => "", :headers => {})
@@ -13,7 +13,6 @@ describe 'Test System Status' do
13
13
  stub_request(:get, "https://testbaruwa.com/api/v1/status").
14
14
  with(:body => false,
15
15
  :headers => {'Accept'=>'*/*',
16
- 'Content-Type'=>'application/json',
17
16
  'User-Agent'=>'BaruwaAPI-Ruby',
18
17
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
19
18
  to_return(:status => 200, :body => "", :headers => {})
@@ -29,7 +29,6 @@ describe 'Test Users' do
29
29
  stub_request(:get, "https://testbaruwa.com/api/v1/users").
30
30
  with(:body => false,
31
31
  :headers => {'Accept'=>'*/*',
32
- 'Content-Type'=>'application/json',
33
32
  'User-Agent'=>'BaruwaAPI-Ruby',
34
33
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
35
34
  to_return(:status => 200, :body => "", :headers => {})
@@ -42,7 +41,6 @@ describe 'Test Users' do
42
41
  stub_request(:get, "https://testbaruwa.com/api/v1/users/#{userid}").
43
42
  with(:body => false,
44
43
  :headers => {'Accept'=>'*/*',
45
- 'Content-Type'=>'application/json',
46
44
  'User-Agent'=>'BaruwaAPI-Ruby',
47
45
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
48
46
  to_return(:status => 200, :body => "", :headers => {})
@@ -54,7 +52,6 @@ describe 'Test Users' do
54
52
  stub_request(:post, "https://testbaruwa.com/api/v1/users").
55
53
  with(:body => @baruwapi.get_params(user),
56
54
  :headers => {'Accept'=>'*/*',
57
- 'Content-Type'=>'application/json',
58
55
  'User-Agent'=>'BaruwaAPI-Ruby',
59
56
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
60
57
  to_return(:status => 200, :body => "", :headers => {})
@@ -66,7 +63,6 @@ describe 'Test Users' do
66
63
  stub_request(:put, "https://testbaruwa.com/api/v1/users").
67
64
  with(:body => @baruwapi.get_params(user),
68
65
  :headers => {'Accept'=>'*/*',
69
- 'Content-Type'=>'application/json',
70
66
  'User-Agent'=>'BaruwaAPI-Ruby',
71
67
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
72
68
  to_return(:status => 200, :body => "", :headers => {})
@@ -79,7 +75,6 @@ describe 'Test Users' do
79
75
  stub_request(:delete, "https://testbaruwa.com/api/v1/users/#{userid}").
80
76
  with(:body => false,
81
77
  :headers => {'Accept'=>'*/*',
82
- 'Content-Type'=>'application/json',
83
78
  'User-Agent'=>'BaruwaAPI-Ruby',
84
79
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
85
80
  to_return(:status => 200, :body => "", :headers => {})
@@ -94,7 +89,6 @@ describe 'Test Users' do
94
89
  stub_request(:post, "https://testbaruwa.com/api/v1/users/chpw/#{userid}").
95
90
  with(:body => @baruwapi.get_params(data),
96
91
  :headers => {'Accept'=>'*/*',
97
- 'Content-Type'=>'application/json',
98
92
  'User-Agent'=>'BaruwaAPI-Ruby',
99
93
  'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}).
100
94
  to_return(:status => 200, :body => "", :headers => {})
metadata CHANGED
@@ -1,87 +1,83 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: baruwa
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 3
9
- version: 0.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Andrew Colin Kissa
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2016-04-11 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: bundler
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 5
30
- version: "1.5"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
31
20
  type: :development
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: rake
35
21
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 10
42
- - 0
43
- version: "10.0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
44
34
  type: :development
45
- version_requirements: *id002
46
- - !ruby/object:Gem::Dependency
47
- name: rspec
48
35
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
50
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
51
45
  - - ">="
52
- - !ruby/object:Gem::Version
53
- segments:
54
- - 0
55
- version: "0"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
56
48
  type: :development
57
- version_requirements: *id003
58
- - !ruby/object:Gem::Dependency
59
- name: webmock
60
49
  prerelease: false
61
- requirement: &id004 !ruby/object:Gem::Requirement
62
- requirements:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
63
59
  - - ">="
64
- - !ruby/object:Gem::Version
65
- segments:
66
- - 0
67
- version: "0"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
68
62
  type: :development
69
- version_requirements: *id004
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
70
69
  description: Gem to access the Baruwa REST API in ruby and ruby on rails applications.
71
- email:
70
+ email:
72
71
  - andrew@topdog.za.net
73
72
  executables: []
74
-
75
73
  extensions: []
76
-
77
74
  extra_rdoc_files: []
78
-
79
- files:
80
- - .codeclimate.yml
81
- - .gitignore
82
- - .rspec
83
- - .rubocop.yml
84
- - .travis.yml
75
+ files:
76
+ - ".codeclimate.yml"
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".rubocop.yml"
80
+ - ".travis.yml"
85
81
  - Gemfile
86
82
  - LICENSE
87
83
  - README.md
@@ -94,6 +90,7 @@ files:
94
90
  - spec/baruwa_deliveryservers_spec.rb
95
91
  - spec/baruwa_domainalias_spec.rb
96
92
  - spec/baruwa_domains_spec.rb
93
+ - spec/baruwa_fallbackservers_spec.rb
97
94
  - spec/baruwa_incorrect_method_spec.rb
98
95
  - spec/baruwa_ldapsettings_spec.rb
99
96
  - spec/baruwa_organizations_spec.rb
@@ -102,42 +99,37 @@ files:
102
99
  - spec/baruwa_status_spec.rb
103
100
  - spec/baruwa_users_spec.rb
104
101
  - spec/spec_helper.rb
105
- has_rdoc: true
106
102
  homepage: https://github.com/akissa/baruwa-ruby
107
- licenses:
103
+ licenses:
108
104
  - MPL-2.0
105
+ metadata: {}
109
106
  post_install_message:
110
107
  rdoc_options: []
111
-
112
- require_paths:
108
+ require_paths:
113
109
  - lib
114
- required_ruby_version: !ruby/object:Gem::Requirement
115
- requirements:
110
+ required_ruby_version: !ruby/object:Gem::Requirement
111
+ requirements:
116
112
  - - ">="
117
- - !ruby/object:Gem::Version
118
- segments:
119
- - 0
120
- version: "0"
121
- required_rubygems_version: !ruby/object:Gem::Requirement
122
- requirements:
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
123
117
  - - ">="
124
- - !ruby/object:Gem::Version
125
- segments:
126
- - 0
127
- version: "0"
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
128
120
  requirements: []
129
-
130
121
  rubyforge_project: baruwa
131
- rubygems_version: 1.3.6
122
+ rubygems_version: 2.4.6
132
123
  signing_key:
133
- specification_version: 3
124
+ specification_version: 4
134
125
  summary: Ruby bindings for the Baruwa REST API
135
- test_files:
126
+ test_files:
136
127
  - spec/baruwa_alias_spec.rb
137
128
  - spec/baruwa_authservers_spec.rb
138
129
  - spec/baruwa_deliveryservers_spec.rb
139
130
  - spec/baruwa_domainalias_spec.rb
140
131
  - spec/baruwa_domains_spec.rb
132
+ - spec/baruwa_fallbackservers_spec.rb
141
133
  - spec/baruwa_incorrect_method_spec.rb
142
134
  - spec/baruwa_ldapsettings_spec.rb
143
135
  - spec/baruwa_organizations_spec.rb