osc_ruby 1.3.2 → 1.4.0
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 +5 -5
- data/.gitignore +0 -1
- data/.travis.yml +2 -0
- data/Gemfile.lock +65 -0
- data/README.md +11 -7
- data/Rakefile +1 -1
- data/lib/osc_ruby/classes/query_results_set.rb +5 -6
- data/lib/osc_ruby/version.rb +1 -1
- data/osc_ruby.gemspec +1 -1
- data/spec/core/analytics_report_results_spec.rb +1 -1
- data/spec/core/query_results_set_spec.rb +3 -3
- data/spec/core/spec_helper.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d3befd00fc6195cab16ccef73d6809fc649e311a13ceccb258ed9ce9e6eac185
|
4
|
+
data.tar.gz: 4b05e0a96af0fa60bf9fbbb3369b389f86d630034e96a5625360ed9e57755d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02bc4af753950b70a25cb37e31ba06cfcd4c9d16d2f50ce74d1a9279451cc005111641ee03036d5da0488c5ddf18ca89dd7c9c9b6b9bcf5a1ee3c5d43ce57777
|
7
|
+
data.tar.gz: 98808cf54cce0667c90529b4546fe6e8b79a14dd3259581b5a470e0909c2e689a2bbbe8e8e26fc0b5f787df659ac9fdaf2b241d2332c2ee975600c520462bb82
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -5,6 +5,8 @@ addons:
|
|
5
5
|
code_climate:
|
6
6
|
repo_token:
|
7
7
|
secure: jhiFV5qK92z9GNZNgifvOmzoYmghcTFcuHYn21B5pkcIFmUJRYL03FK4QHqinFQ4BvjHnKlGTEgRPvglivvPBtIwpGMwuDF0oX0JHeTNLXuAXk8Dd6SAap+udSc2fOZYBg7H8PNmhSVpP97fYu23JsLmhRN8lnoO/yYyFUn/xUZIufOhpPj5RBMtR/XmxXiqS1tnsuHpSs7P+Kp/h6sr8QUOw1pJALEAqHGw2WmdxGrI76GQc0bylLFGMITkCbAiTxVQA3QnjLKFYCHq8zo1U0QZiW78+ubbV22oZS1EVATAb4SyqlqFd2bJA9wYjL2J4tYl1I+RvgVSspMsksHs72uIYHDTNSsEuQTnMCxtkq7WJLbYjRW3Tzbqn124ize/NmJqHcJ70Bc8Tzc3CkgEuJNF/cK266r0UkNTu+m65OTElyic14y+wCzeU8r/aDfX9vQKPBpOFpvHuoWMC54iiGIPjLVZb0AYvI2i3weK2dcCh7ZFD+FsFoMAzyaFFFJP4ANH7R08ewVpTjdud4O8WiQBJOW08dXE9inOF+4hqUho2FdrTWQLvMbanVXOmQXsODeEy7zxFUi1I1wVcX1AktEACmcX2ruose8UiScRu7Tr2R6mhgPa4UAf1YhhBClYafeqtCBi1rRrHkgOkaofhKbU3hHHF5cQwDP2v2jUYEI=
|
8
|
+
before_install:
|
9
|
+
- "gem install bundler"
|
8
10
|
script: bundle exec rake spec
|
9
11
|
after_success:
|
10
12
|
- bundle exec codeclimate-test-reporter
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
osc_ruby (1.3.2)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
addressable (2.5.2)
|
10
|
+
public_suffix (>= 2.0.2, < 4.0)
|
11
|
+
codeclimate-test-reporter (1.0.8)
|
12
|
+
simplecov (<= 0.13)
|
13
|
+
crack (0.4.3)
|
14
|
+
safe_yaml (~> 1.0.0)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
docile (1.1.5)
|
17
|
+
hashdiff (0.3.7)
|
18
|
+
json (2.1.0)
|
19
|
+
public_suffix (3.0.1)
|
20
|
+
rake (10.5.0)
|
21
|
+
rspec (3.7.0)
|
22
|
+
rspec-core (~> 3.7.0)
|
23
|
+
rspec-expectations (~> 3.7.0)
|
24
|
+
rspec-mocks (~> 3.7.0)
|
25
|
+
rspec-core (3.7.0)
|
26
|
+
rspec-support (~> 3.7.0)
|
27
|
+
rspec-expectations (3.7.0)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.7.0)
|
30
|
+
rspec-mocks (3.7.0)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.7.0)
|
33
|
+
rspec-support (3.7.0)
|
34
|
+
safe_yaml (1.0.4)
|
35
|
+
simplecov (0.13.0)
|
36
|
+
docile (~> 1.1.0)
|
37
|
+
json (>= 1.8, < 3)
|
38
|
+
simplecov-html (~> 0.10.0)
|
39
|
+
simplecov-html (0.10.2)
|
40
|
+
vcr (3.0.3)
|
41
|
+
webmock (3.1.0)
|
42
|
+
addressable (>= 2.3.6)
|
43
|
+
crack (>= 0.3.2)
|
44
|
+
hashdiff
|
45
|
+
yard (0.9.9)
|
46
|
+
|
47
|
+
PLATFORMS
|
48
|
+
ruby
|
49
|
+
x64-mingw32
|
50
|
+
x86-mingw32
|
51
|
+
x86_64-linux
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
bundler
|
55
|
+
codeclimate-test-reporter (~> 1.0, >= 1.0.0)
|
56
|
+
osc_ruby!
|
57
|
+
rake (~> 10.0)
|
58
|
+
rspec (~> 3.2, >= 3.2.0)
|
59
|
+
simplecov
|
60
|
+
vcr (~> 3.0, >= 3.0.3)
|
61
|
+
webmock
|
62
|
+
yard
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
1.16.0
|
data/README.md
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
# OSCRuby
|
2
|
-
|
3
|
-
[](https://codeclimate.com/github/rajangdavis/osc_ruby) [](https://codeclimate.com/github/rajangdavis/osc_ruby) [](https://codeclimate.com/github/rajangdavis/osc_ruby/test_coverage) [](https://travis-ci.org/rajangdavis/osc_ruby) [](https://badge.fury.io/rb/osc_ruby) [](https://snyk.io/test/github/rajangdavis/osc_ruby)
|
4
4
|
|
5
5
|
An (under development) Ruby library for using the [Oracle Service Cloud REST API](https://docs.oracle.com/cloud/latest/servicecs_gs/CXSVC/) influenced by the [ConnectPHP API](http://documentation.custhelp.com/euf/assets/devdocs/november2016/Connect_PHP/Default.htm) and ActiveRecord Gem
|
6
6
|
|
7
|
+
## Installing Ruby (for Windows)
|
8
|
+
[Try this link.](https://rubyinstaller.org/downloads/). I would highly recommend installing any version before 2.4 for Windows.
|
9
|
+
|
10
|
+
You will also need to install DevKit Tools which are located underneath the Ruby section
|
7
11
|
|
12
|
+
If you are using Windows 10, you can use your Linux Subsystem to work with Ruby; [here's instructions for how to do that.](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-and-set-up-a-local-programming-environment-on-windows-10)
|
13
|
+
|
14
|
+
If you get SSL Errors (you probably will), follow [this link for instructions on resolving SSL things that I know nothing about](https://stackoverflow.com/a/16134586/2548452).
|
15
|
+
|
8
16
|
## Compatibility
|
9
17
|
|
10
18
|
This gem was tested against Oracle Service Cloud November 2016 using Ruby version 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] between December 2016 and June 2017.
|
11
19
|
|
12
|
-
It is now being tested against Oracle Service Cloud May 2017 using Ruby version 2.
|
20
|
+
It is now being tested against Oracle Service Cloud May 2017 using Ruby version ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32] using [TravisCI](https://travis-ci.org/rajangdavis/osc_ruby) for continuous integration.
|
13
21
|
|
14
22
|
All of the HTTP methods should work on any version of Oracle Service Cloud since version May 2015; however, there maybe some issues with querying items on any version before May 2016. This is because ROQL queries were not exposed via the REST API until May 2016.
|
15
23
|
|
@@ -29,10 +37,6 @@ You can use this Ruby Library for basic scripting and microservices. The main fe
|
|
29
37
|
3. [Update => Patch](#update)
|
30
38
|
4. [Destroy => Delete](#delete)
|
31
39
|
|
32
|
-
## Installing Ruby
|
33
|
-
[Try this link.](https://bitnami.com/stack/ruby/installer)
|
34
|
-
|
35
|
-
If you get SSL Errors (you probably will), follow [this link for instructions on resolving SSL things that I know nothing about](http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages).
|
36
40
|
|
37
41
|
## Installation
|
38
42
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
require_relative 'query_results'
|
2
2
|
require 'osc_ruby/modules/validations_module'
|
3
|
-
require 'ostruct'
|
4
3
|
|
5
4
|
module OSCRuby
|
6
5
|
|
7
|
-
class QueryResultsSet
|
6
|
+
class QueryResultsSet
|
8
7
|
|
9
8
|
include ValidationsModule
|
10
9
|
|
@@ -18,21 +17,21 @@ module OSCRuby
|
|
18
17
|
|
19
18
|
args.each do |qh|
|
20
19
|
|
21
|
-
key_map.push(qh[:key])
|
20
|
+
key_map.push(qh[:key].to_sym)
|
22
21
|
|
23
22
|
query_arr.push(qh[:query])
|
24
23
|
|
25
24
|
end
|
26
25
|
|
27
|
-
query_results_set =
|
26
|
+
query_results_set = Struct.new( *key_map )
|
28
27
|
query_search = OSCRuby::QueryResults.new
|
29
28
|
|
30
29
|
|
31
30
|
final_query_arr = query_arr.join('; ')
|
32
31
|
final_results = query_search.query(client,final_query_arr)
|
33
32
|
|
34
|
-
|
35
|
-
|
33
|
+
final_query_results_set = query_results_set.new( *final_results )
|
34
|
+
final_query_results_set
|
36
35
|
end
|
37
36
|
|
38
37
|
end
|
data/lib/osc_ruby/version.rb
CHANGED
data/osc_ruby.gemspec
CHANGED
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.2', '>= 3.2.0'
|
26
26
|
spec.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.3'
|
27
|
-
spec.add_development_dependency "
|
27
|
+
spec.add_development_dependency "webmock"
|
28
28
|
spec.add_development_dependency 'yard'
|
29
29
|
end
|
@@ -25,7 +25,7 @@ describe OSCRuby::QueryResultsSet do
|
|
25
25
|
|
26
26
|
let(:table){ "answers" }
|
27
27
|
let(:nested_attributes){
|
28
|
-
[
|
28
|
+
[
|
29
29
|
"accessLevels.namedIDList.*",
|
30
30
|
"answerType.*",
|
31
31
|
"assignedTo.account.*",
|
@@ -80,7 +80,7 @@ describe OSCRuby::QueryResultsSet do
|
|
80
80
|
it 'should return results in set of OSCRuby::QueryResults',:vcr do
|
81
81
|
|
82
82
|
expect(query_results_set.query_set(client,{key:"answers", query:"select * from answers LIMIT 2"},
|
83
|
-
{key:"incidents", query:"describe incidents"})).to
|
83
|
+
{key:"incidents", query:"describe incidents"})).to be_a(Struct)
|
84
84
|
|
85
85
|
|
86
86
|
end
|
@@ -91,7 +91,7 @@ describe OSCRuby::QueryResultsSet do
|
|
91
91
|
{key:"serviceCategories", query:"describe serviceCategories"})
|
92
92
|
expect(test.incidents).to be_an(Array)
|
93
93
|
expect(test.incidents.first).to be_a(Hash)
|
94
|
-
expect(test.incidents.first['id']).to be_a(
|
94
|
+
expect(test.incidents.first['id']).to be_a(Integer)
|
95
95
|
expect(test.serviceCategories).to be_an(Array)
|
96
96
|
|
97
97
|
|
data/spec/core/spec_helper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'json'
|
|
5
5
|
|
6
6
|
VCR.configure do |c|
|
7
7
|
c.cassette_library_dir = "spec/fixtures"
|
8
|
-
c.hook_into :
|
8
|
+
c.hook_into :webmock
|
9
9
|
c.allow_http_connections_when_no_cassette = true
|
10
10
|
c.filter_sensitive_data('<OSC_ADMIN_USERNAME>') { ENV['OSC_ADMIN'] }
|
11
11
|
c.filter_sensitive_data('<OSC_ADMIN_PASSWORD>') { ENV['OSC_PASSWORD'] }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osc_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajan Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -113,7 +113,7 @@ dependencies:
|
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: 3.0.3
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
|
-
name:
|
116
|
+
name: webmock
|
117
117
|
requirement: !ruby/object:Gem::Requirement
|
118
118
|
requirements:
|
119
119
|
- - ">="
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- ".rubocop.yml"
|
155
155
|
- ".travis.yml"
|
156
156
|
- Gemfile
|
157
|
+
- Gemfile.lock
|
157
158
|
- License.txt
|
158
159
|
- README.md
|
159
160
|
- Rakefile
|
@@ -199,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
200
|
version: '0'
|
200
201
|
requirements: []
|
201
202
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.7.3
|
203
204
|
signing_key:
|
204
205
|
specification_version: 4
|
205
206
|
summary: Making the best of opensource and enterprise technology
|