ob 0.0.1.1 → 0.0.1.2
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/ob/operations/find.rb +1 -1
- data/lib/ob/product.rb +1 -0
- data/lib/ob/requestor.rb +15 -3
- data/lib/ob/version.rb +1 -1
- data/lib/ob.rb +2 -1
- data/ob.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb59857649d8243073f973c6eb076baacb718dc2
|
4
|
+
data.tar.gz: a8a00f7b99ee698525d279cba062ca8412d15a75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd61aa2df796e881b1a55f35d50d223b6b4eb1cccc2ce3395c7e326d74e3ba151854ebd610ede56793254212a0e9d78d720d8e3ff0058b3ec38f8e65d3c273c6
|
7
|
+
data.tar.gz: deac6acc604795c5102867e305a06a340477cbf7b7b5694ace8c7bdcc6fbecedf924d121da223551a60d82833836b6ada8d3dc03c5ded95663c7319a0788a1b7
|
data/lib/ob/operations/find.rb
CHANGED
data/lib/ob/product.rb
CHANGED
data/lib/ob/requestor.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'base64'
|
3
3
|
require 'json'
|
4
|
+
require "rexml/document"
|
5
|
+
|
4
6
|
|
5
7
|
module Ob
|
6
8
|
class Requestor
|
@@ -21,7 +23,11 @@ module Ob
|
|
21
23
|
def request(meth, url, params=nil)
|
22
24
|
url = self.api_url(url)
|
23
25
|
meth = meth.downcase
|
24
|
-
|
26
|
+
if params
|
27
|
+
if params.class != Hash
|
28
|
+
url = url + '?' + params
|
29
|
+
end
|
30
|
+
end
|
25
31
|
begin
|
26
32
|
conn = Faraday.new :url => url do |faraday|
|
27
33
|
faraday.adapter Faraday.default_adapter
|
@@ -29,7 +35,9 @@ module Ob
|
|
29
35
|
end
|
30
36
|
|
31
37
|
if params
|
32
|
-
|
38
|
+
if params.class == Hash
|
39
|
+
conn.params = params
|
40
|
+
end
|
33
41
|
end
|
34
42
|
response = conn.method(meth).call
|
35
43
|
|
@@ -39,7 +47,11 @@ module Ob
|
|
39
47
|
if response.status != 200
|
40
48
|
puts "error status code is #{response.status}"
|
41
49
|
end
|
42
|
-
|
50
|
+
if url.include? "json"
|
51
|
+
return JSON.parse response.body
|
52
|
+
else
|
53
|
+
return response.body
|
54
|
+
end
|
43
55
|
end
|
44
56
|
end
|
45
57
|
end
|
data/lib/ob/version.rb
CHANGED
data/lib/ob.rb
CHANGED
@@ -4,6 +4,7 @@ require 'cgi'
|
|
4
4
|
|
5
5
|
require "ob/operations/find"
|
6
6
|
require "ob/operations/where"
|
7
|
+
require "ob/operations/exec"
|
7
8
|
|
8
9
|
require "ob/ob_object"
|
9
10
|
require "ob/resource"
|
@@ -36,4 +37,4 @@ module Ob
|
|
36
37
|
def self.password=(password)
|
37
38
|
@password = password
|
38
39
|
end
|
39
|
-
end
|
40
|
+
end
|
data/ob.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Jesus Lerma Sanchez"]
|
10
10
|
spec.email = ["shuyojl@gmail.com"]
|
11
11
|
spec.summary = %q{Ruby library for ob services.}
|
12
|
-
spec.description = %q{This
|
12
|
+
spec.description = %q{This library provides ob services operations.}
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesus Lerma Sanchez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 1.8.1
|
61
|
-
description: This
|
61
|
+
description: This library provides ob services operations.
|
62
62
|
email:
|
63
63
|
- shuyojl@gmail.com
|
64
64
|
executables: []
|