[BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates _methods.rhtml, 1.1, 1.2 bioruby.css, 1.1, 1.2 bioruby_controller.rb, 1.1, 1.2 bioruby_helper.rb, 1.1, 1.2 index.rhtml, 1.1, 1.2

Katayama Toshiaki k at dev.open-bio.org
Tue Jan 16 05:47:07 UTC 2007


Update of /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates
In directory dev.open-bio.org:/tmp/cvs-serv31319

Modified Files:
	_methods.rhtml bioruby.css bioruby_controller.rb 
	bioruby_helper.rb index.rhtml 
Log Message:
Feature enhancements:
* Input [#] is linked to action for filling textarea from history
* [methods] is separated into columns for readability
Fixes and improvements:
* HIDE_VARIABLES is moved from helper to controller to avoid warning
  "already initialized constant - HIDE_VARIABLES" repeated upon reload
* <div id="evaluate"> is renamed to "log_#" with number for future extention
* <div id="log_#"> are inserted in the <div id="logs">
* CSS is modified and updated to follow evaluate -> log change


Index: index.rhtml
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/index.rhtml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** index.rhtml	24 Dec 2006 08:27:15 -0000	1.1
--- index.rhtml	16 Jan 2007 05:47:05 -0000	1.2
***************
*** 15,16 ****
--- 15,19 ----
  <%= end_form_tag %>
  </div>
+ <div id="logs">
+ </div>
+ 

Index: bioruby_helper.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby_helper.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bioruby_helper.rb	24 Dec 2006 08:27:15 -0000	1.1
--- bioruby_helper.rb	16 Jan 2007 05:47:05 -0000	1.2
***************
*** 1,8 ****
  module BiorubyHelper
  
-   HIDE_VARIABLES = [
-     "_", "irb", "_erbout",
-   ]
- 
    include Bio::Shell
  
--- 1,4 ----
***************
*** 16,20 ****
  
    def local_variables
!     eval("local_variables", Bio::Shell.cache[:binding]) - HIDE_VARIABLES
    end
  
--- 12,25 ----
  
    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
  
***************
*** 36,37 ****
--- 41,43 ----
  
  end
+ 

Index: bioruby_controller.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby_controller.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bioruby_controller.rb	24 Dec 2006 08:27:15 -0000	1.1
--- bioruby_controller.rb	16 Jan 2007 05:47:05 -0000	1.2
***************
*** 1,8 ****
  class BiorubyController < ApplicationController
  
!   HIDE_METHODS = Object.methods
  
    HIDE_MODULES = [
      WEBrick, Base64::Deprecated, Base64, PP::ObjectMixin,
    ]
  
--- 1,20 ----
  class BiorubyController < ApplicationController
  
!   HIDE_METHODS = Object.methods + [ "singleton_method_added" ]
  
    HIDE_MODULES = [
+     ActiveSupport::CoreExtensions::String::Iterators,
+     ActiveSupport::CoreExtensions::String::StartsEndsWith,
+     ActiveSupport::CoreExtensions::String::Inflections,
+     ActiveSupport::CoreExtensions::String::Conversions,
+     ActiveSupport::CoreExtensions::String::Access,
+     ActiveSupport::CoreExtensions::Numeric::Bytes,
+     ActiveSupport::CoreExtensions::Numeric::Time,
      WEBrick, Base64::Deprecated, Base64, PP::ObjectMixin,
+     Bio::Shell
+   ]
+ 
+   HIDE_VARIABLES = [
+     "_", "irb", "_erbout",
    ]
  
***************
*** 27,35 ****
  
      render :update do |page|
!       page.insert_html :after, "console", :partial => "result"
!       page.replace_html "variables", :partial => "variables"
!       page.hide "methods_#{@number}"
!       page.hide "classes_#{@number}"
!       page.hide "modules_#{@number}"
      end
    end
--- 39,43 ----
  
      render :update do |page|
!       render_log(page)
      end
    end
***************
*** 37,40 ****
--- 45,49 ----
    def list_methods
      number = params[:number].to_i
+ 
      script, result, output = Bio::Shell.cache[:results].restore(number)
      @class = result.class
***************
*** 49,52 ****
--- 58,62 ----
    def list_classes
      number = params[:number].to_i
+ 
      script, result, output = Bio::Shell.cache[:results].restore(number)
      class_name = result.class
***************
*** 70,73 ****
--- 80,84 ----
    def list_modules
      number = params[:number].to_i
+ 
      script, result, output = Bio::Shell.cache[:results].restore(number)
      @class = result.class
***************
*** 80,83 ****
--- 91,104 ----
    end
  
+   def reload_script
+     number = params[:number].to_i
+ 
+     script, result, output = Bio::Shell.cache[:results].restore(number)
+ 
+     render :update do |page|
+       page.replace_html :script, script
+     end
+   end
+ 
    def results
      if Bio::Shell.cache[:results].number > 0
***************
*** 89,93 ****
        render :update do |page|
          # delete all existing results in the current DOM for clean up
!         page.select(".evaluate").each do |element|
            page.remove element
          end
--- 110,115 ----
        render :update do |page|
          # delete all existing results in the current DOM for clean up
!         page.select(".log").each do |element|
!           #page.hide element
            page.remove element
          end
***************
*** 95,105 ****
          # add selected results to the current DOM
          min_num.upto(max_num) do |@number|
            @script, @result, @output = Bio::Shell.cache[:results].restore(@number)
            if @script
!             page.insert_html :after, "console", :partial => "result"
!             page.replace_html "variables", :partial => "variables"
!             page.hide "methods_#{@number}"
!             page.hide "classes_#{@number}"
!             page.hide "modules_#{@number}"
            end
          end
--- 117,124 ----
          # add selected results to the current DOM
          min_num.upto(max_num) do |@number|
+           #page.show "log_#{@number}"
            @script, @result, @output = Bio::Shell.cache[:results].restore(@number)
            if @script
!             render_log(page)
            end
          end

Index: _methods.rhtml
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_methods.rhtml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** _methods.rhtml	24 Dec 2006 08:27:15 -0000	1.1
--- _methods.rhtml	16 Jan 2007 05:47:05 -0000	1.2
***************
*** 1,4 ****
  [ <%= @class %> ]
! <% @methods.sort.each do |x| %>
! <%= x %>
! <% end %>
\ No newline at end of file
--- 1,9 ----
  [ <%= @class %> ]
! <table id="list_methods">
! <tr>
! <%- step = @methods.size / 4 + 1 -%>
! <%- 0.step(@methods.size, step) do |i| -%>
! <td><%= @methods.sort[i, step].join("<br>") %></td>
! <%- end -%>
! </tr>
! </table>
\ No newline at end of file

Index: bioruby.css
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bioruby.css	24 Dec 2006 08:27:15 -0000	1.1
--- bioruby.css	16 Jan 2007 05:47:05 -0000	1.2
***************
*** 26,35 ****
  }
  
! div.evaluate div.input pre.script {
  	background-color: #ffffeb;
  	border-style: solid;
  }
  
! div.evaluate div.output div.methods {
  	padding: 5px;
  	background-color: #ffffdd;
--- 26,35 ----
  }
  
! div.log div.input pre.script {
  	background-color: #ffffeb;
  	border-style: solid;
  }
  
! div.log div.output div.methods {
  	padding: 5px;
  	background-color: #ffffdd;
***************
*** 37,41 ****
  }
  
! div.evaluate div.output div.classes {
  	padding: 5px;
  	background-color: #ccffcc;
--- 37,41 ----
  }
  
! div.log div.output div.classes {
  	padding: 5px;
  	background-color: #ccffcc;
***************
*** 43,47 ****
  }
  
! div.evaluate div.output div.modules {
  	padding: 5px;
  	background-color: #ffcccc;
--- 43,47 ----
  }
  
! div.log div.output div.modules {
  	padding: 5px;
  	background-color: #ffcccc;
***************
*** 49,61 ****
  }
  
! div.evaluate div.output pre.result {
  	border-style: dashed;
  }
  
! div.evaluate div.output pre.output {
  	border-style: dashed;
  }
  
! div.evaluate hr.evaluate {
  	border-style: dotted none none none;
  	border-top-width: 1px;
--- 49,61 ----
  }
  
! div.log div.output pre.result {
  	border-style: dashed;
  }
  
! div.log div.output pre.output {
  	border-style: dashed;
  }
  
! div.log hr.result {
  	border-style: dotted none none none;
  	border-top-width: 1px;
***************
*** 194,203 ****
--- 194,209 ----
  /* table */
  
+ table#list_methods {
+ 	width: 680px;
+ }
+ 
  th {
  	vertical-align: top;
+ 	padding: 5px;
  }
  
  td {
  	vertical-align: top;
+ 	padding: 5px;
  }
  
***************
*** 205,208 ****
--- 211,215 ----
  
  textarea {
+ 	font-family: monospace;
  	overflow: auto;
  }




More information about the bioruby-cvs mailing list