[Prime-cvs] CVS update: prime/lib

Back to archive index

Hiroyuki Komatsu komat****@users*****
2005年 1月 19日 (水) 03:39:35 JST


Index: prime/lib/session.rb
diff -u prime/lib/session.rb:1.4.4.18 prime/lib/session.rb:1.4.4.19
--- prime/lib/session.rb:1.4.4.18	Tue Jan 18 11:04:32 2005
+++ prime/lib/session.rb	Wed Jan 19 03:39:34 2005
@@ -1,5 +1,5 @@
 # session.rb
-# $Id: session.rb,v 1.4.4.18 2005/01/18 02:04:32 komatsu Exp $
+# $Id: session.rb,v 1.4.4.19 2005/01/18 18:39:34 komatsu Exp $
 #
 # Copyright (C) 2001 Satoru Takabayashi <sator****@namaz*****>
 # Copyright (C) 2002, 2003, 2004 Hiroyuki Komatsu <komat****@taiya*****>
@@ -354,7 +354,7 @@
   end
 
   def session_end (session)
-    @prime.session_end()
+    @prime.session_end(session)
     return reply_successful()
   end
 
Index: prime/lib/prime2.rb
diff -u prime/lib/prime2.rb:1.1.2.11 prime/lib/prime2.rb:1.1.2.12
--- prime/lib/prime2.rb:1.1.2.11	Tue Jan 18 11:04:32 2005
+++ prime/lib/prime2.rb	Wed Jan 19 03:39:34 2005
@@ -1,5 +1,5 @@
 # prime2.rb: Module for PRIME2 protocol.
-# $Id: prime2.rb,v 1.1.2.11 2005/01/18 02:04:32 komatsu Exp $
+# $Id: prime2.rb,v 1.1.2.12 2005/01/18 18:39:34 komatsu Exp $
 #
 # Copyright (C) 2004 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -10,14 +10,6 @@
 
 require 'suikyo/suikyo-composer'
 
-require 'prime/engine/engine-basic'
-require 'prime/engine/engine-english'
-require 'prime/engine/engine-userdict2'
-require 'prime/engine/engine-userdict2-en'
-require 'prime/engine/engine-personaldict'
-require 'prime/engine/engine-alphabet'
-require 'prime/engine/engine-number'
-
 module Prime2
   def initialize_prime2 ()
     @sessions   = {}
@@ -698,28 +690,30 @@
 
     def initialize_engines_japanese ()
       engine_classes = [
-        PrimeEngineBasic,
-        PrimeEngineUserdict2,
-        PrimeEnginePersonalDict,
-        PrimeEngineAlphabet,
-        PrimeEngineNumber,
+        :PrimeEngineBasic,
+        :PrimeEngineUserdict2,
+        :PrimeEnginePersonalDict,
+        :PrimeEngineAlphabet,
+        :PrimeEngineNumber,
       ]
       return initialize_engines_internal(engine_classes)
     end
 
     def initialize_engines_english ()
       engine_classes = [
-        PrimeEngineEnglish,
-        PrimeEngineUserdict2English,
-        PrimeEnginePersonalDict,
-        PrimeEngineAlphabet,
-        PrimeEngineNumber,
+        :PrimeEngineEnglish,
+        :PrimeEngineUserdict2English,
+        :PrimeEnginePersonalDict,
+        :PrimeEngineAlphabet,
+        :PrimeEngineNumber,
       ]
       return initialize_engines_internal(engine_classes)
     end
 
     def initialize_engines_internal (engine_classes)
-      engines = engine_classes.map { |engine_class| engine_class.new() }
+      engines = engine_classes.map { | engine_class |
+        eval( engine_class.to_s ).new()
+      }
 
       def engines.command (method, *args)
         self.map {|engine|
Index: prime/lib/prime.rb
diff -u prime/lib/prime.rb:1.7.4.16 prime/lib/prime.rb:1.7.4.17
--- prime/lib/prime.rb:1.7.4.16	Fri Dec 31 15:05:01 2004
+++ prime/lib/prime.rb	Wed Jan 19 03:39:34 2005
@@ -1,5 +1,5 @@
 # prime/prime.rb
-# $Id: prime.rb,v 1.7.4.16 2004/12/31 06:05:01 komatsu Exp $
+# $Id: prime.rb,v 1.7.4.17 2005/01/18 18:39:34 komatsu Exp $
 #
 # Copyright (C) 2002, 2003, 2004 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -15,6 +15,14 @@
 require 'prime/prime-japanese'
 require 'prime/prime-mixed'
 
+require 'prime/engine/engine-basic'
+require 'prime/engine/engine-english'
+require 'prime/engine/engine-userdict2'
+require 'prime/engine/engine-userdict2-en'
+require 'prime/engine/engine-personaldict'
+require 'prime/engine/engine-alphabet'
+require 'prime/engine/engine-number'
+
 PRIME_CONFIGFILE_GLOBAL = File::join2(PRIME_CONFIG_DIR,  "Custom_prime.rb")
 PRIME_CONFIGFILE_LOCAL  = (ENV['PRIME_CONFIG'] or 
                              File::join2(PRIME_USER_DIR, "Custom_prime.rb"))
@@ -65,28 +73,28 @@
       end
     when 'english' then
       PRIME_ENV['style_auto_space'] = true
-      PRIME_ENV['engines'] = ['prime/engine/engine-adambnc',
-                              'prime/engine/engine-userdict2-en',
-                              'prime/engine/engine-alphabet',
-                              'prime/engine/engine-number']
+      PRIME_ENV['engines'] = [
+        :PrimeEngineEnglish,
+        :PrimeEngineUserdict2English,
+        :PrimeEnginePersonalDict,
+        :PrimeEngineAlphabet,
+        :PrimeEngineNumber,
+      ]
     end
   end
 
-  def init_engines(engine_files = nil)
-    engines = []
+  def init_engines(engine_classes = nil)
+    engine_classes = (engine_classes or PRIME_ENV['engines'])
+    engines = engine_classes.map { | engine_class |
+      eval( engine_class.to_s ).new()
+    }
+
     def engines.command (method, *args)
       self.map {|engine|
-	engine.send(method, *args)
+        engine.send(method, *args)
       }
     end
 
-    engine_files = (engine_files or PRIME_ENV['engines'])
-
-    engine_files.each {|engine_file|
-      require engine_file
-      engines << eval($engine_class_name).new
-    }
-    debug_message("Init done.")
     return engines
   end
 
Index: prime/lib/prime-config.rb.in
diff -u prime/lib/prime-config.rb.in:1.2.4.7 prime/lib/prime-config.rb.in:1.2.4.8
--- prime/lib/prime-config.rb.in:1.2.4.7	Thu Dec  9 23:51:43 2004
+++ prime/lib/prime-config.rb.in	Wed Jan 19 03:39:34 2005
@@ -1,5 +1,5 @@
 # prime-config.rb: Setting of global variables and default variables for PRIME.
-# $Id: prime-config.rb.in,v 1.2.4.7 2004/12/09 14:51:43 komatsu Exp $
+# $Id: prime-config.rb.in,v 1.2.4.8 2005/01/18 18:39:34 komatsu Exp $
 #
 # Copyright (C) 2003 Hiroyuki Komatsu <komat****@taiya*****>
 #     All rights reserved.
@@ -29,12 +29,13 @@
 PRIME_ENV = {}
 
 ## Enginges: kana-kanji conversion engines.
-PRIME_ENV['engines'] = ['prime/engine/engine-basic',
-                        'prime/engine/engine-userdict2',
-#                         'prime/engine/engine-userdict',
-                        'prime/engine/engine-personaldict',
-                        'prime/engine/engine-alphabet',
-                        'prime/engine/engine-number']
+PRIME_ENV['engines'] = [
+  :PrimeEngineBasic,
+  :PrimeEngineUserdict2,
+  :PrimeEnginePersonalDict,
+  :PrimeEngineAlphabet,
+  :PrimeEngineNumber,
+]
 
 ## Suikyo: romaji-kana conversion library.
 PRIME_TYPING_METHOD_DEFAULT         = 'romaji'


Prime-cvs メーリングリストの案内
Back to archive index