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

ruby-changes:36354

From: usa <ko1@a...>
Date: Sat, 15 Nov 2014 19:43:22 +0900 (JST)
Subject: [ruby-changes:36354] usa:r48435 (trunk): * lib/mkmf.rb (depend_rules): support comments during a line.

usa	2014-11-15 19:43:12 +0900 (Sat, 15 Nov 2014)

  New Revision: 48435

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

  Log:
    * lib/mkmf.rb (depend_rules): support comments during a line.
    
    * lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
      file contains path.

  Modified files:
    trunk/ChangeLog
    trunk/lib/mkmf.rb
    trunk/lib/rubygems/core_ext/kernel_require.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48434)
+++ ChangeLog	(revision 48435)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Nov 15 19:40:34 2014  NAKAMURA Usaku  <usa@r...>
+
+	* lib/mkmf.rb (depend_rules): support comments during a line.
+
+	* lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
+	  file contains path.
+
 Sat Nov 15 19:25:46 2014  Tanaka Akira  <akr@f...>
 
 	* common.mk: Remove comments in Dependency lines.
Index: lib/rubygems/core_ext/kernel_require.rb
===================================================================
--- lib/rubygems/core_ext/kernel_require.rb	(revision 48434)
+++ lib/rubygems/core_ext/kernel_require.rb	(revision 48435)
@@ -66,7 +66,7 @@ module Kernel https://github.com/ruby/ruby/blob/trunk/lib/rubygems/core_ext/kernel_require.rb#L66
 
     begin
       RUBYGEMS_ACTIVATION_MONITOR.exit
-      return gem_original_require(path)
+      return gem_original_require(spec.to_fullpath(path) || path)
     end if spec
 
     # Attempt to find +path+ in any unresolved gems...
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 48434)
+++ lib/mkmf.rb	(revision 48435)
@@ -2050,8 +2050,11 @@ RULES https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2050
         suffixes << m[1] << m[2]
         implicit = [[m[1], m[2]], [m.post_match]]
         next
-      elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
-        line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+    elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
+        line.sub!(%r'(\s)*\#.*$', '')
+        comment = $& || ''
+        line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+        line = line.chomp + comment + "\n"
       end
       depout << line
     end

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

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