cobot_client 2.0.0 → 2.1.0

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: a9a84129839f36b7d3819e95f33df71158f48b20
4
- data.tar.gz: 9c4bb2d41aaa77f341af7a969f85f7f93d0bb73a
3
+ metadata.gz: 80e9caaf8daba5d9a8235e5d2da33179305937ec
4
+ data.tar.gz: 4f9812a75eb45d699154073f235285edc3028192
5
5
  SHA512:
6
- metadata.gz: 1761ea3e0624f9acef693541a83dc71724de3d6b3b5cf8ee2bc5c3edaf57a1d6cb659278d8a7b139a91d90acae1fe4e8f929b16b1dfdb819cb22fbfd6a4dbc6a
7
- data.tar.gz: 9c8426fe5bd17be58b16439fb22dad315edf564e0847d3ebbe79feae3f43989f1180d0a7e59c6e5fd85616a2ec2fed76e46b7eb8181d813d3c4ca9923f9abbd2
6
+ metadata.gz: 398c69595b6c05efe247628453ebe731a6d43ff2e7f03e8e34a7da3835ea6449d07f78a774520d01a8ed549359544dc5890c97c75ae8e6c24140dc033b081b54
7
+ data.tar.gz: c4e1e0d442c71e021e51a88c5f539807904fa51fbe6240d1a72f3b0145ec759f6d1806f2edf1a8a90226c6d20649a44beaf57135a5575e23ee84eceb05bfcaa3
@@ -98,7 +98,7 @@ module CobotClient
98
98
  end
99
99
 
100
100
  def parse_args(*args)
101
- if args.last.is_a?(Hash)
101
+ if args.size == 3 || (args.size == 2 && args[0].match(%r{https?://}))
102
102
  params = args.pop
103
103
  else
104
104
  params = {}
@@ -1,3 +1,3 @@
1
1
  module CobotClient
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -86,6 +86,17 @@ describe CobotClient::ApiClient do
86
86
  api_client.put 'co-up', '/invoices', {id: '1'}
87
87
  end
88
88
 
89
+ it 'passes an array as body' do
90
+ expect(RestClient).to receive(:put).with(
91
+ 'https://co-up.cobot.me/api/invoices',
92
+ [{id: '1'}].to_json,
93
+ 'Content-Type' => 'application/json',
94
+ 'User-Agent' => 'test agent',
95
+ 'Authorization' => 'Bearer token-123') { default_response }
96
+
97
+ api_client.put 'co-up', '/invoices', [{id: '1'}]
98
+ end
99
+
89
100
  it 'accepts a url' do
90
101
  expect(RestClient).to receive(:put).with(
91
102
  'https://co-up.cobot.me/api/invoices',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobot_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Lang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2018-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.6.6
144
+ rubygems_version: 2.6.13
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: Client for the Cobot API plus helpers