mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
7b4a171158
commit
6b36f117f2
12 changed files with 17 additions and 20 deletions
|
@ -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,
|
||||
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>
|
||||
|
||||
* 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
|
||||
|
10
prelude.rb
10
prelude.rb
|
@ -23,3 +23,13 @@ class Thread
|
|||
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
|
||||
|
||||
require 'require_relative'
|
||||
require_relative 'sentence'
|
||||
class TestAssignmentGen < Test::Unit::TestCase
|
||||
Syntax = {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'test/unit'
|
||||
require 'tempfile'
|
||||
require 'require_relative'
|
||||
require_relative 'envutil'
|
||||
|
||||
class TestBeginEndBlock < Test::Unit::TestCase
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'test/unit'
|
||||
require 'tempfile'
|
||||
require 'require_relative'
|
||||
require_relative 'ut_eof'
|
||||
|
||||
class TestFile < Test::Unit::TestCase
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'test/unit'
|
||||
require 'stringio'
|
||||
require 'require_relative'
|
||||
require_relative 'allpairs'
|
||||
|
||||
class TestM17NComb < Test::Unit::TestCase
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require 'test/unit'
|
||||
require 'require_relative'
|
||||
require_relative 'marshaltestlib'
|
||||
|
||||
class TestMarshal < Test::Unit::TestCase
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require 'test/unit'
|
||||
require 'require_relative'
|
||||
require_relative 'ut_eof'
|
||||
|
||||
class TestPipe < Test::Unit::TestCase
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require 'test/unit'
|
||||
require 'require_relative'
|
||||
require_relative 'allpairs'
|
||||
|
||||
class TestSprintfComb < Test::Unit::TestCase
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'test/unit'
|
||||
require 'tmpdir'
|
||||
require 'require_relative'
|
||||
require_relative 'envutil'
|
||||
|
||||
class TestSystem < Test::Unit::TestCase
|
||||
|
|
|
@ -74,7 +74,6 @@ class TestRubyYield < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
require 'require_relative'
|
||||
require_relative 'sentence'
|
||||
class TestRubyYieldGen < Test::Unit::TestCase
|
||||
Syntax = {
|
||||
|
|
Loading…
Reference in a new issue