Class: Gizzard::FindCommand

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

#runObject



518
519
520
521
522
523
524
525
526
# File 'lib/gizzard/commands.rb', line 518

def run
  hosts = @argv << command_options.shard_host
  hosts.compact.each do |host|
    manager.shards_for_hostname(host).each do |shard|
      next if command_options.shard_type && shard.class_name !~ Regexp.new(command_options.shard_type)
      output shard.id.to_unix
    end
  end
end