~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to lib/irb/help.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#   irb/help.rb - print usase module
 
3
#       $Release Version: 0.9.5$
 
4
#       $Revision: 11708 $
 
5
#       $Date: 2007-02-13 08:01:19 +0900 (Tue, 13 Feb 2007) $
 
6
#       by Keiju ISHITSUKA(keiju@ishitsuka.com)
 
7
#
 
8
# --
 
9
#
 
10
#   
 
11
#
 
12
 
 
13
module IRB
 
14
  def IRB.print_usage
 
15
    lc = IRB.conf[:LC_MESSAGES]
 
16
    path = lc.find("irb/help-message")
 
17
    space_line = false
 
18
    File.foreach(path) do
 
19
      |l|
 
20
      if /^\s*$/ =~ l
 
21
        lc.puts l unless space_line
 
22
        space_line = true
 
23
        next
 
24
      end
 
25
      space_line = false
 
26
      
 
27
      l.sub!(/#.*$/, "")
 
28
      next if /^\s*$/ =~ l
 
29
      lc.puts l
 
30
    end
 
31
  end
 
32
end
 
33