Class: Gizzard::DumpCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/gizzard/commands.rb

Instance Attribute Summary

Attributes inherited from Command

#argv, #buffer, #command_options, #global_options, #job_injector, #manager

Instance Method Summary collapse

Methods inherited from Command

classify, #confirm!, #get_base_name, #help!, #initialize, make_job_injector, make_manager, #output, #require_tables, #require_template_options, run

Constructor Details

This class inherits a constructor from Gizzard::Command

Instance Method Details

#down(shard, depth) ⇒ Object



154
155
156
157
158
159
160
# File 'lib/gizzard/commands.rb', line 154

def down(shard, depth)
  printable = "  " * depth + shard.info.id.to_unix
  output printable
  shard.children.each do |child|
    down(child, depth + 1)
  end
end

#runObject



146
147
148
149
150
151
152
# File 'lib/gizzard/commands.rb', line 146

def run
  table_ids = argv.map{|e| e.to_i }
  manifest = manager.manifest(*table_ids)
  manifest.trees.values.each do |tree|
    down(tree, 0)
  end
end