superbot-cloud 0.1.16 → 0.1.17

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
  SHA256:
3
- metadata.gz: fc3d19c5bf6ed9f12b5b8cb85021d99e40a1aa2ee289eb3e759f5f5f3d27919b
4
- data.tar.gz: c4876bba1c8dc2ce7d19ecc20e01d7b4846a3a86157fb95b2e4f6e113ed76f4a
3
+ metadata.gz: 818f223872b07123a628716166e28c11ac718bc6189ad2ea8ecc7cd2a8899309
4
+ data.tar.gz: 43ab623c489c0c5247ffc3a239c354c59ac59d00b9b2da06d228a69a9d911fc0
5
5
  SHA512:
6
- metadata.gz: 4548176eac8f44b4a96aa3d83a232243d633146cfe7234e028553a4ac5a83d028cb8e20d899e3c7bd47f836add0cced5df23976d284283678955df24256261cd
7
- data.tar.gz: 7c91f01a5f93e3499ea6dc2888e4134ec085a5f89a9098fcd2e4aa9a01cab21eb01464dfa405a83dca1e5f23f02fd4a357cec4e00cf6808d80f72f594f767294
6
+ metadata.gz: 28efe01f5c5e8559f6c2dd37821ef4c5407d93ac2f3291ca3dbc6ff487def0ec195087bb7d7e2ecd2afe855c6d3dc7dfa45ba5ed606fdd252a93de7e363debf3
7
+ data.tar.gz: d442185c1a3ddbc6083695ac6b3346767c2aabd013abe7e6ffa7adc81e6bcd4172cd716f4a0b167c012c73ea3cd1cc9e7b1fe144ecb31294d8210d0c1234d537
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superbot-cloud (0.1.16)
4
+ superbot-cloud (0.1.17)
5
5
  marcel (= 0.3.3)
6
6
  multipart-post (= 2.0.0)
7
7
 
@@ -67,14 +67,14 @@ GEM
67
67
  rack-protection (= 2.0.3)
68
68
  tilt (~> 2.0)
69
69
  sinatra-silent (0.0.1)
70
- superbot (0.1.21)
70
+ superbot (0.1.22)
71
71
  clamp (= 1.2.1)
72
72
  kommando (~> 0.1)
73
73
  launchy (= 2.4.3)
74
74
  selenium-webdriver (~> 3.14, >= 3.14.0)
75
75
  sinatra (= 2.0.3)
76
76
  sinatra-silent (= 0.0.1)
77
- superbot-cloud (~> 0.1.15)
77
+ superbot-cloud (~> 0.1.16)
78
78
  zaru (= 0.2.0)
79
79
  tilt (2.0.8)
80
80
  unicode-display_width (1.4.0)
@@ -88,7 +88,7 @@ DEPENDENCIES
88
88
  rake (~> 10.0)
89
89
  rspec (~> 3.0)
90
90
  rubocop (~> 0.53)
91
- superbot (~> 0.1.21)
91
+ superbot (~> 0.1.22)
92
92
  superbot-cloud!
93
93
 
94
94
  BUNDLED WITH
@@ -21,10 +21,20 @@ module Superbot
21
21
  method, endpoint, required_param = ENDPOINT_MAP[type].values
22
22
  uri = URI.parse([BASE_URI, endpoint, params[required_param]].compact.join('/'))
23
23
 
24
- req = Net::HTTP.const_get(
25
- method.to_s.split('_').map(&:capitalize).join('::')
26
- ).new(uri, method == :post_multipart ? params.compact : {})
27
- req.set_form_data(params.compact) unless method == :post_multipart
24
+ request_class = Net::HTTP.const_get(method.to_s.split('_').map(&:capitalize).join('::'))
25
+
26
+ params = params.compact
27
+ req =
28
+ case method
29
+ when :get
30
+ uri.query = URI.encode_www_form(params)
31
+ req = request_class.new(uri)
32
+ when :post_multipart
33
+ request_class.new(uri, params)
34
+ else
35
+ request_class.new(uri).tap { |r| r.set_form_data(params) }
36
+ end
37
+
28
38
  if Superbot::Cloud.credentials
29
39
  req['Authorization'] = format(
30
40
  'Token token="%<token>s", email="%<email>s"',
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Superbot
4
4
  module Cloud
5
- VERSION = "0.1.16"
5
+ VERSION = "0.1.17"
6
6
  end
7
7
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_runtime_dependency "multipart-post", "2.0.0"
37
37
  spec.add_runtime_dependency "marcel", "0.3.3"
38
38
 
39
- spec.add_development_dependency "superbot", "~> 0.1.21"
39
+ spec.add_development_dependency "superbot", "~> 0.1.22"
40
40
  spec.add_development_dependency "bundler", "~> 1.16"
41
41
  spec.add_development_dependency "rake", "~> 10.0"
42
42
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbot-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Superbots
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-26 00:00:00.000000000 Z
11
+ date: 2018-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.21
47
+ version: 0.1.22
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.21
54
+ version: 0.1.22
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement