azure-core 0.1.1 → 0.1.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzNmMGRkZDc4YTliMWI1MjZkNzc4NzgwYjkyZDA4OWNjNGMzMDQ3OA==
4
+ YWZmZjQ2MWFkOGQ5NmExYzVmYzFhYmRiYThjYjZkZTFiNzEyY2YyNQ==
5
5
  data.tar.gz: !binary |-
6
- NmY4MjkwZGQxZjY3MmE4Yzk4Mjg2YWFiNWVjNTc4ZGJkYjU2ZDExMQ==
6
+ ZWJlN2Q0MTEwMjZkMzI0YmJkZjA4ZDNjNzE3MTlmZTc3ZTFhNjFlNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWI0N2E5NzNkNWFjOGRhNDk5MDQ1OTVmNjI5ZTA0NjkzZmI1YTUwN2Q1MDdi
10
- MzQyNWQ2YWI3YjY4OWQxZTczMDdmMTU5MDhiMzYyZGE2MTIxZmU0YThlNDg4
11
- OGE4YzQxZTNlNDBiOGI3Y2Y2ODg4MzA1YzMwMGVjNzE4NjNhYzQ=
9
+ MWIzODE0NjU3MDY0ODBjZTFiZThlMzE2YzkwZDViYmViMzlmMzViNWFjMDJm
10
+ YWM2NGYxYTBkZTYxZjVhYTYwYTEzZDE4ODUwNDc5NDVhNTNhYTEyMWUxOWRk
11
+ N2EyMThjZTE3NzkwNzEzMmQwMTJiYTc4MzIxNDA4NmJkMTk2YTk=
12
12
  data.tar.gz: !binary |-
13
- OWM3ZGIyMjc0OWE2M2VjZjMzN2VlZTI5M2YzNDFjYmZmZjdhN2YxMjBlODJk
14
- ZGRmODlmNzY2ODMxZTdkOWIxMzQ5MDhmNmY1YTQ2ZTc4MmY3MjU5ZTAwYWY2
15
- MTRjMDJmMzc5MGE2ZmQzNTI5NWVlNjQzMjI1Y2E0ZWI3MTZkNzk=
13
+ MWJjYTVmMzE5ODZhYThhZmNjODhiMmFjNjFkYzYwOWY1MDA5ZWJkMjEwZmJh
14
+ NDA2NmY2NTJjNjkyMWFmMzE0ZjExYzMzNTUxZDc0NjViNmUxYjY5YzYxYWU4
15
+ NGM4ZDk1ZjY0YmViOTFhN2JmNDgwZGM0NmYxMzZjYmZhMzY2MTE=
@@ -12,7 +12,6 @@ deploy:
12
12
  provider: rubygems
13
13
  api_key:
14
14
  secure: EN/hvsyyZq4bOxJgJXVP8AttRsn9ajYrtsg47bVcPHtSXP52mT1r800FC50l1V1MoeNPrgjO8WjVY37rR/FerDsdt0rujakfseKOpCeosAX8hbJ2zVcyOnU16TmkNUAqKKprHkvw/8dnNEYmeyUo+VZmizxVhieur8yitKWiP08Ab1ehA8sDfcGsusnE/Las7fyiiCqMfFQJsJWJimIXNYF6pGZs+6l1YE2sH5S4wKLf09+jhP4WZ6nXcYlyUViLqieMx3US1a9jVV534QSIVYk7Z8PdP4eJm4P46UJ1YPc85DceLAZh2dno5l+Eyk16UYBgPichWEqQf3+0SaNKxNDkNYmXPkxNbajIKFLAsTs7CBwhwK3CxfgDok2P3jcB9iJg3ZlWFD6fMxr1Tca1cEkLpxj8S7peB4St0AwVeaEXfUHIDHb706PbOOoy5BOuK+aDotz0/sHQTOHSAPD4IhZ3+GKCkV4NOV2fxKTWXYK1NSx76jyBW3gnSsy9OWKhKxEXaVLB3J1i5dKUw1l4YBJuRATw2GbimMqQf0EpXukXE/fKugU4+EQUZwoIe85GrjaJrU/LXMpp8lBoh5dPZOxtEXGp6cJWcl239FUVSY17Wf/H8cTpahhNR+PNHUyavC2syPOqxrzNKmfNN3bWFm6iJkYCNI2bFxpUB/Ky+Vc=
15
- gemspec: azure-core.gemspec
16
15
  gem: azure-core
17
16
  on:
18
17
  tags: true
@@ -1,3 +1,6 @@
1
+ # 2016.5.16 - azure-core gem @version 0.1.2
2
+ * Return response instead of raising exception when there is a retry filter [#8](https://github.com/Azure/azure-ruby-asm-core/pull/8)
3
+
1
4
  ## 2016.4.18 - azure-core gem @version 0.1.1
2
5
  * Can not upload file with spaces [#360](https://github.com/Azure/azure-sdk-for-ruby/issues/360)
3
6
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Azure::Core
2
2
 
3
+ [![Build Status](https://travis-ci.org/Azure/azure-ruby-asm-core.png?branch=master)](https://travis-ci.org/Azure/azure-ruby-asm-core)
4
+
3
5
  This project provides a Ruby package with core functionality consumed by Azure SDK gems.
4
6
 
5
7
  ## Installation
@@ -19,6 +19,7 @@ require 'time'
19
19
 
20
20
  require 'azure/core/version'
21
21
  require 'azure/core/http/http_response'
22
+ require 'azure/core/http/retry_policy'
22
23
  require 'azure/core/default'
23
24
  require 'azure/http_response_helper'
24
25
 
@@ -46,6 +47,9 @@ module Azure
46
47
  # Azure client which contains configuration context and http agents
47
48
  # @return [Azure::Client]
48
49
  attr_accessor :client
50
+
51
+ # The http filter
52
+ attr_accessor :has_retry_filter
49
53
 
50
54
  # Public: Create the HttpRequest
51
55
  #
@@ -92,19 +96,20 @@ module Azure
92
96
  def with_filter(filter=nil, &block)
93
97
  filter = filter || block
94
98
  if filter
95
- old_impl = self._method(:call)
99
+ @has_retry_filter = filter.is_a? Azure::Core::Http::RetryPolicy
100
+ original_call = self._method(:call)
96
101
 
97
102
  # support 1.8.7 (define_singleton_method doesn't exist until 1.9.1)
98
- new_impl = Proc.new do
99
- filter.call(self, old_impl)
103
+ filter_call = Proc.new do
104
+ filter.call(self, original_call)
100
105
  end
101
106
  k = class << self;
102
107
  self;
103
108
  end
104
109
  if k.method_defined? :define_singleton_method
105
- self.define_singleton_method(:call, new_impl)
110
+ self.define_singleton_method(:call, filter_call)
106
111
  else
107
- k.send(:define_method, :call, new_impl)
112
+ k.send(:define_method, :call, filter_call)
108
113
  end
109
114
  end
110
115
  end
@@ -149,7 +154,7 @@ module Azure
149
154
 
150
155
  response = HttpResponse.new(res)
151
156
  response.uri = uri
152
- raise response.error unless response.success?
157
+ raise response.error if !response.success? && !@has_retry_filter
153
158
  response
154
159
  end
155
160
 
@@ -18,7 +18,7 @@ module Azure
18
18
  class Version
19
19
  MAJOR = 0 unless defined? MAJOR
20
20
  MINOR = 1 unless defined? MINOR
21
- UPDATE = 1 unless defined? UPDATE
21
+ UPDATE = 2 unless defined? UPDATE
22
22
  PRE = nil unless defined? PRE
23
23
 
24
24
  class << self
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
  #--------------------------------------------------------------------------
15
+ require "azure/core/http/retry_policy"
15
16
  require "pathname"
16
17
 
17
18
  module Azure
@@ -36,6 +37,16 @@ module Azure
36
37
  def Fixtures.xml?(fixture)
37
38
  file?("#{fixture}.xml")
38
39
  end
40
+
41
+ class FixtureRetryPolicy < Azure::Core::Http::RetryPolicy
42
+ def initialize
43
+ super &:should_retry?
44
+ end
45
+
46
+ def should_retry?(response, retry_data)
47
+ retry_data[:error].inspect.include?('Error: Retry')
48
+ end
49
+ end
39
50
 
40
51
  end
41
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-18 00:00:00.000000000 Z
12
+ date: 2016-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday