chino_ruby 1.0 → 1.1
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/.gitignore +3 -1
- data/Gemfile.lock +42 -43
- data/README.md +24 -2
- data/chino_ruby.gemspec +2 -2
- data/lib/chino_ruby/version.rb +1 -1
- data/lib/chino_ruby.rb +6 -0
- metadata +4 -5
- data/chino_ruby-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b8a6340f6bc55b1410a6a660e49507e0c820ac
|
4
|
+
data.tar.gz: 074ea28dda43e313e46dbac3ecac77fcb0ee994a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7debeb2879d0a201b10450552cf2b5a6bdf3b7cec0f4c438f3148b6d0fd919f860240e57966eeb8ae31bd5d6594e04bf88950b1d81da7b59ae97eb1603db284f
|
7
|
+
data.tar.gz: 5039d3c9580762795678e7ad46d16517fa6e512ea980fb71a29217d536d4fa6bc34e824c21832bd8ae67317f8578f9a67190fcc33409cd496bef11af3a28b340
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,46 +1,46 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
chino_ruby (
|
4
|
+
chino_ruby (1.1)
|
5
5
|
listen (~> 3.0)
|
6
|
-
rails (~> 5.1.1)
|
6
|
+
rails (~> 5.1, >= 5.1.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (5.1.
|
12
|
-
actionpack (= 5.1.
|
11
|
+
actioncable (5.1.2)
|
12
|
+
actionpack (= 5.1.2)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (~> 0.6.1)
|
15
|
-
actionmailer (5.1.
|
16
|
-
actionpack (= 5.1.
|
17
|
-
actionview (= 5.1.
|
18
|
-
activejob (= 5.1.
|
15
|
+
actionmailer (5.1.2)
|
16
|
+
actionpack (= 5.1.2)
|
17
|
+
actionview (= 5.1.2)
|
18
|
+
activejob (= 5.1.2)
|
19
19
|
mail (~> 2.5, >= 2.5.4)
|
20
20
|
rails-dom-testing (~> 2.0)
|
21
|
-
actionpack (5.1.
|
22
|
-
actionview (= 5.1.
|
23
|
-
activesupport (= 5.1.
|
21
|
+
actionpack (5.1.2)
|
22
|
+
actionview (= 5.1.2)
|
23
|
+
activesupport (= 5.1.2)
|
24
24
|
rack (~> 2.0)
|
25
25
|
rack-test (~> 0.6.3)
|
26
26
|
rails-dom-testing (~> 2.0)
|
27
27
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
-
actionview (5.1.
|
29
|
-
activesupport (= 5.1.
|
28
|
+
actionview (5.1.2)
|
29
|
+
activesupport (= 5.1.2)
|
30
30
|
builder (~> 3.1)
|
31
31
|
erubi (~> 1.4)
|
32
32
|
rails-dom-testing (~> 2.0)
|
33
33
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
34
|
-
activejob (5.1.
|
35
|
-
activesupport (= 5.1.
|
34
|
+
activejob (5.1.2)
|
35
|
+
activesupport (= 5.1.2)
|
36
36
|
globalid (>= 0.3.6)
|
37
|
-
activemodel (5.1.
|
38
|
-
activesupport (= 5.1.
|
39
|
-
activerecord (5.1.
|
40
|
-
activemodel (= 5.1.
|
41
|
-
activesupport (= 5.1.
|
37
|
+
activemodel (5.1.2)
|
38
|
+
activesupport (= 5.1.2)
|
39
|
+
activerecord (5.1.2)
|
40
|
+
activemodel (= 5.1.2)
|
41
|
+
activesupport (= 5.1.2)
|
42
42
|
arel (~> 8.0)
|
43
|
-
activesupport (5.1.
|
43
|
+
activesupport (5.1.2)
|
44
44
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
45
45
|
i18n (~> 0.7)
|
46
46
|
minitest (~> 5.1)
|
@@ -48,11 +48,11 @@ GEM
|
|
48
48
|
arel (8.0.0)
|
49
49
|
builder (3.2.3)
|
50
50
|
concurrent-ruby (1.0.5)
|
51
|
-
erubi (1.6.
|
51
|
+
erubi (1.6.1)
|
52
52
|
ffi (1.9.18)
|
53
53
|
globalid (0.4.0)
|
54
54
|
activesupport (>= 4.2.0)
|
55
|
-
i18n (0.8.
|
55
|
+
i18n (0.8.4)
|
56
56
|
listen (3.1.5)
|
57
57
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
58
58
|
rb-inotify (~> 0.9, >= 0.9.7)
|
@@ -74,36 +74,35 @@ GEM
|
|
74
74
|
rack (2.0.3)
|
75
75
|
rack-test (0.6.3)
|
76
76
|
rack (>= 1.0)
|
77
|
-
rails (5.1.
|
78
|
-
actioncable (= 5.1.
|
79
|
-
actionmailer (= 5.1.
|
80
|
-
actionpack (= 5.1.
|
81
|
-
actionview (= 5.1.
|
82
|
-
activejob (= 5.1.
|
83
|
-
activemodel (= 5.1.
|
84
|
-
activerecord (= 5.1.
|
85
|
-
activesupport (= 5.1.
|
77
|
+
rails (5.1.2)
|
78
|
+
actioncable (= 5.1.2)
|
79
|
+
actionmailer (= 5.1.2)
|
80
|
+
actionpack (= 5.1.2)
|
81
|
+
actionview (= 5.1.2)
|
82
|
+
activejob (= 5.1.2)
|
83
|
+
activemodel (= 5.1.2)
|
84
|
+
activerecord (= 5.1.2)
|
85
|
+
activesupport (= 5.1.2)
|
86
86
|
bundler (>= 1.3.0, < 2.0)
|
87
|
-
railties (= 5.1.
|
87
|
+
railties (= 5.1.2)
|
88
88
|
sprockets-rails (>= 2.0.0)
|
89
89
|
rails-dom-testing (2.0.3)
|
90
90
|
activesupport (>= 4.2.0)
|
91
91
|
nokogiri (>= 1.6)
|
92
92
|
rails-html-sanitizer (1.0.3)
|
93
93
|
loofah (~> 2.0)
|
94
|
-
railties (5.1.
|
95
|
-
actionpack (= 5.1.
|
96
|
-
activesupport (= 5.1.
|
94
|
+
railties (5.1.2)
|
95
|
+
actionpack (= 5.1.2)
|
96
|
+
activesupport (= 5.1.2)
|
97
97
|
method_source
|
98
98
|
rake (>= 0.8.7)
|
99
99
|
thor (>= 0.18.1, < 2.0)
|
100
100
|
rake (10.5.0)
|
101
|
-
rb-fsevent (0.
|
101
|
+
rb-fsevent (0.10.1)
|
102
102
|
rb-inotify (0.9.10)
|
103
103
|
ffi (>= 0.5.0, < 2)
|
104
104
|
ruby_dep (1.5.0)
|
105
|
-
spring (
|
106
|
-
activesupport (>= 4.2)
|
105
|
+
spring (0.9.2)
|
107
106
|
sprockets (3.7.1)
|
108
107
|
concurrent-ruby (~> 1.0)
|
109
108
|
rack (> 1, < 3)
|
@@ -111,7 +110,7 @@ GEM
|
|
111
110
|
actionpack (>= 4.0)
|
112
111
|
activesupport (>= 4.0)
|
113
112
|
sprockets (>= 3.0.0)
|
114
|
-
test-unit (3.
|
113
|
+
test-unit (3.1.9)
|
115
114
|
power_assert
|
116
115
|
thor (0.19.4)
|
117
116
|
thread_safe (0.3.6)
|
@@ -128,8 +127,8 @@ DEPENDENCIES
|
|
128
127
|
bundler (~> 1.15)
|
129
128
|
chino_ruby!
|
130
129
|
rake (~> 10.0)
|
131
|
-
spring
|
132
|
-
test-unit
|
130
|
+
spring (~> 0)
|
131
|
+
test-unit (~> 3.1.2)
|
133
132
|
|
134
133
|
BUNDLED WITH
|
135
|
-
1.15.
|
134
|
+
1.15.1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ChinoRuby
|
2
2
|
|
3
|
-
Official Ruby wrapper of the Chino.io
|
3
|
+
Official Ruby wrapper of the Chino.io API
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -23,9 +23,31 @@ Or install it yourself as:
|
|
23
23
|
Initialize a Chino.io client variable as follow
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
@client = ChinoAPI.new(<your-customer-id
|
26
|
+
@client = ChinoAPI.new("<your-customer-id>", "<your-customer-key>", "<server-url>")
|
27
27
|
```
|
28
28
|
The server-url parameter must be `https://api.test.chino.io/v1` or `https://api.chino.io/v1`.
|
29
|
+
Once you created your client variable, you can use it to call functions and communicate with the server.
|
30
|
+
The creation of a basic document is as follow:
|
31
|
+
- First, create the Repository
|
32
|
+
```ruby
|
33
|
+
@repo = @client.repositories.create_repository("test repo description")
|
34
|
+
```
|
35
|
+
- Then create the Schema
|
36
|
+
```ruby
|
37
|
+
fields = []
|
38
|
+
fields.push(Field.new("string", "test_string", true))
|
39
|
+
fields.push(Field.new("integer", "test_integer", true))
|
40
|
+
|
41
|
+
@schema = @client.schemas.create_schema(@repo.repository_id, "test schema description", fields)
|
42
|
+
```
|
43
|
+
- Finally, create the Document
|
44
|
+
```ruby
|
45
|
+
content = Hash.new
|
46
|
+
content["test_string"] = "sample value ruby"
|
47
|
+
content["test_integer"] = 123
|
48
|
+
|
49
|
+
@doc = @client.documents.create_document(@schema.schema_id, content)
|
50
|
+
```
|
29
51
|
|
30
52
|
## Development
|
31
53
|
|
data/chino_ruby.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "chino_ruby/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "chino_ruby"
|
8
|
-
spec.version = '1.
|
8
|
+
spec.version = '1.1'
|
9
9
|
spec.authors = ["Paolo Prem"]
|
10
10
|
spec.email = ["prempaolo@gmail.com"]
|
11
11
|
|
@@ -37,6 +37,6 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency "rake", '~> 10.0'
|
38
38
|
spec.add_dependency "listen", '~> 3.0'
|
39
39
|
spec.add_runtime_dependency 'rails', '~> 5.1', '>= 5.1.1'
|
40
|
-
spec.add_development_dependency 'test-unit',
|
40
|
+
spec.add_development_dependency 'test-unit', "~> 3.1.2"
|
41
41
|
spec.add_development_dependency 'spring', '~> 0'
|
42
42
|
end
|
data/lib/chino_ruby/version.rb
CHANGED
data/lib/chino_ruby.rb
CHANGED
@@ -165,6 +165,7 @@ class ChinoBaseAPI < CheckValues
|
|
165
165
|
end
|
166
166
|
|
167
167
|
def post_resource(path, data)
|
168
|
+
check_string(path)
|
168
169
|
uri = return_uri(path)
|
169
170
|
req = Net::HTTP::Post.new(uri.path)
|
170
171
|
if @customer_id == "Bearer "
|
@@ -180,6 +181,7 @@ class ChinoBaseAPI < CheckValues
|
|
180
181
|
end
|
181
182
|
|
182
183
|
def post_resource_with_params(path, data, limit, offset)
|
184
|
+
check_string(path)
|
183
185
|
uri = return_uri_with_params(path, limit, offset)
|
184
186
|
req = Net::HTTP::Post.new(uri.path)
|
185
187
|
if @customer_id == "Bearer "
|
@@ -195,6 +197,7 @@ class ChinoBaseAPI < CheckValues
|
|
195
197
|
end
|
196
198
|
|
197
199
|
def post_resource_with_string_result(path, data)
|
200
|
+
check_string(path)
|
198
201
|
uri = return_uri(path)
|
199
202
|
req = Net::HTTP::Post.new(uri.path)
|
200
203
|
if @customer_id == "Bearer "
|
@@ -210,6 +213,7 @@ class ChinoBaseAPI < CheckValues
|
|
210
213
|
end
|
211
214
|
|
212
215
|
def post_resource_with_no_data(path)
|
216
|
+
check_string(path)
|
213
217
|
uri = return_uri(path)
|
214
218
|
req = Net::HTTP::Post.new(uri.path)
|
215
219
|
if @customer_id == "Bearer "
|
@@ -224,6 +228,7 @@ class ChinoBaseAPI < CheckValues
|
|
224
228
|
end
|
225
229
|
|
226
230
|
def put_resource(path, data)
|
231
|
+
check_string(path)
|
227
232
|
uri = return_uri(path)
|
228
233
|
req = Net::HTTP::Put.new(uri.path)
|
229
234
|
if @customer_id == "Bearer "
|
@@ -239,6 +244,7 @@ class ChinoBaseAPI < CheckValues
|
|
239
244
|
end
|
240
245
|
|
241
246
|
def patch_resource(path, data)
|
247
|
+
check_string(path)
|
242
248
|
uri = return_uri(path)
|
243
249
|
req = Net::HTTP::Patch.new(uri.path)
|
244
250
|
if @customer_id == "Bearer "
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chino_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Prem
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 3.1.2
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 3.1.2
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: spring
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,7 +117,6 @@ files:
|
|
117
117
|
- Rakefile
|
118
118
|
- bin/console
|
119
119
|
- bin/setup
|
120
|
-
- chino_ruby-0.1.0.gem
|
121
120
|
- chino_ruby.gemspec
|
122
121
|
- config-chino.yml
|
123
122
|
- lib/.DS_Store
|
data/chino_ruby-0.1.0.gem
DELETED
Binary file
|