aliyunsdkcore 0.0.8 → 0.0.9

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
- SHA256:
3
- metadata.gz: 32c52b1b01cf9802096c014e087477c1082bd5bd541e132444b35f69036e7572
4
- data.tar.gz: aea3c6a0f3701aa6c54752143216d98926666e790e73bcff75487cf83e8bdd39
2
+ SHA1:
3
+ metadata.gz: 765252d194bca90dab48d8598cddbe86c653dde3
4
+ data.tar.gz: a77a3943b142c13d7cd48c0c96b3752701731109
5
5
  SHA512:
6
- metadata.gz: 1f2ccb9b12db0ed152ee3debea8e118b37651ea99388828661af992c6c9d35c31ea1d4ca3b1f268748b514f50f5296e6ae6a8a378baa897e082d73e8e3f6f3ff
7
- data.tar.gz: 9203e79a4dc5d72cd11bb15f761674a0344617310de0e16ed16c26f63ee978983630def26cc921c0a49a694dfb7977c4a295f4cdf663b1dfd0b0c2d15a4bbc23
6
+ metadata.gz: 4b2768c73931fcfbdbe68727d2b8b775a7e034bc7ae0ae6c55dbe321456274a416bb2e53464c712b6001461c714c9303761307fcf1a8ab7ced4c7c65952727ba
7
+ data.tar.gz: 42fa1a8c9afd66cd77117df2c8307da61e158ba1f9fbde2c666f2d1fee8b653b75a4f98777cc061846f64223da46c6f0fdbe7b3a5cb6291292ec836fff8e4f4a
@@ -2,7 +2,7 @@ require 'aliyunsdkcore/rpc_client'
2
2
  require 'aliyunsdkcore/roa_client'
3
3
 
4
4
  module AliyunSDKCore
5
- VERSION = "0.0.8"
5
+ VERSION = "0.0.9"
6
6
  DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
7
7
  "#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
8
8
  end
@@ -2,10 +2,6 @@ require 'faraday'
2
2
  require 'securerandom'
3
3
  require 'active_support/all'
4
4
 
5
- def present?(obj)
6
- obj.respond_to?(:empty?) ? !obj.empty? : obj
7
- end
8
-
9
5
  module AliyunSDKCore
10
6
 
11
7
  class ROAClient
@@ -29,7 +25,7 @@ module AliyunSDKCore
29
25
 
30
26
  response = connection.send(method.downcase) do |request|
31
27
  request.url uri, params
32
- if present?(body)
28
+ if body.try(:any?) || body
33
29
  request_body = body.to_json
34
30
  request.body = request_body
35
31
  mix_headers['content-md5'] = Digest::MD5.base64digest request_body
@@ -88,7 +84,7 @@ module AliyunSDKCore
88
84
  'x-acs-signature-version' => '1.0',
89
85
  'x-acs-version' => self.api_version,
90
86
  'x-sdk-client' => "RUBY(#{RUBY_VERSION})", # FIXME: 如何获取Gem的名称和版本号
91
- 'user-agent' => DEFAULT_UA
87
+ 'user-agent' => DEFAULT_UA
92
88
  }
93
89
  if self.security_token
94
90
  default_headers.merge!(
@@ -3,15 +3,6 @@ require 'openssl'
3
3
  require 'faraday'
4
4
  require 'active_support/all'
5
5
 
6
- # Converts just the first character to uppercase.
7
- #
8
- # upcase_first('what a Lovely Day') # => "What a Lovely Day"
9
- # upcase_first('w') # => "W"
10
- # upcase_first('') # => ""
11
- def upcase_first(string)
12
- string.length > 0 ? string[0].upcase.concat(string[1..-1]) : ""
13
- end
14
-
15
6
  module AliyunSDKCore
16
7
 
17
8
  class RPCClient
@@ -69,6 +60,15 @@ module AliyunSDKCore
69
60
 
70
61
  private
71
62
 
63
+ # Converts just the first character to uppercase.
64
+ #
65
+ # upcase_first('what a Lovely Day') # => "What a Lovely Day"
66
+ # upcase_first('w') # => "W"
67
+ # upcase_first('') # => ""
68
+ def upcase_first(string)
69
+ string.length > 0 ? string[0].upcase.concat(string[1..-1]) : ""
70
+ end
71
+
72
72
  def connection(adapter = Faraday.default_adapter)
73
73
  Faraday.new(:url => self.endpoint) { |faraday| faraday.adapter adapter }
74
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyunsdkcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alibaba Cloud SDK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-09 00:00:00.000000000 Z
11
+ date: 2019-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -115,7 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.0.3
118
+ rubyforge_project: aliyunsdkcore
119
+ rubygems_version: 2.5.2.3
119
120
  signing_key:
120
121
  specification_version: 4
121
122
  summary: Alibaba Cloud Ruby Core SDK