opsworks-cli 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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0ca9871d55cd6847c8d7e7b562e732aac030c37
4
- data.tar.gz: 374570003f75f56fde1b47b13b518825f47b68c5
3
+ metadata.gz: d80d65b9937273607a19fc3ea4eecd4f1b15311a
4
+ data.tar.gz: a0200344f6e62a71341c51584e5893d6e8b68de5
5
5
  SHA512:
6
- metadata.gz: 2b4f5789be4a47fccaded15e70f3dab8f5e3640834ea1c179dfefc7d16ca131232b5fbb070143f854fb0d7ac2e87161d4db31b38421ec03773b285cb30a7fb3c
7
- data.tar.gz: 982fec8649404dee3f3b59486ffe1edfb6e78ab982e663b0eb64f56ff06e2890b8d1e8a28078d1c231ac9b2f579ce26ca36066021f1f313fb8dbbb06f15b6dea
6
+ metadata.gz: f8847f8697a405dd22a31a16751623a2b429788cdf0c9fd31ea51b2d6a1c4c9e885872fe7c6d0ddba84d4c3e3310e5cb11df3e42b72e1dffa21c055dfc42e911
7
+ data.tar.gz: f6b8a09606fda4acbfbc600562a60782a6afbfe29cc68fe0b787d144adff694aa2baa4d67dfed8cd0da4ed274896f1b4bf259532ac60e0e410493e846492a7d3
@@ -3,11 +3,10 @@ require_relative 'deployment'
3
3
 
4
4
  module OpsWorks
5
5
  class App < Resource
6
- attr_accessor :id, :name
6
+ attr_accessor :id, :name, :revision
7
7
 
8
8
  def deployments
9
9
  @deployments ||= initialize_deployments
10
- @deployments || []
11
10
  end
12
11
 
13
12
  def last_deployment
@@ -17,7 +16,7 @@ module OpsWorks
17
16
  private
18
17
 
19
18
  def initialize_deployments
20
- return nil unless id
19
+ return [] unless id
21
20
  response = self.class.client.describe_deployments(app_id: id)
22
21
  response.data[:deployments].map do |hash|
23
22
  Deployment.new(
@@ -22,8 +22,10 @@ module OpsWorks
22
22
  else
23
23
  deployed_at = '-'
24
24
  end
25
- [stack.name, name, deployed_at]
25
+ [stack.name, name, "(#{app.revision})", deployed_at]
26
26
  end
27
+ # Sort output in descending date order
28
+ table.sort! { |x, y| y.last <=> x.last }
27
29
  table.compact!
28
30
  print_table table
29
31
  end
@@ -1,5 +1,5 @@
1
1
  module OpsWorks
2
2
  module CLI
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
@@ -17,7 +17,6 @@ module OpsWorks
17
17
 
18
18
  def apps
19
19
  @apps ||= initialize_apps
20
- @apps || []
21
20
  end
22
21
 
23
22
  def find_app_by_name(name)
@@ -45,9 +44,10 @@ module OpsWorks
45
44
  private
46
45
 
47
46
  def initialize_apps
48
- return nil unless id
47
+ return [] unless id
49
48
  self.class.client.describe_apps(stack_id: id).data[:apps].map do |hash|
50
- App.new(id: hash[:app_id], name: hash[:name])
49
+ revision = hash[:app_source][:revision] if hash[:app_source]
50
+ App.new(id: hash[:app_id], name: hash[:name], revision: revision)
51
51
  end
52
52
  end
53
53
 
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.version = OpsWorks::CLI::VERSION
11
11
  spec.authors = ['Frank Macreery']
12
12
  spec.email = ['frank@macreery.com']
13
- spec.description = %q(OpsWorks CLI)
14
- spec.summary = %q(Alternative CLI for Amazon OpsWorks)
13
+ spec.description = 'OpsWorks CLI'
14
+ spec.summary = 'Alternative CLI for Amazon OpsWorks'
15
15
  spec.homepage = 'https://github.com/aptible/opsworks-cli'
16
16
  spec.license = 'MIT'
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsworks-cli
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
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-19 00:00:00.000000000 Z
11
+ date: 2014-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor