[Kazehakase-cvs] CVS update: kazehakase/data/ext/ruby/kz

Back to archive index

Kouhei Sutou kous****@users*****
Tue May 23 17:40:32 JST 2006


Index: kazehakase/data/ext/ruby/kz/actions.rb
diff -u kazehakase/data/ext/ruby/kz/actions.rb:1.8 kazehakase/data/ext/ruby/kz/actions.rb:1.9
--- kazehakase/data/ext/ruby/kz/actions.rb:1.8	Thu May 11 11:01:59 2006
+++ kazehakase/data/ext/ruby/kz/actions.rb	Tue May 23 17:40:32 2006
@@ -78,11 +78,12 @@
         Kz.print_error($!)
       end
 
-      private
-      def to_class_name(name)
-        name.gsub(/(?:\A|_|\-)([a-z])/) do |x|
-          $1.upcase
+      def search_file(first, *rest)
+        search_dirs.each do |path|
+          full_path = File.join(path, first, *rest)
+          return full_path if File.exist?(full_path)
         end
+        nil
       end
 
       def search_dirs
@@ -93,6 +94,13 @@
         search_dirs
       end
 
+      private
+      def to_class_name(name)
+        name.gsub(/(?:\A|_|\-)([a-z])/) do |x|
+          $1.upcase
+        end
+      end
+
       def search_action(name)
         search_dirs.each do |dir|
           action = File.join(dir, "#{name}.rb")


More information about the Kazehakase-cvs mailing list
Back to archive index