[Groonga-commit] groonga/groonga at eae89ee [master] Accept --debug flag

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Nov 4 16:22:16 JST 2015


Kouhei Sutou	2015-11-04 16:22:16 +0900 (Wed, 04 Nov 2015)

  New Revision: eae89eea366b423aec90acf3855017be6a1ac43f
  https://github.com/groonga/groonga/commit/eae89eea366b423aec90acf3855017be6a1ac43f

  Message:
    Accept --debug flag

  Modified files:
    vendor/download_mecab.rb

  Modified: vendor/download_mecab.rb (+3 -5)
===================================================================
--- vendor/download_mecab.rb    2015-11-04 16:21:01 +0900 (89c1a07)
+++ vendor/download_mecab.rb    2015-11-04 16:22:16 +0900 (95d92e9)
@@ -6,6 +6,8 @@ require "open-uri"
 require "rubygems/package"
 require "zlib"
 
+ �� debug = (ENV["DEBUG"] == "true" or ARGV.include?("--debug"))
+
 base_dir = Pathname.new(__FILE__).expand_path.dirname.parent
 
 mecab_version = (base_dir + "bundled_mecab_version").read.strip
@@ -14,15 +16,11 @@ mecab_naist_jdic_version = (base_dir + "bundled_mecab_naist_jdic_version").read.
 mecab_base = "mecab-#{mecab_version}"
 mecab_naist_jdic_base = "mecab-naist-jdic-#{mecab_naist_jdic_version}"
 
-def debug?
-  ENV["DEBUG"] == "true"
-end
-
 def extract_tar_gz(tar_gz_path)
   Zlib::GzipReader.open(tar_gz_path) do |tar_io|
     Gem::Package::TarReader.new(tar_io) do |tar|
       tar.each do |entry|
-        p [entry.header.typeflag, entry.full_name] if debug?
+        p [entry.header.typeflag, entry.full_name] if @debug
         if entry.directory?
           FileUtils.mkdir_p(entry.full_name)
         elsif entry.file?
-------------- next part --------------
HTML����������������������������...
Download 



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