Sha256: becf3bf68fa08f81e54b9bbe60f241b1dc0e6a5d316480f6f477f4f7bdbf9dff

Contents?: true

Size: 1.13 KB

Versions: 29

Compression:

Stored size: 1.13 KB

Contents

module BiorubyHelper

  include Bio::Shell

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

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

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

  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

  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

end

Version data entries

29 entries across 29 versions & 6 rubygems

Version Path
bio-shell-1.0.1 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bio-shell-1.0.0 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bio-1.5.2 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bio-shell-0.0.0 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bio-1.5.1 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bio-1.5.0 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bioruby-bio-1.2.9.9001 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bioruby-bio-1.2.9.9501 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bioruby-bio-1.3.0.5000 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bioruby-bio-1.3.0.9901 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bioruby-bio-1.3.0 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bioruby-bio-1.3.1.5000 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
jandot-bio-1.2.1 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
ngoto-bio-1.2.9.9001 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
ngoto-bio-1.2.9.9501 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
ngoto-bio-1.3.0.5000 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
ngoto-bio-1.3.0 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
ngoto-bio-1.3.1.5000 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
wwood-bioruby-1.2.11 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb
bio-1.4.3.0001 lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb