Module: BiorubyHelper

Includes:
Bio::Shell
Defined in:
lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb

Constant Summary

Constants included from Bio::Shell

Bio::Shell::VERSION

Constants included from Bio::Shell::Ghost

Bio::Shell::Ghost::Readline

Constants included from Bio::Shell::Core

Bio::Shell::Core::BIOFLAT, Bio::Shell::Core::CONFIG, Bio::Shell::Core::DATADIR, Bio::Shell::Core::ESC_SEQ, Bio::Shell::Core::HISTORY, Bio::Shell::Core::MARSHAL, Bio::Shell::Core::MESSAGE, Bio::Shell::Core::OBJECT, Bio::Shell::Core::PLUGIN, Bio::Shell::Core::SCRIPT, Bio::Shell::Core::SESSION, Bio::Shell::Core::SHELLDIR

Instance Attribute Summary

Attributes included from Bio::Shell::Ghost

#cache, #config

Instance Method Summary collapse

Methods included from Bio::Shell::Ghost

#check_marshal, #close_history, #closing_splash, #config_color, #config_echo, #config_message, #config_pager, #config_show, #config_splash, #configure, #create_flat_dir, #create_real_dir, #create_save_dir, #create_save_dir_ask, #find_flat_dir, #load_config, #load_config_file, #load_history, #load_history_file, #load_object, #load_object_file, #load_plugin, #load_plugin_dir, #load_session, #open_history, #opening_splash, #save_config, #save_config_file, #save_history, #save_history_file, #save_object, #save_object_file, #save_script, #save_script_file, #save_session, #script, #script_begin, #script_end, #splash_message, #splash_message_action, #splash_message_action_color, #splash_message_color, #store_history

Methods included from Bio::Shell::Core

#ask_yes_or_no, #bioflat_dir, #colors, #config_file, #data_dir, #history_file, #object_file, #plugin_dir, #script_dir, #script_file, #session_dir, #shell_dir

Instance Method Details

#have_resultsObject



13
14
15
# File 'lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb', line 13

def have_results
  Bio::Shell.cache[:results].number > 0
end

#local_variablesObject



17
18
19
20
# File 'lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb', line 17

def local_variables
  eval("local_variables", Bio::Shell.cache[:binding]) -
    BiorubyController::HIDE_VARIABLES
end

#project_workdirObject



5
6
7
8
9
10
11
# File 'lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb', line 5

def project_workdir
  if Bio::Shell.cache[:savedir].match(/\.bioruby$/)
    Bio::Shell.cache[:workdir]
  else
    Bio::Shell.cache[:savedir]
  end
end


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb', line 30

def reference_link(class_or_module)
  name = class_or_module.to_s
  case name
  when /Bio::(.+)/
    path = $1.split('::').join('/')
    url = "http://bioruby.org/rdoc/classes/Bio/#{path}.html"
  when /Chem::(.+)/
    path = $1.split('::').join('/')
    url = "http://chemruby.org/rdoc/classes/Chem/#{path}.html"
  else
    path = name.split('::').join('/')
    url = "http://www.ruby-doc.org/core/classes/#{path}.html"
  end
  return "<a href='#{url}'>#{name}</a>"
end

#render_log(page) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb', line 22

def render_log(page)
  page.insert_html :top, :logs, :partial => "log"
  page.replace_html "variables", :partial => "variables"
  page.hide "methods_#{@number}"
  page.hide "classes_#{@number}"
  page.hide "modules_#{@number}"
end