viaduct-toolkit 0.0.2 → 0.0.3

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: 02df5cf3e8f75220f94ad966c59ce3361a3126d9
4
- data.tar.gz: a6531222924056e673bc59e02601a2533f002c2f
3
+ metadata.gz: c66db3a1f9b8d5e872b2f57ee3d9a35cc3245132
4
+ data.tar.gz: 1f04ed00771efe833b09995d41150d82e9d93b67
5
5
  SHA512:
6
- metadata.gz: 7ec11c4cb19bffc46651262499b058f1895c8d997a387166f4e0c9618dc90a16efff2bbd27ed0168efe4ba9bb0f471ee54bb39ab81c8f23ae1469f3037a7d311
7
- data.tar.gz: 3c64d03bc641b08191e969d59e7c9cec611157ca1eb25cd2b947e478f2fa9329c9da0ab99b7ae51d44bdc346f2528316fa34402524023a32511a8f12dafb14f9
6
+ metadata.gz: b08a5b7a585a79629031522a60a81c807c691ba6aaae34347b889c981a64244dc367f6d6940e9eb619e12af2ecf7eef5deae625ad3cbd2bdd960ac82fec15369
7
+ data.tar.gz: 23006e3fada77da25e3c9ea3c747b73bbd723412d92219f225bff2990122c2663d77edabcf7434040210d1ccd1d5a0c40727bdf57b56b6ed9bbd30513d6ca0eb
@@ -12,11 +12,28 @@ Viaduct::Toolkit.cli.command "app:deployments" do |c|
12
12
  if response.success?
13
13
 
14
14
  require 'terminal-table'
15
- rows = response.data.map do |d|
16
- [d['number'], d['status'], d['version']['description'].to_s[0,30], d['user'] ? d['user']['username'] : '', d['timing']['created_at']]
15
+
16
+ colourer = Proc.new do |d, field|
17
+ if d['status'] == 'deployed'
18
+ field.to_s.green
19
+ elsif d['status'] == 'failed'
20
+ field.to_s.red
21
+ else
22
+ field
23
+ end
17
24
  end
18
- puts Terminal::Table.new :rows => rows, :headings => ['#', 'Status', 'Description', 'User', 'Time']
19
25
 
26
+ rows = response.data.map do |d|
27
+ [
28
+ colourer.call(d, d['number']),
29
+ colourer.call(d, d['version']['description'].to_s[0,30]),
30
+ colourer.call(d, d['user'] ? d['user']['username'] : d['triggerer']),
31
+ colourer.call(d, d['timing']['created_at']),
32
+ colourer.call(d, d['triggered_from'])
33
+ ]
34
+ end
35
+ puts Terminal::Table.new :rows => rows, :headings => ['#', 'Description', 'User', 'Time', 'Source']
36
+ puts "The active deployment shows in #{'green'.green} and failed show in #{'red'.red}."
20
37
  else
21
38
  error "Couldn't get application deployment list"
22
39
  end
@@ -31,8 +31,11 @@ Viaduct::Toolkit.cli.command "app:info" do |c|
31
31
  field 'Started at', application['deployment']['timing']['created_at']
32
32
  field 'Time', application['deployment']['timing']['time'].round(1).to_s + "s"
33
33
  field 'Description', application['deployment']['version']['description']
34
+ field 'Source', application['deployment']['triggered_from']
34
35
  if application['deployment']['user']
35
36
  field 'Deployer', "#{application['deployment']['user']['name']} (#{application['deployment']['user']['username']})"
37
+ elsif application['deployment']['triggerer']
38
+ field 'Deployer', application['deployment']['triggerer']
36
39
  end
37
40
  end
38
41
  end
@@ -50,7 +50,8 @@ Viaduct::Toolkit.cli.command "app:status" do |c|
50
50
  field "Number", response.data['deployment']['number']
51
51
  field 'Version', response.data['deployment']['version']['id']
52
52
  field "Description", response.data['deployment']['version']['description']
53
- field "Deployer", response.data['deployment']['user'] ? response.data['deployment']['user']['full_name'] : ''
53
+ field "Source", response.data['deployment']['triggered_from']
54
+ field "Deployer", response.data['deployment']['user'] ? response.data['deployment']['user']['full_name'] : response.data['deployment']['triggerer']
54
55
  field "Started", time(response.data['deployment']['timing']['started_at'])
55
56
  end
56
57
 
@@ -1,5 +1,5 @@
1
1
  module Viaduct
2
2
  module Toolkit
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viaduct-toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-09 00:00:00.000000000 Z
11
+ date: 2014-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander