ansible_tower_client 0.4.0 → 0.4.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acc09f7903cf4344a5aecf388e01e96ec4ddbacb
4
- data.tar.gz: 1f9c7426089f8e860848e95a5fc10cb73d7748fd
3
+ metadata.gz: 3b2dc19710dcd49dc3f01afcb0c098c05b493ada
4
+ data.tar.gz: 2b4c93dc99dd27fe22da7772d84f4b525705a575
5
5
  SHA512:
6
- metadata.gz: e2907f826fc08aded95a7db83c5278a410cdc7ac1be5c770d30fc92658c12bb551e8df55073b02afdcb1375c952be321be13da6749135492155bd3bd99639a9c
7
- data.tar.gz: a235ecafbf062ed0e5e5bba221383ea808943d3823fb8b2f7fbbc743d8a407ccc06fe6acb9fac6774ae578e92ecb8c9cf550a8e2c866762bda585adfc7674cb0
6
+ metadata.gz: 9f83694a37572b9605ef8c8ab3427beac58c12d568c4d535dbe1b751b18a4206a9f3912b6ade318ed6b2ac0e0e6dbebc1d3a7d95bdeec613cb160c5d5467c1d4
7
+ data.tar.gz: 36e5f3499c43259246444b49f65a8b89328c6f811c54c0303ccf85d097692da1841252c0a2fa8e4a2c1ea6f579e111e586745c5f90cc3627671e34ec6fb48685
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # AnsibleTowerClient
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/ansible_tower_client.svg)](http://badge.fury.io/rb/ansible_tower_client)
4
- [![Build Status](https://travis-ci.org/ManageIQ/ansible_tower_client.svg)](https://travis-ci.org/ManageIQ/ansible_tower_client)
5
- [![Code Climate](https://codeclimate.com/github/ManageIQ/ansible_tower_client/badges/gpa.svg)](https://codeclimate.com/github/ManageIQ/ansible_tower_client)
6
- [![Dependency Status](https://gemnasium.com/ManageIQ/ansible_tower_client.svg)](https://gemnasium.com/ManageIQ/ansible_tower_client)
7
- [![Coverage Status](http://img.shields.io/coveralls/ManageIQ/ansible_tower_client.svg)](https://coveralls.io/r/ManageIQ/ansible_tower_client)
8
- [![Security](https://hakiri.io/github/ManageIQ/ansible_tower_client/master.svg)](https://hakiri.io/github/ManageIQ/ansible_tower_client/master)
4
+ [![Build Status](https://travis-ci.org/ansible/ansible_tower_client_ruby.svg)](https://travis-ci.org/ansible/ansible_tower_client_ruby)
5
+ [![Code Climate](https://codeclimate.com/github/ansible/ansible_tower_client_ruby/badges/gpa.svg)](https://codeclimate.com/github/ansible/ansible_tower_client_ruby)
6
+ [![Dependency Status](https://gemnasium.com/ansible/ansible_tower_client_ruby.svg)](https://gemnasium.com/ansible/ansible_tower_client_ruby)
7
+ [![Coverage Status](http://img.shields.io/coveralls/ansible/ansible_tower_client_ruby.svg)](https://coveralls.io/r/ansible/ansible_tower_client_ruby)
8
+ [![Security](https://hakiri.io/github/ansible/ansible_tower_client_ruby/master.svg)](https://hakiri.io/github/ansible/ansible_tower_client_ruby/master)
9
9
 
10
10
  ## Installation
11
11
 
@@ -23,10 +23,6 @@ Or install it yourself as:
23
23
 
24
24
  $ gem install ansible_tower_client
25
25
 
26
- ## Usage
27
-
28
- TODO: Write usage instructions here
29
-
30
26
  ## Development
31
27
 
32
28
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -35,7 +31,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
35
31
 
36
32
  ## Contributing
37
33
 
38
- Bug reports and pull requests are welcome on GitHub at https://github.com/ManageIQ/ansible_tower_client.
34
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Ansible/ansible_tower_client_ruby.
39
35
 
40
36
  ## License
41
37
 
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{Ansible Tower REST API wrapper gem}
13
13
  spec.description = %q{Ansible Tower REST API wrapper gem}
14
- spec.homepage = "https://github.com/ManageIQ/ansible_tower_client"
14
+ spec.homepage = "https://github.com/Ansible/ansible_tower_client_ruby"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -1,5 +1,9 @@
1
+ require 'pp'
2
+
1
3
  module AnsibleTowerClient
2
4
  class Api < Connection
5
+ include Logging
6
+
3
7
  attr_reader :instance
4
8
  def initialize(connection)
5
9
  @instance = connection
@@ -50,12 +54,22 @@ module AnsibleTowerClient
50
54
  end
51
55
 
52
56
  def method_missing(method_name, *args, &block)
53
- instance.respond_to?(method_name) ? instance.send(method_name, *args, &block) : super
57
+ if instance.respond_to?(method_name)
58
+ logger.debug { "#{self.class.name} Sending <#{method_name}> with <#{args.inspect}>" }
59
+ instance.send(method_name, *args, &block).tap do |response|
60
+ logger.debug { "#{self.class.name} Response:\n#{JSON.parse(response.body).pretty_inspect}" }
61
+ end
62
+ else
63
+ super
64
+ end
54
65
  rescue Faraday::ConnectionFailed, Faraday::SSLError => err
55
66
  raise
56
67
  rescue Faraday::ClientError => err
57
- message = JSON.parse(err.message)['detail'] rescue nil
68
+ response = err.response
69
+ logger.debug { "#{self.class.name} #{err.class.name} #{response.pretty_inspect}" }
70
+ message = JSON.parse(response[:body])['detail'] rescue nil
58
71
  message ||= "An unknown error was returned from the provider"
72
+ logger.error("#{self.class.name} #{err.class.name} #{message}")
59
73
  raise AnsibleTowerClient::ConnectionError, message
60
74
  end
61
75
 
@@ -7,5 +7,9 @@ module AnsibleTowerClient
7
7
 
8
8
  def add(*_args, &_block)
9
9
  end
10
+
11
+ def debug?
12
+ false
13
+ end
10
14
  end
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module AnsibleTowerClient
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansible_tower_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Dunne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-10-11 00:00:00.000000000 Z
12
+ date: 2016-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -175,7 +175,7 @@ files:
175
175
  - lib/ansible_tower_client/null_logger.rb
176
176
  - lib/ansible_tower_client/v2/job_template_v2.rb
177
177
  - lib/ansible_tower_client/version.rb
178
- homepage: https://github.com/ManageIQ/ansible_tower_client
178
+ homepage: https://github.com/Ansible/ansible_tower_client_ruby
179
179
  licenses:
180
180
  - MIT
181
181
  metadata: {}