Skip to content

Commit

Permalink
* prelude.rb (require_relative): move require_relative from
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
matz committed Apr 12, 2008
1 parent 7b4a171 commit 6b36f11
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 20 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ Sat Apr 12 12:41:49 2008 Nobuyoshi Nakada <[email protected]>
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 <[email protected]>

* 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 <[email protected]>

* lib/rubygems*, test/rubygems*: Update to RubyGems 1.1.1 r1701.
Expand Down
11 changes: 0 additions & 11 deletions lib/require_relative.rb

This file was deleted.

10 changes: 10 additions & 0 deletions prelude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ def self.exclusive
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
1 change: 0 additions & 1 deletion test/ruby/test_assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ def test_const_massign
end
end

require 'require_relative'
require_relative 'sentence'
class TestAssignmentGen < Test::Unit::TestCase
Syntax = {
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_beginendblock.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'test/unit'
require 'tempfile'
require 'require_relative'
require_relative 'envutil'

class TestBeginEndBlock < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_file.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'test/unit'
require 'tempfile'
require 'require_relative'
require_relative 'ut_eof'

class TestFile < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_m17n_comb.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'test/unit'
require 'stringio'
require 'require_relative'
require_relative 'allpairs'

class TestM17NComb < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_marshal.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require 'require_relative'
require_relative 'marshaltestlib'

class TestMarshal < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_pipe.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require 'require_relative'
require_relative 'ut_eof'

class TestPipe < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_sprintf_comb.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test/unit'
require 'require_relative'
require_relative 'allpairs'

class TestSprintfComb < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_system.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'test/unit'
require 'tmpdir'
require 'require_relative'
require_relative 'envutil'

class TestSystem < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_yield.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def obj.each
end
end

require 'require_relative'
require_relative 'sentence'
class TestRubyYieldGen < Test::Unit::TestCase
Syntax = {
Expand Down

0 comments on commit 6b36f11

Please sign in to comment.