osc_ruby 0.0.3 → 0.0.4

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: 2a20e96bc8549eb785cb0a9a5a08d3b1a966e233
4
- data.tar.gz: 413bf471f58d094940ae9281c83e76d97eb6ad16
3
+ metadata.gz: 7b8d71f6076e1f7227e4677c44199d028aacec67
4
+ data.tar.gz: 1c8bab16bfce033bfa3610552fd6acfd0b52c965
5
5
  SHA512:
6
- metadata.gz: 3f35a963a4c697d9e367fcd154c8e89a1a2a3468e4e0b46e85dda47c716bfdcba13407aede4196b208e9ffd5a4fd225ac5e55bebd453885bfa8cd951da5d0e18
7
- data.tar.gz: 1911c9d8578a5dc4cc6752ede0b2119c1897d62994a799d58e23512c16257389baf5b21af7936c3d71371bc20518f1a9e36916a963d5f8b5270a114a5a4292db
6
+ metadata.gz: 6d45bd2c316d5f62078017f02f60e8bc4426c7d7ce7561a7579c7ba87b15b06f2679dd985a34cc3bbd18f47140cb48013fd172796c86bd0c203b5949b77a1454
7
+ data.tar.gz: 6de4026da3243b24b46f9174c980d2487ea13529b851356534620e4fbc0267da29dbd9236ed48125958d2e5b8f884e7e61d2f2440fbf0efc9fe131dcef725b13
@@ -1,4 +1,5 @@
1
1
  require 'net/http'
2
+ require 'openssl'
2
3
 
3
4
  require 'osc_ruby/version'
4
5
  require 'osc_ruby/configuration'
@@ -7,6 +8,9 @@ module OSCRuby
7
8
 
8
9
  class Client
9
10
  # The top-level class that handles configuration and connection to the Oracle Service Cloud REST API.
11
+
12
+ # @return [Configuration] Config instance
13
+ attr_reader :config
10
14
 
11
15
  def initialize
12
16
  raise ArgumentError, "block not given" unless block_given?
@@ -14,6 +18,10 @@ module OSCRuby
14
18
  @config = OSCRuby::Configuration.new
15
19
  yield config
16
20
 
21
+ uri = basic_auth(config)
22
+
23
+ connect(config,uri)
24
+
17
25
  end
18
26
 
19
27
  def basic_auth(config)
@@ -23,6 +31,19 @@ module OSCRuby
23
31
  def service_cloud_interface(config)
24
32
  @url = 'https://' + config.interface + '/services/rest/connect/v1.3/'
25
33
  end
26
-
34
+
35
+ def connect(config,uri)
36
+ Net::HTTP.start(uri.host, uri.port,
37
+ :use_ssl => uri.scheme == 'https') do |http|
38
+
39
+ request = Net::HTTP::Get.new uri.request_uri
40
+ request.basic_auth config.username, config.password
41
+
42
+ response = http.request request # Net::HTTPResponse object
43
+
44
+ puts response
45
+ puts response.body
46
+ end
47
+ end
27
48
  end
28
49
  end
@@ -13,5 +13,9 @@ module OSCRuby
13
13
 
14
14
  # @return [String] The resource that is being connected to .
15
15
  attr_accessor :resource
16
+
17
+ def initialize
18
+ @client_options = {}
19
+ end
16
20
  end
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module OSCRuby
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
Binary file
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Davis
@@ -70,6 +70,7 @@ files:
70
70
  - lib/osc_ruby/client.rb
71
71
  - lib/osc_ruby/configuration.rb
72
72
  - lib/osc_ruby/version.rb
73
+ - osc_ruby-0.0.3.gem
73
74
  - osc_ruby.gemspec
74
75
  - spec/core/client_spec.rb
75
76
  - spec/core/configuration_spec.rb