aliyun-sdk 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: 30d7a2978cd6ef7cdc1ed369febb51a24ca84012
4
- data.tar.gz: a8e6b8125b4f64ed182b2a190b01eed1db5dac8e
3
+ metadata.gz: 3442046916c8942bc642201c55dc24cdd2c79c9a
4
+ data.tar.gz: 1ca2020cb4d9a039dcbd86e84149974b1fd7b7f6
5
5
  SHA512:
6
- metadata.gz: e9db93f799259a7066bd948cbab927bc38c831f6dea8a1bd155665f85132df0e0520af9a2766d2d33b4dff41f240dfdfe0296b135fb80393f026a0634f41e358
7
- data.tar.gz: e4d5e3a83e3950bfb73601a4fcc7e3c0ce6910c6cf1141d7a46277e381f38d34d0254f880e615c5297343340132c3da88a14024dc7c41a62c16324a772bdb356
6
+ metadata.gz: 221810c807b825c02f518dc2f4580988dc369c45dcca4741b8ee8e3481996ac03027c1dba8cc10b997ccb317cfca9f0b2c0e251f48b74011bb53aa113ffc3955
7
+ data.tar.gz: 8999b93dcf20f9aa5a3c69fb312cbbf77b3b24586089cbfdb199ccde137fc39ff181e1e81fdc79953ae5ed722476bf7955a6f650aa0f5639412d855574ca60e8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Change Log
2
2
 
3
+ ### v0.3.1
4
+
5
+ - Fix frozen string issue in OSSClient/STSClient config
6
+
3
7
  ### v0.3.0
4
8
 
5
9
  - Add support for OSS Callback
data/README.md CHANGED
@@ -48,7 +48,7 @@ AccessKeySecret,在使用Aliyun OSS SDK时需要提供您的这两个信息。
48
48
  ### 创建Client
49
49
 
50
50
  client = Aliyun::OSS::Client.new(
51
- :endpoint => endpoint,
51
+ :endpoint => 'endpoint',
52
52
  :access_key_id => 'access_key_id',
53
53
  :access_key_secret => 'access_key_secret')
54
54
 
@@ -98,10 +98,10 @@ aliyun-sdk中包含了STS的SDK,使用时只需要`require 'aliyun/sts'`即可
98
98
  token = sts.assume_role('role-arn', 'my-app')
99
99
 
100
100
  client = Aliyun::OSS::Client.new(
101
- :endpoint => 'http://img.my-domain.com',
101
+ :endpoint => 'http://oss-cn-hangzhou.aliyuncs.com',
102
102
  :access_key_id => token.access_key_id,
103
103
  :access_key_secret => token.access_key_secret,
104
- :sts_token => token.sts_token)
104
+ :sts_token => token.security_token)
105
105
 
106
106
  注意使用STS时必须指定`:sts_token`参数。用户还可以通过`STS::Client`申请
107
107
  带Policy的token,细节请参考[API文档][sdk-api]。
@@ -7,7 +7,7 @@ module Aliyun
7
7
  # OSS服务的客户端,用于获取bucket列表,创建/删除bucket。Object相关
8
8
  # 的操作请使用{OSS::Bucket}。
9
9
  # @example 创建Client
10
- # endpoint = 'oss-cn-hangzhou.oss.aliyuncs.com'
10
+ # endpoint = 'oss-cn-hangzhou.aliyuncs.com'
11
11
  # client = Client.new(
12
12
  # :endpoint => endpoint,
13
13
  # :access_key_id => 'access_key_id',
@@ -21,7 +21,7 @@ module Aliyun
21
21
  # 构造OSS client,用于操作buckets。
22
22
  # @param opts [Hash] 构造Client时的参数选项
23
23
  # @option opts [String] :endpoint [必填]OSS服务的地址,可以是以
24
- # oss.aliyuncs.com的标准域名,也可以是用户绑定的域名
24
+ # oss-cn-hangzhou.aliyuncs.com的标准域名,也可以是用户绑定的域名
25
25
  # @option opts [String] :access_key_id [可选]用户的ACCESS KEY ID,
26
26
  # 如果不填则会尝试匿名访问
27
27
  # @option opts [String] :access_key_secret [可选]用户的ACCESS
@@ -16,8 +16,8 @@ module Aliyun
16
16
  def initialize(opts = {})
17
17
  super(opts)
18
18
 
19
- @access_key_id.strip! if @access_key_id
20
- @access_key_secret.strip! if @access_key_secret
19
+ @access_key_id = @access_key_id.strip if @access_key_id
20
+ @access_key_secret = @access_key_secret.strip if @access_key_secret
21
21
  normalize_endpoint if endpoint
22
22
  end
23
23
 
@@ -12,8 +12,8 @@ module Aliyun
12
12
  def initialize(opts = {})
13
13
  super(opts)
14
14
 
15
- @access_key_id.strip! if @access_key_id
16
- @access_key_secret.strip! if @access_key_secret
15
+ @access_key_id = @access_key_id.strip if @access_key_id
16
+ @access_key_secret = @access_key_secret.strip if @access_key_secret
17
17
  end
18
18
  end # Config
19
19
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aliyun
4
4
 
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
 
7
7
  end # Aliyun
@@ -10,7 +10,7 @@ module Aliyun
10
10
  context "construct" do
11
11
  it "should setup a/k" do
12
12
  client = Client.new(
13
- :access_key_id => 'xxx', :access_key_secret => 'yyy')
13
+ :access_key_id => ' xxx', :access_key_secret => ' yyy ')
14
14
 
15
15
  config = client.instance_variable_get('@config')
16
16
  expect(config.access_key_id).to eq('xxx')
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  $LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
6
6
  require 'aliyun/oss'
7
7
 
8
- class TestObjectKey < Minitest::Test
8
+ class TestLargeFile < Minitest::Test
9
9
  def setup
10
10
  conf_file = '~/.oss.yml'
11
11
  conf = YAML.load(File.read(File.expand_path(conf_file)))
@@ -23,6 +23,8 @@ class TestObjectKey < Minitest::Test
23
23
  end
24
24
 
25
25
  def test_large_file_1gb
26
+ skip "don't run it by default"
27
+
26
28
  key = get_key("large_file_1gb")
27
29
  Benchmark.bm(32) do |bm|
28
30
  bm.report("Upload with put_object: ") do
@@ -44,6 +46,8 @@ class TestObjectKey < Minitest::Test
44
46
  end
45
47
 
46
48
  def test_large_file_8gb
49
+ skip "don't run it by default"
50
+
47
51
  key = get_key("large_file_8gb")
48
52
  Benchmark.bm(32) do |bm|
49
53
  bm.report("Upload with put_object: ") do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun-sdk
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
  - Tianlong Wu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -228,4 +228,3 @@ test_files:
228
228
  - tests/test_multipart.rb
229
229
  - tests/test_object_key.rb
230
230
  - tests/test_resumable.rb
231
- has_rdoc: