[Groonga-mysql-commit] mroonga/mariadb-sync at e466e68 [master] Support Ruby 1.8

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jan 23 17:45:19 JST 2014


Kouhei Sutou	2014-01-23 17:45:19 +0900 (Thu, 23 Jan 2014)

  New Revision: e466e6815f8633866e3fefdba8d27345001257e9
  https://github.com/mroonga/mariadb-sync/commit/e466e6815f8633866e3fefdba8d27345001257e9

  Message:
    Support Ruby 1.8

  Modified files:
    flatten-test.rb

  Modified: flatten-test.rb (+9 -1)
===================================================================
--- flatten-test.rb    2014-01-22 18:11:23 +0900 (e7e884b)
+++ flatten-test.rb    2014-01-23 17:45:19 +0900 (5431eff)
@@ -27,6 +27,14 @@ def flatten_path(path)
   Pathname(t_or_r) + components.join("_")
 end
 
+def valid_string?(string)
+  if string.respond_to?(:valid_encoding?)
+    string.valid_encoding?
+  else
+    true
+  end
+end
+
 def resolve_include_path(path, relative_path)
   content = path.open do |file|
     file.read
@@ -34,7 +42,7 @@ def resolve_include_path(path, relative_path)
   n_parents = relative_path.dirname.dirname.to_s.split("/").size
   resolved_content = ""
   content.each_line do |line|
-    if line.valid_encoding?
+    if valid_string?(line)
       line = line.gsub(/^(--source )(\..*\/include\/mroonga\/.*)/) do
         prefix = $1
         mroonga_include_path = $2
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-mysql-commit mailing list
Back to archive index