class Sakuru::Command

Public Class Methods

new(arguments) click to toggle source
# File lib/sakuru/command.rb, line 10
def initialize(arguments)
  @options = parse_options(arguments)
end
run(arguments) click to toggle source
# File lib/sakuru/command.rb, line 6
def self.run(arguments)
  new(arguments).run
end

Public Instance Methods

run() click to toggle source
# File lib/sakuru/command.rb, line 14
def run
end

Private Instance Methods

parse_options(arguments) click to toggle source
# File lib/sakuru/command.rb, line 18
    def parse_options(arguments)
      options = {}

      parser = OptionParser.new(<<-USAGE)
Usage:
  require "sakuru"

  db = Sakuru::Database.new
  db.add(file_path)
  db.add(uri)
  db.search(query)
  db.save(output_path)
  db.load(saved_file_path)
      USAGE

      parser.version = VERSION

      parser.parse!(arguments)

      options
    end