[BioRuby-cvs] bioruby/lib/bio/shell session.rb,1.3,1.4

Katayama Toshiaki k at pub.open-bio.org
Sun Nov 6 13:28:50 EST 2005


Update of /home/repository/bioruby/bioruby/lib/bio/shell
In directory pub.open-bio.org:/tmp/cvs-serv14499/lib/bio/shell

Modified Files:
	session.rb 
Log Message:
* ls method is changed to hide nil objects


Index: session.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/session.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** session.rb	6 Nov 2005 01:37:00 -0000	1.3
--- session.rb	6 Nov 2005 18:28:48 -0000	1.4
***************
*** 34,42 ****
  
    def ls
!     display eval("local_variables", conf.workspace.binding).inspect
    end
  
    def rm(name)                  # name = :hoge
!     eval("#{name} = nil", conf.workspace.binding)
    end
  
--- 34,49 ----
  
    def ls
!     list = eval("local_variables", conf.workspace.binding).reject { |x|
!       eval(x, conf.workspace.binding).nil?
!     }
!     display list.inspect
    end
  
    def rm(name)                  # name = :hoge
!     begin
!       eval("#{name} = nil", conf.workspace.binding)
!     rescue
!       puts "Usage: rm :var (rm var is not valid)"
!     end
    end
  



More information about the bioruby-cvs mailing list