osc_ruby 0.0.6 → 0.0.7
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 +4 -4
- data/lib/osc_ruby/client.rb +15 -16
- data/lib/osc_ruby/version.rb +1 -1
- data/spec/core/client_spec.rb +12 -40
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eafbf5ea09a7a04457bf7dfa9598b3d8c9a5dd07
|
4
|
+
data.tar.gz: 6c5c755794d08cd99bc3473b4b1e97cf1111e14d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c06b40e74a4096f4284385d9fa8ebdbdd53c3f73d1558bd3804f00b7c7b21872886144ad9b1e4b4a080ddcf0ae314ed28e0ffa75e2b8d864ad68963784b048c1
|
7
|
+
data.tar.gz: f311c1559e87eeed8d6b2e2f4d26191ccce31df17a081173a6e08327899ec361d01786bff7132987ecee66fe80ca23e3b8d469732396ee3a25e53c4cf86ea027
|
data/lib/osc_ruby/client.rb
CHANGED
@@ -19,7 +19,7 @@ module OSCRuby
|
|
19
19
|
self.config ||= OSCRuby::Configuration.new
|
20
20
|
yield(config)
|
21
21
|
|
22
|
-
check_config
|
22
|
+
connect unless check_config == false
|
23
23
|
end
|
24
24
|
|
25
25
|
def check_config
|
@@ -30,27 +30,26 @@ module OSCRuby
|
|
30
30
|
elsif config.password ==''
|
31
31
|
raise ArgumentError, "Password cannot be nil or blank"
|
32
32
|
end
|
33
|
+
|
34
|
+
true
|
33
35
|
end
|
34
36
|
|
35
|
-
|
36
|
-
uri = URI.parse(self.service_cloud_interface)
|
37
|
-
end
|
37
|
+
# def connect
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
end
|
39
|
+
# url = 'https://' + config.interface + '.custhelp.com/services/rest/connect/v1.3/'
|
40
|
+
# uri = URI.parse(url)
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
# Net::HTTP.start(uri.host, uri.port,
|
43
|
+
# :use_ssl => true,
|
44
|
+
# :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|
|
46
45
|
|
47
|
-
|
48
|
-
|
46
|
+
# request = Net::HTTP::Get.new uri.request_uri
|
47
|
+
# request.basic_auth config.username, config.password
|
49
48
|
|
50
|
-
|
49
|
+
# response = http.request request # Net::HTTPResponse object
|
51
50
|
|
52
|
-
|
53
|
-
end
|
54
|
-
|
51
|
+
# json_response = JSON.parse(response.body)
|
52
|
+
# end
|
53
|
+
# end
|
55
54
|
end
|
56
55
|
end
|
data/lib/osc_ruby/version.rb
CHANGED
data/spec/core/client_spec.rb
CHANGED
@@ -56,45 +56,17 @@ describe OSCRuby::Client do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
context '#
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
client.service_cloud_interface.should eq('https://test.custhelp.com/services/rest/connect/v1.3/')
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
context '#basic_auth_url' do
|
74
|
-
it 'should produce a URI::HTTPS object' do
|
75
|
-
expect do
|
76
|
-
client = OSCRuby::Client.new do |config|
|
77
|
-
config.interface = 'test'
|
78
|
-
config.username = 'test_username'
|
79
|
-
config.password = 'test_password'
|
80
|
-
end
|
81
|
-
|
82
|
-
client.basic_auth_url.should_be a('URI::HTTPS')
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
59
|
+
# context '#connect' do
|
60
|
+
# it 'should produce a JSON Response' do
|
61
|
+
# expect do
|
62
|
+
# client = OSCRuby::Client.new do |config|
|
63
|
+
# config.interface = 'qsee--tst'
|
64
|
+
# config.username = ENV['OSC_ADMIN']
|
65
|
+
# config.password = ENV['OSC_PASSWORD']
|
66
|
+
# end
|
86
67
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
config.interface = 'qsee--tst'
|
92
|
-
config.username = ENV['OSC_ADMIN']
|
93
|
-
config.password = ENV['OSC_PASSWORD']
|
94
|
-
end
|
95
|
-
|
96
|
-
client.connect.should_be a('String')
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
68
|
+
# client.connect.should_be a('String')
|
69
|
+
# end
|
70
|
+
# end
|
71
|
+
# end
|
100
72
|
end
|