[前][次][番号順一覧][スレッド一覧]

ruby-changes:42442

From: nobu <ko1@a...>
Date: Fri, 8 Apr 2016 11:56:52 +0900 (JST)
Subject: [ruby-changes:42442] nobu:r54516 (trunk): tk/extconf.rb: progress

nobu	2016-04-08 12:53:28 +0900 (Fri, 08 Apr 2016)

  New Revision: 54516

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54516

  Log:
    tk/extconf.rb: progress
    
    * ext/tk/extconf.rb (progress): print progress messages only if
      Logging is quiet.

  Modified files:
    trunk/ext/tk/extconf.rb
Index: ext/tk/extconf.rb
===================================================================
--- ext/tk/extconf.rb	(revision 54515)
+++ ext/tk/extconf.rb	(revision 54516)
@@ -127,6 +127,15 @@ def maybe_64bit? https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L127
   /64|universal|s390x/ =~ RUBY_PLATFORM
 end
 
+if defined?(Logging.quiet) and Logging.quiet
+  def progress(s)
+    print(s)
+  end
+else
+  def progress(s)
+  end
+end
+
 def check_tcltk_version(version)
   return [nil, nil] unless version.kind_of? String
 
@@ -757,7 +766,7 @@ def search_tclConfig(*paths) # libdir li https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L766
       dir.strip.chomp('/')
     end
   }.each{|dir|
-    print("."); progress_flag = true # progress
+    progress("."); progress_flag = true
     # print("check #{dir} ==>");
     if dir.kind_of? Array
       tcldir, tkdir = dir
@@ -1182,7 +1191,7 @@ def find_tcl(tcllib, stubs, version, *op https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1191
     end
   }
 
-  print("\n") # progress
+  progress("\n")
   [false, nil, nil, nil]
 end
 
@@ -1321,7 +1330,7 @@ def find_tk(tklib, stubs, version, *opt_ https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1330
     end
   }
 
-  print("\n") # progress
+  progress("\n")
   [false, nil, nil, nil]
 end
 
@@ -1402,7 +1411,7 @@ def find_tcltk_header(tclver, tkver) https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1411
     else
       major = minor = nil
     end
-    print(".") # progress
+    progress(".")
     if major && minor
       # version check on tcl.h
       version_check = proc {|code|
@@ -1445,7 +1454,7 @@ def find_tcltk_header(tclver, tkver) https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1454
         version_check = nil
       end
       have_tcl_h = paths.find{|path|
-        print(".") # progress
+        progress(".")
         inc_opt = " -I#{path.quote}"
         if try_header("tcl", inc_opt, &version_check)
           ($INCFLAGS ||= "") << inc_opt
@@ -1469,7 +1478,7 @@ def find_tcltk_header(tclver, tkver) https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1478
     else
       major = minor = nil
     end
-    print(".") # progress
+    progress(".")
     if major && minor
       # version check on tk.h
       version_check = proc {|code|
@@ -1512,7 +1521,7 @@ def find_tcltk_header(tclver, tkver) https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1521
         version_check = nil
       end
       have_tk_h = paths.find{|path|
-        print(".") # progress
+        progress(".")
         inc_opt = " -I#{path.quote}"
         if try_header(%w'tcl.h tk.h', inc_opt, &version_check)
           ($INCFLAGS ||= "") << inc_opt
@@ -1800,21 +1809,21 @@ print("check functions.") https://github.com/ruby/ruby/blob/trunk/ext/tk/extconf.rb#L1809
  ruby_enc_find_basename
 ".each do |func|
   have_func(func, "ruby.h")
-  print(".") # progress
+  progress(".")
 end
-print("\n") # progress
+progress("\n")
 
 # check libraries
 unless is_win32?
   print("check libraries.")
   have_library("nsl", "t_open")
-  print(".") # progress
+  progress(".")
   have_library("socket", "socket")
-  print(".") # progress
+  progress(".")
   have_library("dl", "dlopen")
-  print(".") # progress
+  progress(".")
   have_library("m", "log", "math.h")
-  print("\n") # progress
+  progress("\n")
 end
 $CPPFLAGS ||= ""
 $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]