bonsai_client 0.3.0 → 0.3.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/README.md +4 -4
- data/bin/bonsai_client +3 -1
- data/lib/bonsai_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c3d3fd93e30bd5d01611fbccc75119b2f80772
|
4
|
+
data.tar.gz: d56c2d76966d98666b091fc2c44340397113cc7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfb6c4f5bad0dacc9c4177be341dc1215ca50bde00ffb0af11c9ab65fef69941517185193f254b3cc73b7643daccb65775cfe5d94c3f8b0e81bc1a1c981e696b
|
7
|
+
data.tar.gz: 4e039d567d290ebc463fbbfcd3c1e0cc8fbd0425c6b9969f2dbf88e3d1027f01f1292841fafe0b8a49bebfc703a8d9b99074f36cb09d2b0831ee84e7a7da3b21
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ rbenv rehash
|
|
30
30
|
Upload a file:
|
31
31
|
|
32
32
|
```bash
|
33
|
-
bonsai_client upload --url="http://
|
33
|
+
bonsai_client upload --url="http://bonsai-server-instance.com" --path=/path/to/file --client-id=xxx --client-secret=yyy
|
34
34
|
```
|
35
35
|
|
36
36
|
## Usage in ruby code
|
@@ -40,7 +40,7 @@ bonsai_client upload --url="http://xxx.yyy" --path=/path/to/file --client-id=zzz
|
|
40
40
|
require 'bonsai-client'
|
41
41
|
|
42
42
|
# Create a new instance of Bonsai client:
|
43
|
-
bonsai = BonsaiClient.new(url: 'http://
|
43
|
+
bonsai = BonsaiClient.new(url: 'http://bonsai-server-instance.com', client_id: 'xxx', client_secret: 'yyy')
|
44
44
|
|
45
45
|
# Upload a file to a Bonsai server:
|
46
46
|
response = bonsai.upload(path: '/path/to/my-file')
|
@@ -56,8 +56,8 @@ src3 = bonsai.thumbnail_url(checksum: response[:data][:file_checksum]), size: :m
|
|
56
56
|
### Test
|
57
57
|
|
58
58
|
```bash
|
59
|
-
BONSAI_SERVER_URL=https://
|
60
|
-
BONSAI_SERVER_URL=https://
|
59
|
+
BONSAI_SERVER_URL=https://bonsai-server-instance.com BONSAI_CLIENT_ID=xxx BONSAI_CLIENT_SECRET=yyy rake test
|
60
|
+
BONSAI_SERVER_URL=https://bonsai-server-instance.com BONSAI_CLIENT_ID=xxx BONSAI_CLIENT_SECRET=yyy rake test TEST=test/upload_file_test.rb
|
61
61
|
```
|
62
62
|
|
63
63
|
### Rake tasks
|
data/bin/bonsai_client
CHANGED
@@ -9,16 +9,18 @@ module BonsaiClient
|
|
9
9
|
desc "upload", "Upload a file to Bonsai server"
|
10
10
|
option :url, type: :string, required: true
|
11
11
|
option :client_id, type: :string, required: true
|
12
|
+
option :client_secret, type: :string, required: true
|
12
13
|
option :path, type: :string, required: true
|
13
14
|
long_desc <<-LONGDESC
|
14
15
|
|
15
|
-
> $ bonsai_client upload --url=http://bonsai-server.com --path=/path/to/file --client_id=
|
16
|
+
> $ bonsai_client upload --url=http://bonsai-server.com --path=/path/to/file --client_id=xxx --client-secret=yyy
|
16
17
|
|
17
18
|
LONGDESC
|
18
19
|
def upload
|
19
20
|
bonsai = BonsaiClient.create(
|
20
21
|
url: options[:url],
|
21
22
|
client_id: options[:client_id],
|
23
|
+
client_secret: options[:client_secret],
|
22
24
|
)
|
23
25
|
response = bonsai.upload(path: options[:path])
|
24
26
|
puts response.to_json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bonsai_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|