mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems/stub_specification.rb (Gem::StubSpecification#data):
should not change the value of $. when `require`ing gems. this fixed test failures introduced by r51813. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40f304e025
commit
5e262e5277
2 changed files with 20 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
|||
Wed Sep 9 18:16:14 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* lib/rubygems/stub_specification.rb (Gem::StubSpecification#data):
|
||||
should not change the value of $. when `require`ing gems.
|
||||
this fixed test failures introduced by r51813.
|
||||
|
||||
Wed Sep 9 16:55:45 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* ruby.c (usage, enable_option, disable_option, process_options): new
|
||||
|
|
|
@ -73,18 +73,23 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|||
unless @data
|
||||
@extensions = []
|
||||
|
||||
open loaded_from, OPEN_MODE do |file|
|
||||
begin
|
||||
file.readline # discard encoding line
|
||||
stubline = file.readline.chomp
|
||||
if stubline.start_with?(PREFIX) then
|
||||
@data = StubLine.new stubline
|
||||
begin
|
||||
saved_lineno = $.
|
||||
open loaded_from, OPEN_MODE do |file|
|
||||
begin
|
||||
file.readline # discard encoding line
|
||||
stubline = file.readline.chomp
|
||||
if stubline.start_with?(PREFIX) then
|
||||
@data = StubLine.new stubline
|
||||
|
||||
@extensions = $'.split "\0" if
|
||||
/\A#{PREFIX}/ =~ file.readline.chomp
|
||||
@extensions = $'.split "\0" if
|
||||
/\A#{PREFIX}/ =~ file.readline.chomp
|
||||
end
|
||||
rescue EOFError
|
||||
end
|
||||
rescue EOFError
|
||||
end
|
||||
ensure
|
||||
$. = saved_lineno
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue