forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.rb
More file actions
29 lines (25 loc) · 720 Bytes
/
Copy pathkernel.rb
File metadata and controls
29 lines (25 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module Kernel
module_function
def require_relative(relative_feature)
if relative_feature.respond_to? :to_path
relative_feature = relative_feature.to_path
else
relative_feature = relative_feature
end
relative_feature = JRuby::Type.convert_to_str(relative_feature)
c = caller.first
e = c.rindex(/:\d+:in /)
file = $`
if /\A\((.*)\)/ =~ file # eval, etc.
raise LoadError, "cannot infer basepath"
end
absolute_feature = File.join(File.dirname(File.realpath(file)), relative_feature)
require absolute_feature
end
def exec(*args)
_exec_internal(*JRuby::ProcessUtil.exec_args(args))
end
def spawn(*args)
Process.spawn(*args)
end
end