bonsai_client 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d566744cb6bb9de5b78efdc49d01d34d7a810011
4
- data.tar.gz: f8399219a8a70a160b52f87a0a3172350a675e36
3
+ metadata.gz: 06c3d3fd93e30bd5d01611fbccc75119b2f80772
4
+ data.tar.gz: d56c2d76966d98666b091fc2c44340397113cc7e
5
5
  SHA512:
6
- metadata.gz: cd243c02316ad8836f0cd09e80f0dada2bc65558cbb1e037906db524f02d007fc41acd23c02820bb1d24b3f467eeb1c6511449e607dfb7dcb34aabbc024e188a
7
- data.tar.gz: 67ad3b51aabc61ce81fd85f31648f7c6193d196e2a38a3bf6ca7de6c8b3c89a6bfc9c8beaeb9ee2af415e53e0106ca6c4f2acb3a77e6b113e826abb1b69c1640
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://xxx.yyy" --path=/path/to/file --client-id=zzz
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://xxx.yyy', client_id: 'zzz')
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://xxx.yyy BONSAI_CLIENT_ID=zzz bundle exec rake test
60
- BONSAI_SERVER_URL=https://xxx.yyy BONSAI_CLIENT_ID=zzz bundle exec rake test TEST=test/upload_file_test.rb
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
@@ -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=test
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
@@ -1,4 +1,4 @@
1
1
  module BonsaiClient
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  NAME = 'bonsai_client'.freeze
4
4
  end
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.0
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-05-26 00:00:00.000000000 Z
11
+ date: 2019-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client