osc_ruby 0.0.1 → 0.0.3

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: c71ed2313fef7979c16500cc8242cb08afc542bd
4
- data.tar.gz: 41499e13be9dec3df7ac0f3e607162f43db00f0b
3
+ metadata.gz: 2a20e96bc8549eb785cb0a9a5a08d3b1a966e233
4
+ data.tar.gz: 413bf471f58d094940ae9281c83e76d97eb6ad16
5
5
  SHA512:
6
- metadata.gz: dba1306bb55a9d29c493d966573e50c128eb3d278af9a94159c5336f50f57e9bc6d53fe7dfe8649a7f6cfcbf569657b819aa5a3a8128255310cfbcce7960ad27
7
- data.tar.gz: 7c70278711a58c8eeb9f12f1b5ce09a3dbed47e7b67cf7af4f7c50cd6181c11a85b1a15ed688580851e2f690cdda2d7d752e3f8562e49eacee3fef68905c2796
6
+ metadata.gz: 3f35a963a4c697d9e367fcd154c8e89a1a2a3468e4e0b46e85dda47c716bfdcba13407aede4196b208e9ffd5a4fd225ac5e55bebd453885bfa8cd951da5d0e18
7
+ data.tar.gz: 1911c9d8578a5dc4cc6752ede0b2119c1897d62994a799d58e23512c16257389baf5b21af7936c3d71371bc20518f1a9e36916a963d5f8b5270a114a5a4292db
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
@@ -0,0 +1,28 @@
1
+ require 'net/http'
2
+
3
+ require 'osc_ruby/version'
4
+ require 'osc_ruby/configuration'
5
+
6
+ module OSCRuby
7
+
8
+ class Client
9
+ # The top-level class that handles configuration and connection to the Oracle Service Cloud REST API.
10
+
11
+ def initialize
12
+ raise ArgumentError, "block not given" unless block_given?
13
+
14
+ @config = OSCRuby::Configuration.new
15
+ yield config
16
+
17
+ end
18
+
19
+ def basic_auth(config)
20
+ uri = URI(service_cloud_interface(config))
21
+ end
22
+
23
+ def service_cloud_interface(config)
24
+ @url = 'https://' + config.interface + '/services/rest/connect/v1.3/'
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,17 @@
1
+ module OSCRuby
2
+ class Configuration
3
+ # takes config values for connecting to the REST API
4
+
5
+ # @return [String] The basic auth username.
6
+ attr_accessor :username
7
+
8
+ # @return [String] The basic auth password.
9
+ attr_accessor :password
10
+
11
+ # @return [String] The site interface to connect to.
12
+ attr_accessor :interface
13
+
14
+ # @return [String] The resource that is being connected to .
15
+ attr_accessor :resource
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
- module OscRuby
2
- VERSION = "0.0.1"
1
+ module OSCRuby
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/osc_ruby.rb CHANGED
@@ -1,5 +1,3 @@
1
- require "osc_ruby/version"
1
+ module OSCRuby; end
2
2
 
3
- module OscRuby
4
- # Your code goes here...
5
- end
3
+ require 'osc_ruby/client'
data/osc_ruby.gemspec CHANGED
@@ -5,12 +5,12 @@ require 'osc_ruby/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "osc_ruby"
8
- spec.version = OscRuby::VERSION
8
+ spec.version = OSCRuby::VERSION
9
9
  spec.authors = ["Rajan Davis"]
10
10
  spec.email = ["rajangdavis@gmail.com"]
11
11
  spec.summary = %q{Making the best of opensource and enterprise technology}
12
12
  spec.description = %q{An unofficial Ruby wrapper for the Oracle Cloud Services (fka RightNow Technologies) REST API}
13
- spec.homepage = ""
13
+ spec.homepage = %q{https://github.com/rajangdavis/osc_ruby}
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -20,4 +20,5 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency 'rspec'
23
24
  end
@@ -0,0 +1,35 @@
1
+ require 'core/spec_helper'
2
+
3
+ describe OSCRuby::Client do
4
+ subject { client }
5
+
6
+ context '#initialize' do
7
+ it 'should require a block' do
8
+ expect { OSCRuby::Client.new }.to raise_error(ArgumentError)
9
+ end
10
+
11
+ it 'should raise exception if interface is blank' do
12
+ expect do
13
+ OSCRuby::Client.new do |config|
14
+ config.interface = ''
15
+ end
16
+ end.to raise_error(NameError)
17
+ end
18
+
19
+ it 'should raise exception if username is blank' do
20
+ expect do
21
+ OSCRuby::Client.new do |config|
22
+ config.username = ''
23
+ end
24
+ end.to raise_error(NameError)
25
+ end
26
+
27
+ it 'should raise exception if password is blank' do
28
+ expect do
29
+ OSCRuby::Client.new do |config|
30
+ config.password = ''
31
+ end
32
+ end.to raise_error(NameError)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ require 'core/spec_helper'
2
+
3
+ describe OSCRuby::Configuration do
4
+ subject { OSCRuby::Configuration.new }
5
+ end
@@ -0,0 +1 @@
1
+ require 'osc_ruby'
data/tasks/rspec.rake ADDED
@@ -0,0 +1,3 @@
1
+ require 'rspec/core/rake_task'
2
+
3
+ RSpec::Core::RakeTask.new(:spec)
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.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajan Davis
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: An unofficial Ruby wrapper for the Oracle Cloud Services (fka RightNow
42
56
  Technologies) REST API
43
57
  email:
@@ -47,14 +61,21 @@ extensions: []
47
61
  extra_rdoc_files: []
48
62
  files:
49
63
  - ".gitignore"
64
+ - ".rspec"
50
65
  - Gemfile
51
66
  - LICENSE.txt
52
67
  - README.md
53
68
  - Rakefile
54
69
  - lib/osc_ruby.rb
70
+ - lib/osc_ruby/client.rb
71
+ - lib/osc_ruby/configuration.rb
55
72
  - lib/osc_ruby/version.rb
56
73
  - osc_ruby.gemspec
57
- homepage: ''
74
+ - spec/core/client_spec.rb
75
+ - spec/core/configuration_spec.rb
76
+ - spec/core/spec_helper.rb
77
+ - tasks/rspec.rake
78
+ homepage: https://github.com/rajangdavis/osc_ruby
58
79
  licenses:
59
80
  - MIT
60
81
  metadata: {}
@@ -78,4 +99,7 @@ rubygems_version: 2.6.8
78
99
  signing_key:
79
100
  specification_version: 4
80
101
  summary: Making the best of opensource and enterprise technology
81
- test_files: []
102
+ test_files:
103
+ - spec/core/client_spec.rb
104
+ - spec/core/configuration_spec.rb
105
+ - spec/core/spec_helper.rb