Class: Groonga::Command::Parser::Command::GroongaCommandLogicalify

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga/command/parser/command/groonga-command-logicalify.rb

Instance Method Summary collapse

Constructor Details

#initializeGroongaCommandLogicalify

Returns a new instance of GroongaCommandLogicalify.



26
27
28
29
# File 'lib/groonga/command/parser/command/groonga-command-logicalify.rb', line 26

def initialize
  @logical_table = nil
  @shard_key = nil
end

Instance Method Details

#run(argv = ARGV) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/groonga/command/parser/command/groonga-command-logicalify.rb', line 31

def run(argv=ARGV)
  begin
    parse_options!(argv)
  rescue OptionParser::ParseError
    puts($!.message)
    return false
  end

  input_paths = argv
  if input_paths.empty?
    logicalify($stdin)
  else
    input_paths.each do |input_path|
      File.open(input_path) do |input|
        logicalify(input)
      end
    end
  end

  true
end