manageiq-api-client 0.1.1 → 0.2.0

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: b2f3fc3259917c28315986dcfe8d5ac1c7ca71ea
4
- data.tar.gz: 0c5fccb4b827c34e2428874d0ba7c30cb051fe76
3
+ metadata.gz: 3537abcdd5d9a79fa4e54c352dc010a541c4ce87
4
+ data.tar.gz: f2756d0fe7d77fa904f6862d0299c96dea29bd0e
5
5
  SHA512:
6
- metadata.gz: e7e688118186845b13fb5f450822cec127e24bd7316256fd503d7435585d23fe24977790c58f39ab5480272d145f85bf50924bf4fd3390d8241af15f73216fef
7
- data.tar.gz: 26b746cc6614f7514967d4f3ed9a56bdd134426fd359d3b7e87bc950e6db15660246b0edb822d892a7bd090cfa92c8a87965a783296d067f14536c96428da90f
6
+ metadata.gz: 0fc3127e3de0055f0c7b34a729877cf80c74a752939485d9ab0b344cb6c2de22754a0171de7b8db47bdb67ea8e3c3a0841aefe2228c512b1afe5cf673bea305e
7
+ data.tar.gz: a5b0d7472fc865e6fe80569a3358ac419302b455ad1278949459a1b301c26069305fd96babebc87c62fa424eac9f87580c8f237b8ba2336067ab67d3bb8849fc
@@ -6,10 +6,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.0] - 2017-02-24
10
+
11
+ ### Changed
12
+ - **BREAKING** Client's `settings` is renamed to `user_settings` to avoid collision with API's `settings` collection [[#57](https://github.com/ManageIQ/manageiq-api-client/pull/57)]
13
+ - Loosen ActiveSupport dependency [[#64](https://github.com/ManageIQ/manageiq-api-client/pull/64)]
14
+
15
+ ### Fixed
16
+ - Fix Client::Error to support Rails errors (routing, etc) [[#58](https://github.com/ManageIQ/manageiq-api-client/pull/58)]
17
+ - When fetching the entrypoint a / is appended to the URL [[#59](https://github.com/ManageIQ/manageiq-api-client/pull/59)]
18
+
9
19
  ## [0.1.1]
20
+
10
21
  ### Added
11
22
  - Add CHANGELOG.md
12
23
  - Update README with simple instructions reflecting the query interface.
13
24
 
14
25
  [Unreleased]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.1...HEAD
15
26
  [0.1.1]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.0...v0.1.1
27
+ [0.2.0]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.1...v0.2.0
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
+ gem "webmock"
7
8
  gem "simplecov", :require => false
8
9
  gem "codeclimate-test-reporter", "~> 1.0.0", :require => false
9
10
  end
@@ -8,7 +8,7 @@ module ManageIQ
8
8
  attr_reader :connection
9
9
 
10
10
  attr_reader :api
11
- attr_reader :settings
11
+ attr_reader :user_settings
12
12
  attr_reader :identity
13
13
  attr_reader :authorization
14
14
  attr_reader :server_info
@@ -36,7 +36,7 @@ module ManageIQ
36
36
  def load_definitions
37
37
  entrypoint = connection.get("", :attributes => "authorization")
38
38
  @api = ManageIQ::API::Client::API.new(entrypoint)
39
- @settings = Hash(entrypoint["settings"]).dup
39
+ @user_settings = Hash(entrypoint["settings"]).dup
40
40
  @identity = ManageIQ::API::Client::Identity.new(Hash(entrypoint["identity"]))
41
41
  @authorization = Hash(entrypoint["authorization"]).dup
42
42
  @server_info = ServerInfo.new(Hash(entrypoint["server_info"]))
@@ -60,6 +60,8 @@ module ManageIQ
60
60
  def api_path(path)
61
61
  if path.to_s.starts_with?(url.to_s)
62
62
  path.to_s
63
+ elsif path.to_s.blank?
64
+ URI.join(url, API_PREFIX).to_s
63
65
  else
64
66
  URI.join(url, path.to_s.starts_with?(API_PREFIX) ? path.to_s : "#{API_PREFIX}/#{path}").to_s
65
67
  end
@@ -18,9 +18,13 @@ module ManageIQ
18
18
  def update(status, json_response = {})
19
19
  @status = status
20
20
  @kind, @message, @klass = nil
21
- error_hash = json_response["error"]
22
- if status >= 400 && error_hash.present?
23
- @kind, @message, @klass = error_hash.values_at("kind", "message", "klass")
21
+ error = json_response["error"]
22
+ if status >= 400 && error.present?
23
+ if error.kind_of?(Hash)
24
+ @kind, @message, @klass = error.values_at("kind", "message", "klass")
25
+ else
26
+ @message = error
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -1,7 +1,7 @@
1
1
  module ManageIQ
2
2
  module API
3
3
  class Client
4
- VERSION = "0.1.1".freeze
4
+ VERSION = "0.2.0".freeze
5
5
  end
6
6
  end
7
7
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
29
 
30
- spec.add_dependency "activesupport", "~> 5.0.0"
30
+ spec.add_dependency "activesupport", "~> 5.0"
31
31
  spec.add_dependency "faraday", "~> 0.9.2"
32
32
  spec.add_dependency "faraday_middleware", "~> 0.10.0"
33
33
  spec.add_dependency "json", "~> 2.0.1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Bellotti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-11-17 00:00:00.000000000 Z
12
+ date: 2017-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 5.0.0
62
+ version: '5.0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 5.0.0
69
+ version: '5.0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: faraday
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  requirements: []
201
201
  rubyforge_project:
202
- rubygems_version: 2.5.1
202
+ rubygems_version: 2.5.2
203
203
  signing_key:
204
204
  specification_version: 4
205
205
  summary: ManageIQ API Client