module Bio::Shell::Core

bio/shell/core.rb - internal methods for the BioRuby shell

Copyright

Copyright (C) 2005, 2006 Toshiaki Katayama <k@bioruby.org>

License

The Ruby License

Constants

BIOFLAT
CONFIG
DATADIR
ESC_SEQ
HISTORY
MARSHAL
MESSAGE
OBJECT
PLUGIN
SCRIPT
SESSION
SHELLDIR

Public Instance Methods

ask_yes_or_no(message) click to toggle source
# File lib/bio/shell/core.rb, line 82
def ask_yes_or_no(message)
  loop do
    STDERR.print "#{message}"
    answer = gets
    if answer.nil?
      # readline support might be broken
      return false
    elsif /^\s*[Nn]/.match(answer)
      return false
    elsif /^\s*[Yy]/.match(answer)
      return true
    else
      # loop
    end
  end
end
bioflat_dir() click to toggle source
# File lib/bio/shell/core.rb, line 78
def bioflat_dir
  File.join(@cache[:savedir], BIOFLAT)
end
colors() click to toggle source
# File lib/bio/shell/core.rb, line 38
def colors
  ESC_SEQ
end
config_file() click to toggle source
# File lib/bio/shell/core.rb, line 66
def config_file
  File.join(@cache[:savedir], CONFIG)
end
data_dir() click to toggle source
# File lib/bio/shell/core.rb, line 46
def data_dir
  File.join(@cache[:savedir], DATADIR)
end
history_file() click to toggle source
# File lib/bio/shell/core.rb, line 74
def history_file
  File.join(@cache[:savedir], HISTORY)
end
object_file() click to toggle source
# File lib/bio/shell/core.rb, line 70
def object_file
  File.join(@cache[:savedir], OBJECT)
end
plugin_dir() click to toggle source
# File lib/bio/shell/core.rb, line 54
def plugin_dir
  File.join(@cache[:savedir], PLUGIN)
end
script_dir() click to toggle source
# File lib/bio/shell/core.rb, line 62
def script_dir
  File.dirname(script_file)
end
script_file() click to toggle source
# File lib/bio/shell/core.rb, line 58
def script_file
  File.join(@cache[:savedir], SCRIPT)
end
session_dir() click to toggle source
# File lib/bio/shell/core.rb, line 50
def session_dir
  File.join(@cache[:savedir], SESSION)
end
shell_dir() click to toggle source
# File lib/bio/shell/core.rb, line 42
def shell_dir
  File.join(@cache[:savedir], SHELLDIR)
end