aliyun-sdk 0.3.6 → 0.3.7

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: adaf526c24ef420d2ee095742e60eb898656a67f
4
- data.tar.gz: 9a3827d7efe46ebce561983a42cad93d56036dc4
3
+ metadata.gz: f304be3ae5b8631ce2fba50d0d0b8d7e6635eb79
4
+ data.tar.gz: 7393a38208b5effa30efed0db2758d499f79afa4
5
5
  SHA512:
6
- metadata.gz: ac6518e978b92b880614513e46ee00e34f5224c497cb9522e4419e49f01d71ea077b61d9cfda680f18fde9dd8c52871e59d8b06c5b4bb2c5d61b93c408eecdd9
7
- data.tar.gz: 8cfc5141a37ab81d18b9e26dba0046c2cf7eda11501b5b25313e85d17847b0f5f4fc288d06ddec21d6d7722f212a7e88d150916cc0a1b45104db84decfcce516
6
+ metadata.gz: 2affe8557b33db121bfb3ba8cb123c4c16ee8f204fa1fa1f3a6583a8e1592c936c03a3a576e24eb21fb7ba290f56920df2d85a722793501af9359806c3a723ca
7
+ data.tar.gz: 475ea25895a767732e9fc912d22db312e4d7ffde00ae16d253cbd3baf8d343a3d68f919562c1a2dadb910e124de02fb95d60658ba32979cd496790417b9fc33f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Change Log
2
2
 
3
+ ### v0.3.7
4
+
5
+ - Remove monkey patch for Hash
6
+
3
7
  ### v0.3.6
4
8
 
5
9
  - Fix Zlib::Inflate in ruby-1.9.x
@@ -43,7 +43,7 @@ module Aliyun
43
43
  @mutex.synchronize {
44
44
  states = JSON.load(File.read(file))
45
45
  }
46
- states.symbolize_keys!
46
+ states = Util.symbolize(states)
47
47
  md5 = states.delete(:md5)
48
48
 
49
49
  fail CheckpointBrokenError, "Missing MD5 in checkpoint." unless md5
@@ -60,6 +60,21 @@ module Aliyun
60
60
  Base64.strict_encode64(OpenSSL::Digest::MD5.digest(content))
61
61
  end
62
62
 
63
+ # Symbolize keys in Hash, recursively
64
+ def symbolize(v)
65
+ if v.is_a?(Hash)
66
+ result = {}
67
+ v.each_key { |k| result[k.to_sym] = symbolize(v[k]) }
68
+ result
69
+ elsif v.is_a?(Array)
70
+ result = []
71
+ v.each { |x| result << symbolize(x) }
72
+ result
73
+ else
74
+ v
75
+ end
76
+ end
77
+
63
78
  end # self
64
79
  end # Util
65
80
  end # OSS
@@ -72,18 +87,3 @@ class String
72
87
  false
73
88
  end
74
89
  end
75
-
76
- # Monkey patch to support #symbolize_keys!
77
- class Array
78
- def symbolize_keys!
79
- self.each { |v| v.symbolize_keys! if v.is_a?(Hash) or v.is_a?(Array) }
80
- end
81
- end
82
-
83
- # Monkey patch to support #symbolize_keys!
84
- class Hash
85
- def symbolize_keys!
86
- self.keys.each { |k| self[k.to_sym] = self.delete(k) }
87
- self.values.each { |v| v.symbolize_keys! if v.is_a?(Hash) or v.is_a?(Array) }
88
- end
89
- end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aliyun
4
4
 
5
- VERSION = "0.3.6"
5
+ VERSION = "0.3.7"
6
6
 
7
7
  end # Aliyun
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.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tianlong Wu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-29 00:00:00.000000000 Z
11
+ date: 2016-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri