gizzmo 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/gizzmo.gemspec +2 -2
  3. data/lib/gizzmo.rb +18 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
data/gizzmo.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gizzmo}
8
- s.version = "0.6.0"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kyle Maxwell"]
12
- s.date = %q{2010-08-23}
12
+ s.date = %q{2010-08-25}
13
13
  s.default_executable = %q{gizzmo}
14
14
  s.description = %q{Gizzmo is a command-line client for managing gizzard clusters.}
15
15
  s.email = %q{kmaxwell@twitter.com}
data/lib/gizzmo.rb CHANGED
@@ -83,7 +83,7 @@ subcommands = {
83
83
  'rebalance' => OptionParser.new do |opts|
84
84
  opts.banner = "Usage: #{zero} rebalance"
85
85
  separators(opts, DOC_STRINGS["rebalance"])
86
-
86
+
87
87
  opts.on("-h", "--hosts=list") do |h|
88
88
  subcommand_options.hosts = h
89
89
  end
@@ -230,6 +230,10 @@ global = OptionParser.new do |opts|
230
230
  global_options.port = port
231
231
  end
232
232
 
233
+ opts.on("-r", "--retry=TIMES", "TIMES to retry the command") do |r|
234
+ global_options.retry = r
235
+ end
236
+
233
237
  opts.on("--subtree", "Render in subtree mode") do
234
238
  global_options.render << "subtree"
235
239
  end
@@ -303,8 +307,20 @@ while !$stdin.tty? && line = STDIN.gets
303
307
  argv << line.strip
304
308
  end
305
309
 
310
+ tries_left = global_options.retry.to_i + 1
306
311
  begin
307
- Gizzard::Command.run(subcommand_name, global_options, argv, subcommand_options, log)
312
+ while (tries_left -= 1) >= 0
313
+ begin
314
+ Gizzard::Command.run(subcommand_name, global_options, argv, subcommand_options, log)
315
+ break
316
+ rescue
317
+ if tries_left > 0
318
+ STDERR.puts "Retrying..."
319
+ else
320
+ raise
321
+ end
322
+ end
323
+ end
308
324
  rescue HelpNeededError => e
309
325
  if e.class.name != e.message
310
326
  STDERR.puts("=" * 80)
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 6
7
+ - 7
8
8
  - 0
9
- version: 0.6.0
9
+ version: 0.7.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kyle Maxwell
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-23 00:00:00 -07:00
17
+ date: 2010-08-25 00:00:00 -07:00
18
18
  default_executable: gizzmo
19
19
  dependencies: []
20
20