bio 0.7.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/bioruby +71 -27
- data/bin/br_biofetch.rb +5 -17
- data/bin/br_bioflat.rb +14 -26
- data/bin/br_biogetseq.rb +6 -18
- data/bin/br_pmfetch.rb +6 -16
- data/doc/Changes-0.7.rd +35 -0
- data/doc/KEGG_API.rd +287 -172
- data/doc/KEGG_API.rd.ja +273 -160
- data/doc/Tutorial.rd +18 -9
- data/doc/Tutorial.rd.ja +656 -138
- data/lib/bio.rb +6 -24
- data/lib/bio/alignment.rb +5 -5
- data/lib/bio/appl/blast.rb +132 -98
- data/lib/bio/appl/blast/format0.rb +9 -19
- data/lib/bio/appl/blast/wublast.rb +5 -18
- data/lib/bio/appl/emboss.rb +40 -47
- data/lib/bio/appl/hmmer.rb +116 -82
- data/lib/bio/appl/hmmer/report.rb +509 -364
- data/lib/bio/appl/spidey/report.rb +7 -18
- data/lib/bio/data/na.rb +3 -21
- data/lib/bio/db.rb +3 -21
- data/lib/bio/db/aaindex.rb +147 -52
- data/lib/bio/db/embl/common.rb +27 -6
- data/lib/bio/db/embl/embl.rb +18 -10
- data/lib/bio/db/embl/sptr.rb +87 -67
- data/lib/bio/db/embl/swissprot.rb +32 -3
- data/lib/bio/db/embl/trembl.rb +32 -3
- data/lib/bio/db/embl/uniprot.rb +32 -3
- data/lib/bio/db/fasta.rb +327 -289
- data/lib/bio/db/medline.rb +25 -4
- data/lib/bio/db/nbrf.rb +12 -20
- data/lib/bio/db/pdb.rb +4 -1
- data/lib/bio/db/pdb/chemicalcomponent.rb +240 -0
- data/lib/bio/db/pdb/pdb.rb +13 -8
- data/lib/bio/db/rebase.rb +93 -97
- data/lib/bio/feature.rb +2 -31
- data/lib/bio/io/ddbjxml.rb +167 -139
- data/lib/bio/io/fastacmd.rb +89 -56
- data/lib/bio/io/flatfile.rb +994 -278
- data/lib/bio/io/flatfile/index.rb +257 -194
- data/lib/bio/io/flatfile/indexer.rb +37 -29
- data/lib/bio/reference.rb +147 -64
- data/lib/bio/sequence.rb +57 -417
- data/lib/bio/sequence/aa.rb +64 -0
- data/lib/bio/sequence/common.rb +175 -0
- data/lib/bio/sequence/compat.rb +68 -0
- data/lib/bio/sequence/format.rb +134 -0
- data/lib/bio/sequence/generic.rb +24 -0
- data/lib/bio/sequence/na.rb +189 -0
- data/lib/bio/shell.rb +9 -23
- data/lib/bio/shell/core.rb +130 -125
- data/lib/bio/shell/demo.rb +143 -0
- data/lib/bio/shell/{session.rb → interface.rb} +42 -40
- data/lib/bio/shell/object.rb +52 -0
- data/lib/bio/shell/plugin/codon.rb +4 -22
- data/lib/bio/shell/plugin/emboss.rb +23 -0
- data/lib/bio/shell/plugin/entry.rb +34 -25
- data/lib/bio/shell/plugin/flatfile.rb +5 -23
- data/lib/bio/shell/plugin/keggapi.rb +11 -24
- data/lib/bio/shell/plugin/midi.rb +5 -23
- data/lib/bio/shell/plugin/obda.rb +4 -22
- data/lib/bio/shell/plugin/seq.rb +6 -24
- data/lib/bio/shell/rails/Rakefile +10 -0
- data/lib/bio/shell/rails/app/controllers/application.rb +4 -0
- data/lib/bio/shell/rails/app/controllers/shell_controller.rb +94 -0
- data/lib/bio/shell/rails/app/helpers/application_helper.rb +3 -0
- data/lib/bio/shell/rails/app/models/shell_connection.rb +30 -0
- data/lib/bio/shell/rails/app/views/layouts/shell.rhtml +37 -0
- data/lib/bio/shell/rails/app/views/shell/history.rhtml +5 -0
- data/lib/bio/shell/rails/app/views/shell/index.rhtml +2 -0
- data/lib/bio/shell/rails/app/views/shell/show.rhtml +13 -0
- data/lib/bio/shell/rails/config/boot.rb +19 -0
- data/lib/bio/shell/rails/config/database.yml +85 -0
- data/lib/bio/shell/rails/config/environment.rb +53 -0
- data/lib/bio/shell/rails/config/environments/development.rb +19 -0
- data/lib/bio/shell/rails/config/environments/production.rb +19 -0
- data/lib/bio/shell/rails/config/environments/test.rb +19 -0
- data/lib/bio/shell/rails/config/routes.rb +19 -0
- data/lib/bio/shell/rails/doc/README_FOR_APP +2 -0
- data/lib/bio/shell/rails/public/404.html +8 -0
- data/lib/bio/shell/rails/public/500.html +8 -0
- data/lib/bio/shell/rails/public/dispatch.cgi +10 -0
- data/lib/bio/shell/rails/public/dispatch.fcgi +24 -0
- data/lib/bio/shell/rails/public/dispatch.rb +10 -0
- data/lib/bio/shell/rails/public/favicon.ico +0 -0
- data/lib/bio/shell/rails/public/images/icon.png +0 -0
- data/lib/bio/shell/rails/public/images/rails.png +0 -0
- data/lib/bio/shell/rails/public/index.html +277 -0
- data/lib/bio/shell/rails/public/javascripts/controls.js +750 -0
- data/lib/bio/shell/rails/public/javascripts/dragdrop.js +584 -0
- data/lib/bio/shell/rails/public/javascripts/effects.js +854 -0
- data/lib/bio/shell/rails/public/javascripts/prototype.js +1785 -0
- data/lib/bio/shell/rails/public/robots.txt +1 -0
- data/lib/bio/shell/rails/public/stylesheets/main.css +187 -0
- data/lib/bio/shell/rails/script/about +3 -0
- data/lib/bio/shell/rails/script/breakpointer +3 -0
- data/lib/bio/shell/rails/script/console +3 -0
- data/lib/bio/shell/rails/script/destroy +3 -0
- data/lib/bio/shell/rails/script/generate +3 -0
- data/lib/bio/shell/rails/script/performance/benchmarker +3 -0
- data/lib/bio/shell/rails/script/performance/profiler +3 -0
- data/lib/bio/shell/rails/script/plugin +3 -0
- data/lib/bio/shell/rails/script/process/reaper +3 -0
- data/lib/bio/shell/rails/script/process/spawner +3 -0
- data/lib/bio/shell/rails/script/process/spinner +3 -0
- data/lib/bio/shell/rails/script/runner +3 -0
- data/lib/bio/shell/rails/script/server +42 -0
- data/lib/bio/shell/rails/test/test_helper.rb +28 -0
- data/lib/bio/shell/web.rb +90 -0
- data/lib/bio/util/contingency_table.rb +231 -225
- data/sample/any2fasta.rb +59 -0
- data/test/data/HMMER/hmmpfam.out +64 -0
- data/test/data/HMMER/hmmsearch.out +88 -0
- data/test/data/aaindex/DAYM780301 +30 -0
- data/test/data/aaindex/PRAM900102 +20 -0
- data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
- data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
- data/test/data/blast/{eco:b0002.faa → b0002.faa} +0 -0
- data/test/data/blast/{eco:b0002.faa.m0 → b0002.faa.m0} +2 -2
- data/test/data/blast/{eco:b0002.faa.m7 → b0002.faa.m7} +1 -1
- data/test/data/blast/{eco:b0002.faa.m8 → b0002.faa.m8} +0 -0
- data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
- data/test/unit/bio/appl/blast/test_report.rb +15 -12
- data/test/unit/bio/appl/blast/test_xmlparser.rb +4 -4
- data/test/unit/bio/appl/hmmer/test_report.rb +355 -0
- data/test/unit/bio/appl/test_blast.rb +5 -5
- data/test/unit/bio/data/test_na.rb +9 -18
- data/test/unit/bio/db/pdb/test_pdb.rb +169 -0
- data/test/unit/bio/db/test_aaindex.rb +197 -0
- data/test/unit/bio/io/test_fastacmd.rb +55 -0
- data/test/unit/bio/sequence/test_aa.rb +102 -0
- data/test/unit/bio/sequence/test_common.rb +178 -0
- data/test/unit/bio/sequence/test_compat.rb +82 -0
- data/test/unit/bio/sequence/test_na.rb +242 -0
- data/test/unit/bio/shell/plugin/test_seq.rb +29 -19
- data/test/unit/bio/test_alignment.rb +15 -7
- data/test/unit/bio/test_reference.rb +198 -0
- data/test/unit/bio/test_sequence.rb +4 -49
- data/test/unit/bio/test_shell.rb +2 -2
- metadata +118 -15
- data/lib/bio/io/brdb.rb +0 -103
- data/lib/bioruby.rb +0 -34
@@ -1,29 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# = bio/shell/plugin/flatfile.rb - plugin for flatfile database
|
3
3
|
#
|
4
|
-
# Copyright::
|
5
|
-
#
|
6
|
-
# License
|
4
|
+
# Copyright:: Copyright (C) 2005
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License: Ruby's
|
7
7
|
#
|
8
|
-
# $Id: flatfile.rb,v 1.
|
9
|
-
#
|
10
|
-
#--
|
11
|
-
#
|
12
|
-
# This library is free software; you can redistribute it and/or
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
14
|
-
# License as published by the Free Software Foundation; either
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
16
|
-
#
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20
|
-
# Lesser General Public License for more details.
|
21
|
-
#
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
23
|
-
# License along with this library; if not, write to the Free Software
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
-
#
|
26
|
-
#++
|
8
|
+
# $Id: flatfile.rb,v 1.12 2006/02/09 20:48:53 k Exp $
|
27
9
|
#
|
28
10
|
|
29
11
|
module Bio::Shell
|
@@ -86,8 +68,8 @@ module Bio::Shell
|
|
86
68
|
end
|
87
69
|
|
88
70
|
def flatindex(dbname, *flatfiles)
|
89
|
-
dir = Bio::Shell.create_flat_dir(dbname)
|
90
71
|
begin
|
72
|
+
dir = Bio::Shell.create_flat_dir(dbname)
|
91
73
|
print "Creating BioFlat index (#{dir}) ... "
|
92
74
|
bdb = format = options = nil
|
93
75
|
Bio::FlatFileIndex.makeindex(bdb, dir, format, options, *flatfiles)
|
@@ -1,29 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# = bio/shell/plugin/keggapi.rb - plugin for KEGG API
|
3
3
|
#
|
4
|
-
# Copyright::
|
5
|
-
#
|
6
|
-
# License::
|
4
|
+
# Copyright:: Copyright (C) 2005
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License:: Ruby's
|
7
7
|
#
|
8
|
-
# $Id: keggapi.rb,v 1.
|
9
|
-
#
|
10
|
-
#--
|
11
|
-
#
|
12
|
-
# This library is free software; you can redistribute it and/or
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
14
|
-
# License as published by the Free Software Foundation; either
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
16
|
-
#
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20
|
-
# Lesser General Public License for more details.
|
21
|
-
#
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
23
|
-
# License along with this library; if not, write to the Free Software
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
-
#
|
26
|
-
#++
|
8
|
+
# $Id: keggapi.rb,v 1.10 2006/02/09 20:48:53 k Exp $
|
27
9
|
#
|
28
10
|
|
29
11
|
module Bio::Shell
|
@@ -40,8 +22,13 @@ module Bio::Shell
|
|
40
22
|
|
41
23
|
private
|
42
24
|
|
43
|
-
def keggapi
|
44
|
-
|
25
|
+
def keggapi(wsdl = nil)
|
26
|
+
if wsdl
|
27
|
+
@keggapi = Bio::KEGG::API.new(wsdl)
|
28
|
+
else
|
29
|
+
@keggapi ||= Bio::KEGG::API.new
|
30
|
+
end
|
31
|
+
return @keggapi
|
45
32
|
end
|
46
33
|
|
47
34
|
# DBGET
|
@@ -1,30 +1,12 @@
|
|
1
1
|
#
|
2
2
|
# = bio/shell/plugin/midi.rb - Sequence to MIDI converter
|
3
3
|
#
|
4
|
-
# Copyright::
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# License::
|
4
|
+
# Copyright:: Copyright (C) 2003, 2005
|
5
|
+
# Natsuhiro Ichinose <ichinose@genome.ist.i.kyoto-u.ac.jp>,
|
6
|
+
# Toshiaki Katayama <k@bioruby.org>
|
7
|
+
# License:: Ruby's
|
8
8
|
#
|
9
|
-
# $Id: midi.rb,v 1.
|
10
|
-
#
|
11
|
-
#--
|
12
|
-
#
|
13
|
-
# This library is free software; you can redistribute it and/or
|
14
|
-
# modify it under the terms of the GNU Lesser General Public
|
15
|
-
# License as published by the Free Software Foundation; either
|
16
|
-
# version 2 of the License, or (at your option) any later version.
|
17
|
-
#
|
18
|
-
# This library is distributed in the hope that it will be useful,
|
19
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
21
|
-
# Lesser General Public License for more details.
|
22
|
-
#
|
23
|
-
# You should have received a copy of the GNU Lesser General Public
|
24
|
-
# License along with this library; if not, write to the Free Software
|
25
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26
|
-
#
|
27
|
-
#++
|
9
|
+
# $Id: midi.rb,v 1.7 2006/02/09 20:48:53 k Exp $
|
28
10
|
#
|
29
11
|
|
30
12
|
#--
|
@@ -1,29 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# = bio/shell/plugin/obda.rb - plugin for OBDA
|
3
3
|
#
|
4
|
-
# Copyright::
|
5
|
-
#
|
6
|
-
# License
|
4
|
+
# Copyright:: Copyright (C) 2005
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License: Ruby's
|
7
7
|
#
|
8
|
-
# $Id: obda.rb,v 1.
|
9
|
-
#
|
10
|
-
#--
|
11
|
-
#
|
12
|
-
# This library is free software; you can redistribute it and/or
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
14
|
-
# License as published by the Free Software Foundation; either
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
16
|
-
#
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20
|
-
# Lesser General Public License for more details.
|
21
|
-
#
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
23
|
-
# License along with this library; if not, write to the Free Software
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
-
#
|
26
|
-
#++
|
8
|
+
# $Id: obda.rb,v 1.9 2006/02/09 20:48:53 k Exp $
|
27
9
|
#
|
28
10
|
|
29
11
|
module Bio::Shell
|
data/lib/bio/shell/plugin/seq.rb
CHANGED
@@ -1,29 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# = bio/shell/plugin/seq.rb - plugin for biological sequence manipulations
|
3
3
|
#
|
4
|
-
# Copyright::
|
5
|
-
#
|
6
|
-
# License::
|
4
|
+
# Copyright:: Copyright (C) 2005
|
5
|
+
# Toshiaki Katayama <k@bioruby.org>
|
6
|
+
# License:: Ruby's
|
7
7
|
#
|
8
|
-
# $Id: seq.rb,v 1.
|
9
|
-
#
|
10
|
-
#--
|
11
|
-
#
|
12
|
-
# This library is free software; you can redistribute it and/or
|
13
|
-
# modify it under the terms of the GNU Lesser General Public
|
14
|
-
# License as published by the Free Software Foundation; either
|
15
|
-
# version 2 of the License, or (at your option) any later version.
|
16
|
-
#
|
17
|
-
# This library is distributed in the hope that it will be useful,
|
18
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
20
|
-
# Lesser General Public License for more details.
|
21
|
-
#
|
22
|
-
# You should have received a copy of the GNU Lesser General Public
|
23
|
-
# License along with this library; if not, write to the Free Software
|
24
|
-
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25
|
-
#
|
26
|
-
#++
|
8
|
+
# $Id: seq.rb,v 1.17 2006/02/09 20:48:53 k Exp $
|
27
9
|
#
|
28
10
|
|
29
11
|
module Bio::Shell
|
@@ -210,14 +192,14 @@ class String
|
|
210
192
|
while n < self.length
|
211
193
|
pos = self[n, size].rindex(separater)
|
212
194
|
|
213
|
-
if self[n, size].length < size
|
195
|
+
if self[n, size].length < size # last line of the folded str
|
214
196
|
pos = nil
|
215
197
|
end
|
216
198
|
|
217
199
|
if pos
|
218
200
|
ary << self[n, pos+separater.length]
|
219
201
|
n += pos + separater.length
|
220
|
-
else
|
202
|
+
else # line too long or the last line
|
221
203
|
ary << self[n, size]
|
222
204
|
n += size
|
223
205
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
+
|
6
|
+
require 'rake'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rake/rdoctask'
|
9
|
+
|
10
|
+
require 'tasks/rails'
|
@@ -0,0 +1,94 @@
|
|
1
|
+
class DocumentRegistry
|
2
|
+
|
3
|
+
@@registry = []
|
4
|
+
|
5
|
+
def self.[](class_name)
|
6
|
+
@@registry.each do |block|
|
7
|
+
url = block.call(class_name)
|
8
|
+
return url if url
|
9
|
+
end
|
10
|
+
""
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.register &block
|
14
|
+
@@registry.push(block)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
DocumentRegistry.register() do |class_name|
|
20
|
+
if m = /Bio::(.+)/.match(class_name)
|
21
|
+
"http://bioruby.org/rdoc/classes/Bio/#{m[1].split('::').join('/')}.html"
|
22
|
+
else
|
23
|
+
false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
DocumentRegistry.register do |class_name|
|
28
|
+
if m = /Chem::(.+)/.match(class_name)
|
29
|
+
"http://chemruby.org/rdoc/classes/Chem/#{m[1].split('::').join('/')}.html"
|
30
|
+
else
|
31
|
+
false
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
DocumentRegistry.register do |class_name|
|
36
|
+
"http://www.ruby-doc.org/core/classes/#{class_name.split('::').join('/')}.html"
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
class ShellController < ApplicationController
|
41
|
+
|
42
|
+
layout 'shell' #, :except => [:rss_feed, :rss_with_content]
|
43
|
+
|
44
|
+
def index
|
45
|
+
setup
|
46
|
+
end
|
47
|
+
|
48
|
+
def show
|
49
|
+
setup
|
50
|
+
@obj = $drb_server[params[:id]]
|
51
|
+
if @obj.nil?
|
52
|
+
@inheritance = "<h1>Unknown local variable! : #{params[:var]}</h1>"
|
53
|
+
else
|
54
|
+
@inheritance = get_inheritance @obj.class
|
55
|
+
if @obj.respond_to?(:to_html)
|
56
|
+
@contents = @obj.to_html
|
57
|
+
else
|
58
|
+
@contents = "Undefined :to_html"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
@title = params[:id]
|
62
|
+
end
|
63
|
+
|
64
|
+
=begin
|
65
|
+
def history
|
66
|
+
setup
|
67
|
+
@history = File.read("session/history")
|
68
|
+
end
|
69
|
+
=end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def setup
|
74
|
+
@local_vars = $drb_server.registry
|
75
|
+
end
|
76
|
+
|
77
|
+
def get_inheritance obj
|
78
|
+
# mods = obj.included_modules - [PP::ObjectMixin, Bio::Shell, WEBrick]
|
79
|
+
mods = obj.included_modules
|
80
|
+
module_links = mods.collect{|m|
|
81
|
+
" [<a href=#{DocumentRegistry[m.to_s]}>#{m.to_s}</a>] "
|
82
|
+
}.join("|")
|
83
|
+
|
84
|
+
inherit = []
|
85
|
+
loop do
|
86
|
+
inherit.push(" [<a href=#{DocumentRegistry[obj.to_s]}>#{obj.to_s}</a>] ")
|
87
|
+
break if obj == Object
|
88
|
+
obj = obj.superclass
|
89
|
+
end
|
90
|
+
"<table><tr><th>Inheritance</th><td>" + inherit.join(" < ") + "</td></tr>" +
|
91
|
+
"<tr><th>Mix-in</th><td>" + module_links + "</td</tr></table>"
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Model object for rails
|
2
|
+
class ShellConnection
|
3
|
+
|
4
|
+
# include DRb::DRbObservable
|
5
|
+
|
6
|
+
attr_reader :registry
|
7
|
+
|
8
|
+
def puts_remote(str)
|
9
|
+
STDOUT.puts(str)
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@connected = false
|
14
|
+
@registry = {}
|
15
|
+
end
|
16
|
+
|
17
|
+
def [] o_id
|
18
|
+
@registry[o_id]
|
19
|
+
end
|
20
|
+
|
21
|
+
def []=(name, obj)
|
22
|
+
@registry[name] = obj
|
23
|
+
end
|
24
|
+
|
25
|
+
def delete(name)
|
26
|
+
@registry.delete(name)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>BioRuby shell on Rails</title>
|
4
|
+
<link href="/stylesheets/main.css" media="screen" rel="Stylesheet" type="text/css" />
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
|
8
|
+
<div id="side">
|
9
|
+
<img src="/images/icon.png">
|
10
|
+
<br>
|
11
|
+
<!--
|
12
|
+
<h2>Status</h2>
|
13
|
+
<ul><li><%= @connected ? "Not Connected" : "Connected" %></li></ul>
|
14
|
+
<h2>History</h2>
|
15
|
+
<ul>
|
16
|
+
<li>
|
17
|
+
<%= link_to "History", :action => "history" %>
|
18
|
+
</li>
|
19
|
+
</ul>
|
20
|
+
-->
|
21
|
+
<h2>Local variables</h2>
|
22
|
+
<ul>
|
23
|
+
<% @local_vars.each do |idx, var| %>
|
24
|
+
<li><%= link_to idx, {:action => "show", :id => idx}%></li>
|
25
|
+
<% end %>
|
26
|
+
</ul>
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div id="banner">
|
31
|
+
BioRuby shell on Rails
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div id="main">
|
35
|
+
<%= @content_for_layout %>
|
36
|
+
</div>
|
37
|
+
</body>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
2
|
+
|
3
|
+
unless defined?(RAILS_ROOT)
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
+
unless RUBY_PLATFORM =~ /mswin32/
|
6
|
+
require 'pathname'
|
7
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
8
|
+
end
|
9
|
+
RAILS_ROOT = root_path
|
10
|
+
end
|
11
|
+
|
12
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
13
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
14
|
+
else
|
15
|
+
require 'rubygems'
|
16
|
+
require 'initializer'
|
17
|
+
end
|
18
|
+
|
19
|
+
Rails::Initializer.run(:set_load_path)
|