From: Masao M. <mu...@us...> - 2005-10-23 16:39:13
|
Update of /cvsroot/ruby-gnome2/rbbr/lib/rbbr/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25857/lib/rbbr/doc Modified Files: rd.rb ri.rb Log Message: * lib/rbbr/ui/linkedtextbuffer.rb: Improve to make links. * lib/rbbr/metainfo.rb: Lazy assembling module_names. * lib/rbbr/ui.rb, libselectiondialog.rb: rubygems support. * lib/rbbr/ui/downloader.rb: Added ruby-gnome2-api downloader. it downloads ruby-gnome2-api.tar.gz and installs it automatically. * data/rbbr/glade/downloader.glade: Added. * lib/rbbr/ui/stockbrowsedialog.rb: Improved resizing. * lib/rbbr/doc.rb: Load RD files from "~/.rbbr/rd/*". Load RD files in Japanese from RBBR::Config::LIBDIR + "/rbbr/doc/ja/*" and "~/.rbbr/rd/ja/*" when the locale is Japanese. * lib/rbbr/ui/infodialog.rb: Add BUILD_VERSION for GLib/GTK. Index: rd.rb =================================================================== RCS file: /cvsroot/ruby-gnome2/rbbr/lib/rbbr/doc/rd.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rd.rb 20 Jun 2005 17:58:31 -0000 1.4 +++ rd.rb 23 Oct 2005 16:39:03 -0000 1.5 @@ -17,12 +17,36 @@ module RBBR module Doc class RD < Database + def load(dir) + path = File.join(dir, "rd", "*") + Dir.glob(path) do |f| + if FileTest.file?(f) + @db[File.basename(CGI::unescape(f))] = File.open(f).read.split("\n") + end + end + if /^ja/ =~ Locale.get + path = File.join(dir, "rd", "ja", "*") + Dir.glob(path) do |f| + if FileTest.file?(f) + begin + @db[File.basename(CGI::unescape(f))] = GLib.convert(File.open(f).read, "UTF-8", "EUC-JP").split("\n") + rescue + puts $! if $DEBUG + end + end + end + end + end + def initialize super() @db = Hash.new - Dir.glob(RBBR::Config::DATA_DIR + "/rd/*") do |f| - @db[File.basename(CGI::unescape(f))] = File.open(f).read.split("\n") - end + + [RBBR::Config::DATA_DIR, + File.join(GLib.home_dir, ".rbbr") + ].each do |f| + load(f) + end end def lookup_class( klass ) Index: ri.rb =================================================================== RCS file: /cvsroot/ruby-gnome2/rbbr/lib/rbbr/doc/ri.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ri.rb 16 Jun 2005 12:46:44 -0000 1.8 +++ ri.rb 23 Oct 2005 16:39:03 -0000 1.9 @@ -22,7 +22,6 @@ module RBBR module Doc class RI < Database - def initialize @ri = ::RI.new @output = "" |