right_api_client 1.5.13 → 1.5.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,7 @@
1
1
  # CHANGELOG.md
2
+
3
+ ## 1.5.14
4
+ - \#51 Add type aliases for some Exception subclasses whose name changed; restores interface compatibility with 1.5.9
2
5
  ## 1.5.13
3
6
  - \#44 Charcoal 13 18 account id in header acu103549
4
7
  - \#42 Salmon 13 17 acu135785 add current url
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- right_api_client (1.5.13)
4
+ right_api_client (1.5.14)
5
5
  json
6
6
  rest-client (~> 1.6)
7
7
 
@@ -11,7 +11,7 @@ GEM
11
11
  diff-lcs (1.1.3)
12
12
  flexmock (0.8.7)
13
13
  json (1.8.1)
14
- mime-types (1.24)
14
+ mime-types (1.25.1)
15
15
  rake (0.8.7)
16
16
  rest-client (1.6.7)
17
17
  mime-types (>= 1.16)
@@ -2,15 +2,26 @@
2
2
  module RightApi
3
3
 
4
4
  class ApiError < RuntimeError
5
-
6
- def initialize(request, response)
7
-
8
- @request, @response = request, response
5
+ # Create a new ApiError. This accepts a parameter glob because this type is aliased to
6
+ # a removed exception type that took only one initializer argument: the response object.
7
+ # This type prefers two arguments: the request and response objects. If you pass only one
8
+ # argument, it is taken to be the response.
9
+ def initialize(*args)
10
+ case args.size
11
+ when 1
12
+ # Compatible with RightApi::Exceptions::ApiException (from 1.5.9 of the gem)
13
+ @request, @response = nil, args[0]
14
+ when 2
15
+ # Normal/preferred format
16
+ @request, @response = args[0], args[1]
17
+ else
18
+ raise ArgumentError, "wrong number of arguments (#{args.size} for 1 or 2)"
19
+ end
9
20
 
10
21
  super(
11
22
  prefix +
12
- "HTTP Code: #{response.code.to_s}, " +
13
- "Response body: #{response.body}")
23
+ "HTTP Code: #{@response.code.to_s}, " +
24
+ "Response body: #{@response.body}")
14
25
  end
15
26
 
16
27
  def prefix
@@ -0,0 +1,11 @@
1
+ module RightApi
2
+ module Exceptions
3
+ # Alias for a class that was renamed. This exists to preserve interface compatibility.
4
+ # @deprecated do not use - will be removed in right_api_client 2.0
5
+ ApiException = ::RightApi::ApiError
6
+
7
+ # Alias for a class that was renamed. This exists to preserve interface compatibility.
8
+ # @deprecated do not use - will be removed in right_api_client 2.0
9
+ UnknownRouteException = ::RightApi::UnknownRouteError
10
+ end
11
+ end
@@ -2,7 +2,7 @@
2
2
  module RightApi
3
3
  class Client
4
4
  API_VERSION = '1.5'
5
- CLIENT_VERSION = '13'
5
+ CLIENT_VERSION = '14'
6
6
  VERSION = "#{API_VERSION}.#{CLIENT_VERSION}"
7
7
  end
8
8
  end
@@ -17,7 +17,7 @@ fine details involved in making HTTP calls and translating their responses.
17
17
  }
18
18
  s.files = `git ls-files`.split(' ')
19
19
  s.test_files = `git ls-files spec config`.split(' ')
20
- s.rubygems_version = '1.8.17'
20
+ s.rubygems_version = '1.3.7'
21
21
 
22
22
  s.add_runtime_dependency 'json'
23
23
  s.add_runtime_dependency 'rest-client', '~> 1.6'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_api_client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 13
10
- version: 1.5.13
9
+ - 14
10
+ version: 1.5.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - RightScale, Inc.
@@ -15,11 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-12-03 00:00:00 Z
18
+ date: 2014-01-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: json
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
21
+ requirement: &id001 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
25
24
  - - ">="
@@ -28,12 +27,12 @@ dependencies:
28
27
  segments:
29
28
  - 0
30
29
  version: "0"
31
- prerelease: false
32
30
  type: :runtime
33
- requirement: *id001
31
+ name: json
32
+ version_requirements: *id001
33
+ prerelease: false
34
34
  - !ruby/object:Gem::Dependency
35
- name: rest-client
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
35
+ requirement: &id002 !ruby/object:Gem::Requirement
37
36
  none: false
38
37
  requirements:
39
38
  - - ~>
@@ -43,12 +42,12 @@ dependencies:
43
42
  - 1
44
43
  - 6
45
44
  version: "1.6"
46
- prerelease: false
47
45
  type: :runtime
48
- requirement: *id002
46
+ name: rest-client
47
+ version_requirements: *id002
48
+ prerelease: false
49
49
  - !ruby/object:Gem::Dependency
50
- name: rake
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
50
+ requirement: &id003 !ruby/object:Gem::Requirement
52
51
  none: false
53
52
  requirements:
54
53
  - - "="
@@ -59,12 +58,12 @@ dependencies:
59
58
  - 8
60
59
  - 7
61
60
  version: 0.8.7
62
- prerelease: false
63
61
  type: :development
64
- requirement: *id003
62
+ name: rake
63
+ version_requirements: *id003
64
+ prerelease: false
65
65
  - !ruby/object:Gem::Dependency
66
- name: rspec
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
66
+ requirement: &id004 !ruby/object:Gem::Requirement
68
67
  none: false
69
68
  requirements:
70
69
  - - "="
@@ -75,12 +74,12 @@ dependencies:
75
74
  - 9
76
75
  - 0
77
76
  version: 2.9.0
78
- prerelease: false
79
77
  type: :development
80
- requirement: *id004
78
+ name: rspec
79
+ version_requirements: *id004
80
+ prerelease: false
81
81
  - !ruby/object:Gem::Dependency
82
- name: flexmock
83
- version_requirements: &id005 !ruby/object:Gem::Requirement
82
+ requirement: &id005 !ruby/object:Gem::Requirement
84
83
  none: false
85
84
  requirements:
86
85
  - - "="
@@ -91,12 +90,12 @@ dependencies:
91
90
  - 8
92
91
  - 7
93
92
  version: 0.8.7
94
- prerelease: false
95
93
  type: :development
96
- requirement: *id005
94
+ name: flexmock
95
+ version_requirements: *id005
96
+ prerelease: false
97
97
  - !ruby/object:Gem::Dependency
98
- name: simplecov
99
- version_requirements: &id006 !ruby/object:Gem::Requirement
98
+ requirement: &id006 !ruby/object:Gem::Requirement
100
99
  none: false
101
100
  requirements:
102
101
  - - "="
@@ -107,12 +106,12 @@ dependencies:
107
106
  - 4
108
107
  - 2
109
108
  version: 0.4.2
110
- prerelease: false
111
109
  type: :development
112
- requirement: *id006
110
+ name: simplecov
111
+ version_requirements: *id006
112
+ prerelease: false
113
113
  - !ruby/object:Gem::Dependency
114
- name: bundler
115
- version_requirements: &id007 !ruby/object:Gem::Requirement
114
+ requirement: &id007 !ruby/object:Gem::Requirement
116
115
  none: false
117
116
  requirements:
118
117
  - - ">="
@@ -121,9 +120,10 @@ dependencies:
121
120
  segments:
122
121
  - 0
123
122
  version: "0"
124
- prerelease: false
125
123
  type: :development
126
- requirement: *id007
124
+ name: bundler
125
+ version_requirements: *id007
126
+ prerelease: false
127
127
  description: "\n\
128
128
  The right_api_client gem simplifies the use of RightScale's MultiCloud API.\n\
129
129
  It provides a simple object model of the API resources, and handles all of the\n\
@@ -148,6 +148,7 @@ files:
148
148
  - lib/right_api_client.rb
149
149
  - lib/right_api_client/client.rb
150
150
  - lib/right_api_client/errors.rb
151
+ - lib/right_api_client/exceptions.rb
151
152
  - lib/right_api_client/helper.rb
152
153
  - lib/right_api_client/resource.rb
153
154
  - lib/right_api_client/resource_detail.rb