inprovise 0.2.15 → 0.2.16

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTAyNWE0NWQzZjQ4NmYyNWY2YjgxMDJjMzQ2ODRmOWI1MWYyMjI5OQ==
4
+ MThmN2UyZGE2MjczYzFiZWEwOGRlNWU0Y2I5ODRmNDgyMGExZmYyZQ==
5
5
  data.tar.gz: !binary |-
6
- ZTZkODg1ZTFiYWJkOGZjMWZhM2VmYzQ1MTY0MGRmOGQ2MTY2YzYzMA==
6
+ YTY2NDY0MGY4YWMwNjkxOTFjZDllMTQ0NjY4ZDkxYjYxZmFhYzIwNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGQ2NmEyMzVjNDYyMzYxYWJkOWRiYzU4OGMwMDAwNzcxZWRjYjFkZGY5NGU4
10
- MWE3MDA5NWY5NmJmMTA0ODYzYTIxNmEzMjIxMzU1ZjUzYzc2MTM2NGE3NmI4
11
- MjIyZTIzM2E4ZGYxMWM2NDc1OGViODRiMzZkZGY4MzNmMTM1YWY=
9
+ N2UxZGQwNzhiNTJhMzkxMzZkY2IxNWRiZmU1YTY2NzUxZjZjMTQ4MmIxZDMx
10
+ N2Y4YTZhNmNhNWQ0YTcxOTA5ZWM2ZjM4OWI2OGExOGRhODRmMTliMTZjMDM2
11
+ MWI3YzNiYmU2MTI4ZTE0ZWEyNjg4ZTQ4MmYyMWY4YThlZDNmMWQ=
12
12
  data.tar.gz: !binary |-
13
- Yzc1YmVkODE4MGU2MzVhZjc1NTQ1NjYwYWJhZjM3M2ZjNWU1YjQ2M2U1ZmNk
14
- ZDMyYmYxYzZiYzRjYzRlNDY2NzUyZTI1NzExMTIyMmZlMzU1NmMwYWJmNDRi
15
- YzRhNTFhMWQyNTAxNzgyYjQxNWQ0ZGMzMWMxNzljNjlmNmE1ZGE=
13
+ NTY1NjYyODI4YzBhOGMyYjY1YjE2NzBmNDBjMzMyMWQwNWFjODY1Y2FkOWNl
14
+ MzUzYWM5N2RiNDMyMzIyNWIxYzIyZDJlNjdlOGM4NmFiYTE5YTJlNWFhOGMz
15
+ ZWMyM2U1YWNjODA4MmFjOGUxYjNiMzQ5MGFlMzE1ZWY3Y2JiYjc=
@@ -51,6 +51,7 @@ class Inprovise::Cli
51
51
  end
52
52
 
53
53
  cgrp.desc 'List infrastructure groups (all or specified group(s))'
54
+ cgrp.skips_post
54
55
  cgrp.arg_name '[GROUP[ GROUP [...]]]'
55
56
  cgrp.command :list do |cgrp_list|
56
57
  cgrp_list.switch [:d, :details], negatable: false, :desc => 'Show group details'
@@ -56,6 +56,7 @@ class Inprovise::Cli
56
56
  end
57
57
 
58
58
  cnod.desc 'List infrastructure nodes (all or for specified nodes/groups)'
59
+ cnod.skips_post
59
60
  cnod.arg_name '[NAME[ NAME [...]]]'
60
61
  cnod.command :list do |cnod_list|
61
62
  cnod_list.switch [:d, :details], negatable: false, :desc => 'Show node details'
@@ -61,6 +61,7 @@ class Inprovise::Cli
61
61
  end
62
62
 
63
63
  desc 'List the available scripts. By default lists only described scripts.'
64
+ skips_post
64
65
  command :list do |clist|
65
66
 
66
67
  clist.desc 'Path to a provisioning scheme to load'
data/lib/inprovise/cli.rb CHANGED
@@ -41,6 +41,7 @@ class Inprovise::Cli
41
41
  require_relative './cli/provision'
42
42
 
43
43
  desc 'Initialize Inprovise project.'
44
+ skips_post
44
45
  command :init do |cinit|
45
46
  cinit.action do |_global,_options,_args|
46
47
  raise RuntimeError, 'Cannot initialize existing project directory.' if File.exists?(Inprovise::INFRA_FILE)
@@ -79,11 +80,12 @@ class Inprovise::Cli
79
80
  true
80
81
  end
81
82
 
82
- # post do |global,command,options,args|
83
- # # Post logic here
84
- # # Use skips_post before a command to skip this
85
- # # block on that command only
86
- # end
83
+ post do |global,command,options,args|
84
+ # Post logic here
85
+ # Use skips_post before a command to skip this
86
+ # block on that command only
87
+ Inprovise::Infrastructure.save
88
+ end
87
89
 
88
90
  on_error do |exception|
89
91
  # Error logic here
@@ -133,7 +133,6 @@ class Inprovise::Controller
133
133
 
134
134
  def run_infra_command(cmd, target, *args)
135
135
  add(Inprovise::Controller.new).send(:"#{cmd}_#{target}", *args)
136
- Inprovise::Infrastructure.save
137
136
  end
138
137
 
139
138
  def run_provisioning_command(command, script, cfg, *targets)
@@ -58,7 +58,7 @@ module Inprovise::Infrastructure
58
58
  def save
59
59
  targets.synchronize do
60
60
  data = []
61
- targets.each_value {|t| t.is_a?(Node) ? data.insert(0,t) : data.push(t) }
61
+ targets.values.sort.each {|t| t.is_a?(Node) ? data.insert(0,t) : data.push(t) }
62
62
  File.open(Inprovise.infra, 'w') {|f| f << JSON.pretty_generate(data) }
63
63
  end
64
64
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Inprovise
7
7
 
8
- VERSION = '0.2.15'
8
+ VERSION = '0.2.16'
9
9
 
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inprovise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-18 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored