class RRSE::Command::InstallDefaultDB

Public Class Methods

new(dir) click to toggle source
# File lib/rrse/install-default-db-command.rb, line 9
def initialize(dir)
  @dir = dir
end
short_description() click to toggle source
# File lib/rrse/install-default-db-command.rb, line 5
def self.short_description
  "install default db"
end

Public Instance Methods

find_file(path) click to toggle source
# File lib/rrse/install-default-db-command.rb, line 26
def find_file(path)
  `gem contents rrse`.split(/\n/).grep(/#{Regexp.quote(path)}\Z/).first
end
options() click to toggle source
# File lib/rrse/install-default-db-command.rb, line 13
def options
  opts = OptionParser.new
  opts.banner = "Usage: rrse [global-options] install-default-db"
  opts
end
run(argv) click to toggle source
# File lib/rrse/install-default-db-command.rb, line 19
def run(argv)
  options.parse!(argv)

  FileUtils.cp(find_file("misc/table"), @dir, verbose: true)
  FileUtils.cp(find_file("misc/index_table"), @dir, verbose: true)
end