osc_ruby 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9fb65f1ed0c87585e0a348ac30f615a64aea762
4
- data.tar.gz: c6f381d187177ff020f116945048d9fb06c1089b
3
+ metadata.gz: 4c7dd0579b731eb4a3d8ce7fbaac6a305a202e00
4
+ data.tar.gz: 545781e8fca36fa6824b5ad2857387ed4239a1a9
5
5
  SHA512:
6
- metadata.gz: 7ccf2ca1aa6b781bd5ba932471e76c4a2cccec8a4e1a426d189544ccafb665ba78d0a0cc72108901444efc76be039a5a76f3cb609d76848af48098b0a68b8b57
7
- data.tar.gz: 00c85030ccf6b442b0a63050060dde0748e8d43441def1f1bdb71498656d45874619137d86bf33ecc9dd95612b8764e608ace5481a256a77a725b798ec951f33
6
+ metadata.gz: 057334b04a1f44cec42354b230da28f9f2e826a61d20aaf657ee60789ab7046ef7f1c7a43f3020c80796448e24380a192aa823b85374a3a281a57e2865c9fea0
7
+ data.tar.gz: 45b2fefa8a5581fa216458bc965de4d270488c8c73e578d55b1653395c8ed8b99e3d33495b17dd60e4190e132e9ab8533b0231608f1c318dc152600f59891584
@@ -13,8 +13,10 @@ module OSCRuby
13
13
 
14
14
  if client.nil?
15
15
  raise ArgumentError, "Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings"
16
+ elsif !resource_url.nil?
17
+ @final_config = generate_url_and_config(client,resource_url)
16
18
  else
17
- @final_config = generate_url_and_config(client)
19
+ @final_config = generate_url_and_config(client,nil)
18
20
  end
19
21
 
20
22
  @uri = @final_config['site_url']
@@ -40,6 +42,10 @@ module OSCRuby
40
42
 
41
43
  @config = client.config
42
44
 
45
+ if !resource_url.nil?
46
+ @resource_url = resource_url
47
+ end
48
+
43
49
  @url = "https://" + @config.interface + ".custhelp.com/services/rest/connect/v1.3/#{resource_url}"
44
50
 
45
51
  @final_uri = URI(@url)
@@ -1,3 +1,3 @@
1
1
  module OSCRuby
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'core/spec_helper'
2
2
  require 'json'
3
+ require 'uri'
3
4
 
4
5
  describe OSCRuby::Connect do
5
6
 
@@ -31,6 +32,26 @@ describe OSCRuby::Connect do
31
32
  end.not_to raise_error
32
33
  end
33
34
 
35
+ it 'should take an optional resource_url parameter' do
36
+
37
+ expect do
38
+
39
+ OSCRuby::Connect.generate_url_and_config(client, 'accounts')
40
+
41
+ end.not_to raise_error
42
+ end
43
+
44
+ it 'should change the final configured url if the resource_url parameter is specified' do
45
+
46
+ test = OSCRuby::Connect.generate_url_and_config(client, 'accounts')
47
+
48
+ interface = client.config.interface
49
+
50
+ expect(test['site_url']).to eq(URI("https://#{interface}.custhelp.com/services/rest/connect/v1.3/accounts"))
51
+
52
+ expect(test['site_url']).to be_an(URI::HTTPS)
53
+ end
54
+
34
55
  it 'should raise an error if client is nil' do
35
56
 
36
57
  expect do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osc_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Davis