summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb7
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1eb52047a3..d801a6ad8b 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 bf9618d3bf..8f2cddee4d 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...