* prelude.rb (require_relative): move require_relative from

lib/require_relative.rb.  [ruby-core:16356]

* lib/require_relative.rb: removed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-12 14:50:18 +00:00
Родитель 7b4a171158
Коммит 6b36f117f2
12 изменённых файлов: 17 добавлений и 20 удалений

Просмотреть файл

@ -12,6 +12,13 @@ Sat Apr 12 12:41:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
parser_warn, e_option_supplied, warn_unless_e_option, range_op, parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used. cond0): nd_file is no longer used.
Sat Apr 12 12:17:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* prelude.rb (require_relative): move require_relative from
lib/require_relative.rb. [ruby-core:16356]
* lib/require_relative.rb: removed.
Sat Apr 12 05:55:57 2008 Eric Hodel <drbrain@segment7.net> Sat Apr 12 05:55:57 2008 Eric Hodel <drbrain@segment7.net>
* lib/rubygems*, test/rubygems*: Update to RubyGems 1.1.1 r1701. * lib/rubygems*, test/rubygems*: Update to RubyGems 1.1.1 r1701.

Просмотреть файл

@ -1,11 +0,0 @@
def require_relative(relative_feature)
c = caller.first
e = c.rindex(/:\d+:in /)
file = $`
if /\A\((.*)\)/ =~ file # eval, etc.
raise LoadError, "require_relative is called in #{$1}"
end
absolute_feature = File.expand_path(File.join(File.dirname(file), relative_feature))
require absolute_feature
end

Просмотреть файл

@ -23,3 +23,13 @@ class Thread
end end
end end
def require_relative(relative_feature)
c = caller.first
e = c.rindex(/:\d+:in /)
file = $`
if /\A\((.*)\)/ =~ file # eval, etc.
raise LoadError, "require_relative is called in #{$1}"
end
absolute_feature = File.expand_path(File.join(File.dirname(file), relative_feature))
require absolute_feature
end

Просмотреть файл

@ -490,7 +490,6 @@ class TestAssignment < Test::Unit::TestCase
end end
end end
require 'require_relative'
require_relative 'sentence' require_relative 'sentence'
class TestAssignmentGen < Test::Unit::TestCase class TestAssignmentGen < Test::Unit::TestCase
Syntax = { Syntax = {

Просмотреть файл

@ -1,6 +1,5 @@
require 'test/unit' require 'test/unit'
require 'tempfile' require 'tempfile'
require 'require_relative'
require_relative 'envutil' require_relative 'envutil'
class TestBeginEndBlock < Test::Unit::TestCase class TestBeginEndBlock < Test::Unit::TestCase

Просмотреть файл

@ -1,6 +1,5 @@
require 'test/unit' require 'test/unit'
require 'tempfile' require 'tempfile'
require 'require_relative'
require_relative 'ut_eof' require_relative 'ut_eof'
class TestFile < Test::Unit::TestCase class TestFile < Test::Unit::TestCase

Просмотреть файл

@ -1,6 +1,5 @@
require 'test/unit' require 'test/unit'
require 'stringio' require 'stringio'
require 'require_relative'
require_relative 'allpairs' require_relative 'allpairs'
class TestM17NComb < Test::Unit::TestCase class TestM17NComb < Test::Unit::TestCase

Просмотреть файл

@ -1,5 +1,4 @@
require 'test/unit' require 'test/unit'
require 'require_relative'
require_relative 'marshaltestlib' require_relative 'marshaltestlib'
class TestMarshal < Test::Unit::TestCase class TestMarshal < Test::Unit::TestCase

Просмотреть файл

@ -1,5 +1,4 @@
require 'test/unit' require 'test/unit'
require 'require_relative'
require_relative 'ut_eof' require_relative 'ut_eof'
class TestPipe < Test::Unit::TestCase class TestPipe < Test::Unit::TestCase

Просмотреть файл

@ -1,5 +1,4 @@
require 'test/unit' require 'test/unit'
require 'require_relative'
require_relative 'allpairs' require_relative 'allpairs'
class TestSprintfComb < Test::Unit::TestCase class TestSprintfComb < Test::Unit::TestCase

Просмотреть файл

@ -1,6 +1,5 @@
require 'test/unit' require 'test/unit'
require 'tmpdir' require 'tmpdir'
require 'require_relative'
require_relative 'envutil' require_relative 'envutil'
class TestSystem < Test::Unit::TestCase class TestSystem < Test::Unit::TestCase

Просмотреть файл

@ -74,7 +74,6 @@ class TestRubyYield < Test::Unit::TestCase
end end
end end
require 'require_relative'
require_relative 'sentence' require_relative 'sentence'
class TestRubyYieldGen < Test::Unit::TestCase class TestRubyYieldGen < Test::Unit::TestCase
Syntax = { Syntax = {