summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 10:43:12 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 10:43:12 +0000
commitb5cda0ffb61a2552e45d64728329a211fe51413a (patch)
tree5850586412113357cf41183fe85621e356b3873a
parent57682b05e1af3e40361a7d4c2bc7ab1153ded4a5 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/mkmf.rb7
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb2
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d05ae448438..5ce6b6252f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Nov 15 19:40:34 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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@fsij.org>
* common.mk: Remove comments in Dependency lines.
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1eb52047a38..d801a6ad8b8 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2050,8 +2050,11 @@ RULES
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
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index bf9618d3bfb..8f2cddee4de 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -66,7 +66,7 @@ module Kernel
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...