Method: Bio::Shell::Setup#initialize

Defined in:
lib/bio/shell/setup.rb

#initializeSetup

Returns a new instance of Setup.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/bio/shell/setup.rb', line 14

def initialize
  check_ruby_version

  # command line options
  getoptlong

  # setup working directory
  savedir = setup_savedir

  # load configuration and plugins
  Bio::Shell.configure(savedir)

  # set default to irb mode
  Bio::Shell.cache[:mode] = ((defined? @mode) && @mode) || :irb

  case Bio::Shell.cache[:mode]
  when :web
    # setup rails server
    Bio::Shell::Web.new
  when :irb
    # setup irb server
    Bio::Shell::Irb.new
  when :script
    # run bioruby shell script
    Bio::Shell::Script.new(@script)
  end
end