guignol 0.3.4 → 0.3.5
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.
- data/Gemfile.lock +1 -1
- data/lib/guignol/commands/base.rb +7 -2
- data/lib/guignol/commands/kill.rb +3 -1
- data/lib/guignol/commands/list.rb +1 -1
- data/lib/guignol/commands/stop.rb +4 -2
- data/lib/guignol/shell.rb +7 -0
- data/lib/guignol/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
@@ -16,7 +16,7 @@ module Guignol::Commands
|
|
16
16
|
|
17
17
|
# Run the block for each server in +configs+ (in parallel).
|
18
18
|
def run
|
19
|
-
before_run(@configs) or return
|
19
|
+
before_run(@configs, @options) or return
|
20
20
|
results = {}
|
21
21
|
|
22
22
|
Parallel.each(@configs, parallel_options) do |name,config|
|
@@ -49,8 +49,13 @@ module Guignol::Commands
|
|
49
49
|
end
|
50
50
|
|
51
51
|
|
52
|
-
|
52
|
+
def self.add_force_option
|
53
|
+
method_option :force,
|
54
|
+
:aliases => %w(-f), :type => :boolean, :default => false,
|
55
|
+
:desc => 'Do not ask for confirmation'
|
56
|
+
end
|
53
57
|
|
58
|
+
private
|
54
59
|
|
55
60
|
def parallel_options
|
56
61
|
if RUBY_VERSION >= '1.9.3'
|
@@ -4,6 +4,7 @@ require 'guignol/models/instance'
|
|
4
4
|
|
5
5
|
Guignol::Shell.class_eval do
|
6
6
|
desc 'kill PATTERNS', 'Terminate all instances matching PATTERNS'
|
7
|
+
add_force_option
|
7
8
|
def kill(*patterns)
|
8
9
|
if patterns.empty?
|
9
10
|
raise Thor::Error.new('You must specify at least one PATTERN.')
|
@@ -16,8 +17,9 @@ end
|
|
16
17
|
module Guignol::Commands
|
17
18
|
class Kill < Base
|
18
19
|
|
19
|
-
def before_run(configs)
|
20
|
+
def before_run(configs, options = {})
|
20
21
|
return true if configs.empty?
|
22
|
+
return true if options[:force]
|
21
23
|
names = configs.keys.join(", ")
|
22
24
|
shell.yes? "Are you sure you want to destroy servers #{names}? [y/N]", :cyan
|
23
25
|
end
|
@@ -4,19 +4,21 @@ require 'guignol/models/instance'
|
|
4
4
|
|
5
5
|
Guignol::Shell.class_eval do
|
6
6
|
desc 'stop PATTERNS', 'Stop all instances matching PATTERNS, and remove DNS records'
|
7
|
+
add_force_option
|
7
8
|
def stop(*patterns)
|
8
9
|
if patterns.empty?
|
9
10
|
raise Thor::Error.new('You must specify at least one PATTERN.')
|
10
11
|
end
|
11
|
-
Guignol::Commands::Stop.new(patterns).run
|
12
|
+
Guignol::Commands::Stop.new(patterns, options).run
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
|
16
17
|
module Guignol::Commands
|
17
18
|
class Stop < Base
|
18
|
-
def before_run(configs)
|
19
|
+
def before_run(configs, options = {})
|
19
20
|
return true if configs.empty?
|
21
|
+
return true if options[:force]
|
20
22
|
names = configs.keys.join(", ")
|
21
23
|
shell.yes? "Are you sure you want to stop servers #{names}? [y/N]", :cyan
|
22
24
|
end
|
data/lib/guignol/shell.rb
CHANGED
data/lib/guignol/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guignol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -232,7 +232,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
segments:
|
234
234
|
- 0
|
235
|
-
hash:
|
235
|
+
hash: 3108163077006615043
|
236
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
237
|
none: false
|
238
238
|
requirements:
|