fantasdic r318 - in trunk: . lib lib/fantasdic



Author: mblondel
Date: Tue Aug 19 15:43:38 2008
New Revision: 318
URL: http://svn.gnome.org/viewvc/fantasdic?rev=318&view=rev

Log:
    * lib/fantasdic/source_base.rb: Created Source::Base::load_plugins class
    method.
    * lib/fantasdic.rb: Use it!


Modified:
   trunk/ChangeLog
   trunk/lib/fantasdic.rb
   trunk/lib/fantasdic/source_base.rb

Modified: trunk/lib/fantasdic.rb
==============================================================================
--- trunk/lib/fantasdic.rb	(original)
+++ trunk/lib/fantasdic.rb	Tue Aug 19 15:43:38 2008
@@ -103,6 +103,8 @@
     DESCRIPTION = _("Look up words in various dictionary sources")
 
     def self.main
+        Source::Base::load_plugins
+
         options = CommandLineOptions.instance
 
         if ARGV.length == 1 or ARGV.length > 2

Modified: trunk/lib/fantasdic/source_base.rb
==============================================================================
--- trunk/lib/fantasdic/source_base.rb	(original)
+++ trunk/lib/fantasdic/source_base.rb	Tue Aug 19 15:43:38 2008
@@ -267,9 +267,11 @@
             end
         end
 
-        # Load found source plugins (system-wide and user-wide)
-        [Config::SOURCE_DIR, Config::PERSONAL_SOURCE_DIR].each do |dir|
-            Dir["#{dir}/*.rb"].each { |f| load f }
+        def self.load_plugins
+            # Load found source plugins (system-wide and user-wide)
+            [Config::SOURCE_DIR, Config::PERSONAL_SOURCE_DIR].each do |dir|
+                Dir["#{dir}/*.rb"].each { |f| load f }
+            end
         end
 
     end # class Base



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]