ansible_tower_client 0.10.0 → 0.11.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: 3b193455d85ca3339c34fa6a5c81ceef256f6c6f
4
- data.tar.gz: 32d45db82bdbde5e1eaab49268d042920b7b6818
3
+ metadata.gz: 8b3555fc824c01e90923150be087d089ee91f7ea
4
+ data.tar.gz: d46e9936d77a188a841826484284e4b4a0da4cc3
5
5
  SHA512:
6
- metadata.gz: 8a3b6a6ab60cb681edcf7cf2209c4956c91c086831817f521a017970fd2b7e65aaec505503e269a2ae1489bd0cd2424c4d337f4196a2470ba9f39eaeb53a647d
7
- data.tar.gz: fd1af49c0c8e8bc629888064af9c5601f0d047a1eaa5600a711a58aa1373c30127d0e12297a2a37c922bb0c581bc0b5ddf30c426bbd5fd0849712409bbd425b8
6
+ metadata.gz: 59bb794ead947894b115c5b57e9b3e812f56bc53d55a2f7b9b1adb9dc4e395bae19d6f87b89fbdf2645664298b40e85459f4d924a862a26c5aa04bfa5e0e94bf
7
+ data.tar.gz: 7e7089772810da5baa0b38d6950a0a7eb22e446527106b6b3ec749250a93e6b9145a5c74b4adedd0b13e645014e65304c0ae50c26ffcca3b0fb95346e5fa546d
data/.gitignore CHANGED
@@ -9,4 +9,4 @@
9
9
  /spec/reports/
10
10
  /tmp/
11
11
  .byebug_history
12
- .rubocop.yml
12
+ .rubocop-*
@@ -0,0 +1,4 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/ManageIQ/guides/master/.rubocop_base.yml
3
+ # put all local rubocop config into .rubocop_local.yml as it will be loaded by .rubocop_cc.yml as well
4
+ - .rubocop_local.yml
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.2"
3
+ - "2.3.1"
4
4
  sudo: false
5
5
  cache: bundler
6
6
  before_install: gem install bundler -v 1.10.3
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.11.0] - 2017-04-10
9
+ ### Added
10
+ - Add ProjectUpdate and expose Project#update [(#82)](https://github.com/ansible/ansible_tower_client_ruby/pull/82)
11
+
8
12
  ## [0.10.0] - 2017-03-23
9
13
  ### Added
10
14
  - Allow formatted stdout, default to plain text [(#80)](https://github.com/ansible/ansible_tower_client_ruby/pull/80)
@@ -40,7 +44,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
40
44
  ### Fixed
41
45
  - Adjusted project_spec to test on a Project [(#63)](https://github.com/ansible/ansible_tower_client_ruby/pull/63)
42
46
 
43
- [Unreleased]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.9.0...master
47
+ [Unreleased]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.11.0...master
48
+ [0.11.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.10.0...v0.11.0
49
+ [0.10.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.9.0...v0.10.0
44
50
  [0.9.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.8.0...v0.9.0
45
51
  [0.8.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.7.0...v0.8.0
46
52
  [0.7.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.6.0...v0.7.0
@@ -25,6 +25,7 @@ require "ansible_tower_client/base_models/job_play"
25
25
  require "ansible_tower_client/base_models/job_template"
26
26
  require "ansible_tower_client/base_models/organization"
27
27
  require "ansible_tower_client/base_models/project"
28
+ require "ansible_tower_client/base_models/project_update"
28
29
 
29
30
  require "ansible_tower_client/v2/job_template_v2"
30
31
 
@@ -79,6 +79,10 @@ module AnsibleTowerClient
79
79
  Collection.new(self, project_class)
80
80
  end
81
81
 
82
+ def project_updates
83
+ Collection.new(self, project_update_class)
84
+ end
85
+
82
86
  def method_missing(method_name, *args, &block)
83
87
  if instance.respond_to?(method_name)
84
88
  path = build_path_to_resource(args.shift)
@@ -166,6 +170,10 @@ module AnsibleTowerClient
166
170
  @project_class ||= AnsibleTowerClient::Project
167
171
  end
168
172
 
173
+ def project_update_class
174
+ @project_update_class ||= AnsibleTowerClient::ProjectUpdate
175
+ end
176
+
169
177
  private
170
178
 
171
179
  def build_path_to_resource(original)
@@ -3,5 +3,19 @@ module AnsibleTowerClient
3
3
  def playbooks
4
4
  Collection.new(api).find_all_by_url(related['playbooks'])
5
5
  end
6
+
7
+ def can_update?
8
+ response = api.get(related['update'].to_s).body
9
+ updatable = JSON.parse(response)
10
+
11
+ updatable['can_update']
12
+ end
13
+
14
+ def update
15
+ response = api.post(related['update'].to_s).body
16
+ update = JSON.parse(response)
17
+
18
+ api.project_updates.find(update['project_update'])
19
+ end
6
20
  end
7
21
  end
@@ -0,0 +1,4 @@
1
+ module AnsibleTowerClient
2
+ class ProjectUpdate < BaseModel
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module AnsibleTowerClient
2
- VERSION = "0.10.0".freeze
2
+ VERSION = "0.11.0".freeze
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.10.0
4
+ version: 0.11.0
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: 2017-03-23 00:00:00.000000000 Z
12
+ date: 2017-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -161,6 +161,7 @@ files:
161
161
  - lib/ansible_tower_client/base_models/job_template.rb
162
162
  - lib/ansible_tower_client/base_models/organization.rb
163
163
  - lib/ansible_tower_client/base_models/project.rb
164
+ - lib/ansible_tower_client/base_models/project_update.rb
164
165
  - lib/ansible_tower_client/collection.rb
165
166
  - lib/ansible_tower_client/connection.rb
166
167
  - lib/ansible_tower_client/exception.rb
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  version: '0'
191
192
  requirements: []
192
193
  rubyforge_project:
193
- rubygems_version: 2.5.1
194
+ rubygems_version: 2.5.2
194
195
  signing_key:
195
196
  specification_version: 4
196
197
  summary: Ansible Tower REST API wrapper gem