azure-storage 0.10.1.preview → 0.10.2.preview
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/azure/storage.rb +2 -4
- data/lib/azure/storage/blob/blob_service.rb +1 -1
- data/lib/azure/storage/client.rb +6 -1
- data/lib/azure/storage/client_options.rb +7 -6
- data/lib/azure/storage/client_options_error.rb +2 -0
- data/lib/azure/storage/configurable.rb +7 -3
- data/lib/azure/storage/default.rb +1 -1
- data/lib/azure/storage/service/storage_service.rb +19 -1
- data/lib/azure/storage/service/storage_service_properties.rb +1 -1
- data/lib/azure/storage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31054294abe6fc2b3f0dcb87d286291e9dfe0766
|
4
|
+
data.tar.gz: 0d4555ce667aabb5dfd2f1d49d7d28b09ff0bd7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3bdddb9899c6ad7f4680a8350b6351ddcf4a7ae29dace4cd1daf5ca27053a19e1503881b521ac364d08be1b6c5b1b97c275378e12dd5655c00b020a2d6077ef
|
7
|
+
data.tar.gz: a473487c90bad59cac0a335e3d58df1405da2c70ee816cf717295f0ae09cf4061e0fb2789dc46da37e7fc9ddab529047b5bd0d0f1e9ffa35d93f6d4d4680147a
|
data/lib/azure/storage.rb
CHANGED
@@ -40,7 +40,7 @@ module Azure
|
|
40
40
|
include Azure::Storage::Configurable
|
41
41
|
|
42
42
|
def client(options={})
|
43
|
-
@client = Azure::Storage::Client.new(options)
|
43
|
+
@client = Azure::Storage::Client.new(options) unless defined?(@client) && @client.same_options?(options)
|
44
44
|
@client
|
45
45
|
end
|
46
46
|
|
@@ -53,6 +53,4 @@ module Azure
|
|
53
53
|
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
57
|
-
Azure::Storage.setup
|
58
|
-
end
|
56
|
+
end
|
data/lib/azure/storage/client.rb
CHANGED
@@ -47,7 +47,7 @@ module Azure::Storage
|
|
47
47
|
#
|
48
48
|
# Accepted key/value pairs in options parameter are:
|
49
49
|
#
|
50
|
-
# * +:use_development_storage+ -
|
50
|
+
# * +:use_development_storage+ - True. Whether to use storage emulator.
|
51
51
|
# * +:development_storage_proxy_uri+ - String. Used with +:use_development_storage+ if emulator is hosted other than localhost.
|
52
52
|
# * +:storage_account_name+ - String. The name of the storage account.
|
53
53
|
# * +:storage_access_key+ - Base64 String. The access key of the storage account.
|
@@ -77,6 +77,11 @@ module Azure::Storage
|
|
77
77
|
#
|
78
78
|
# @return [Azure::Storage::Client]
|
79
79
|
def initialize(options = {})
|
80
|
+
if options.is_a?(Hash)
|
81
|
+
options = setup_options if options.length == 0
|
82
|
+
options = parse_connection_string(options[:storage_connection_string]) if options[:storage_connection_string]
|
83
|
+
end
|
84
|
+
|
80
85
|
reset!(options)
|
81
86
|
end
|
82
87
|
|
@@ -80,6 +80,11 @@ module Azure::Storage
|
|
80
80
|
self
|
81
81
|
end
|
82
82
|
|
83
|
+
# Check if this client is configured with the same options
|
84
|
+
def same_options?(opts)
|
85
|
+
opts.length == 0 || opts.hash == options.hash
|
86
|
+
end
|
87
|
+
|
83
88
|
# The options after validated and normalized
|
84
89
|
#
|
85
90
|
# @return [Hash]
|
@@ -147,11 +152,6 @@ module Azure::Storage
|
|
147
152
|
|
148
153
|
private
|
149
154
|
|
150
|
-
# Check if this client is configured with the same options
|
151
|
-
def same_options?(opts)
|
152
|
-
opts.hash == input.hash
|
153
|
-
end
|
154
|
-
|
155
155
|
def method_missing(method_name)
|
156
156
|
return super unless options.key? method_name
|
157
157
|
options[method_name]
|
@@ -230,7 +230,7 @@ module Azure::Storage
|
|
230
230
|
rescue InvalidOptionsError => e
|
231
231
|
end
|
232
232
|
|
233
|
-
raise InvalidOptionsError,"options provided are not valid set: #{
|
233
|
+
raise InvalidOptionsError,"options provided are not valid set: #{opts}" # wrong opts if move to this line
|
234
234
|
end
|
235
235
|
|
236
236
|
def normalize_hosts(options)
|
@@ -293,6 +293,7 @@ module Azure::Storage
|
|
293
293
|
|
294
294
|
valid_options = required + at_least_one + only_one + optional
|
295
295
|
results = {}
|
296
|
+
|
296
297
|
opts.each do |k,v|
|
297
298
|
raise InvalidOptionsError,"#{k} is not included in valid options" unless valid_options.length == 0 || valid_options.include?(k)
|
298
299
|
unless @@option_validators.key?(k) && @@option_validators[k].call(v)
|
@@ -126,11 +126,15 @@ module Azure::Storage
|
|
126
126
|
private
|
127
127
|
|
128
128
|
def default_host(service)
|
129
|
-
"https://#{storage_account_name}.#{service}.core.windows.net"
|
129
|
+
"https://#{storage_account_name}.#{service}.core.windows.net" if storage_account_name
|
130
130
|
end
|
131
131
|
|
132
|
-
def
|
133
|
-
|
132
|
+
def setup_options
|
133
|
+
opts = {}
|
134
|
+
Azure::Storage::Configurable.keys.map do |key|
|
135
|
+
opts[key] = Azure::Storage.send(key) if Azure::Storage.send(key)
|
136
|
+
end
|
137
|
+
opts
|
134
138
|
end
|
135
139
|
|
136
140
|
end
|
@@ -28,7 +28,7 @@ require 'azure/storage/version'
|
|
28
28
|
module Azure::Storage
|
29
29
|
module Default
|
30
30
|
# Default REST service (STG) version number
|
31
|
-
STG_VERSION = '2015-
|
31
|
+
STG_VERSION = '2015-04-05'
|
32
32
|
|
33
33
|
# The number of default concurrent requests for parallel operation.
|
34
34
|
DEFAULT_PARALLEL_OPERATION_THREAD_COUNT = 1
|
@@ -85,6 +85,24 @@ module Azure::Storage
|
|
85
85
|
query.update(restype: 'service', comp: 'properties')
|
86
86
|
generate_uri('', query)
|
87
87
|
end
|
88
|
+
|
89
|
+
# Overrides the base class implementation to determine the request uri
|
90
|
+
#
|
91
|
+
# path - String. the request path
|
92
|
+
# query - Hash. the query parameters
|
93
|
+
#
|
94
|
+
# Returns the uri hash
|
95
|
+
def generate_uri(path='', query={})
|
96
|
+
if self.client.is_a?(Azure::Storage::Client) && self.client.options[:use_path_style_uri]
|
97
|
+
if path.length > 0
|
98
|
+
path = self.client.options[:storage_account_name] + '/' + path
|
99
|
+
else
|
100
|
+
path = self.client.options[:storage_account_name]
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
super path, query
|
105
|
+
end
|
88
106
|
|
89
107
|
class << self
|
90
108
|
# Adds metadata properties to header hash with required prefix
|
@@ -133,4 +151,4 @@ module Azure::Storage
|
|
133
151
|
|
134
152
|
end
|
135
153
|
end
|
136
|
-
end
|
154
|
+
end
|
@@ -28,7 +28,7 @@ module Azure
|
|
28
28
|
# Fields represent the parts defined in http://semver.org/
|
29
29
|
MAJOR = 0 unless defined? MAJOR
|
30
30
|
MINOR = 10 unless defined? MINOR
|
31
|
-
UPDATE =
|
31
|
+
UPDATE = 2 unless defined? UPDATE
|
32
32
|
PRE = 'preview' unless defined? PRE
|
33
33
|
|
34
34
|
class << self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2.preview
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|