Navigation Menu

Skip to content

Commit

Permalink
Fix a typo...
Browse files Browse the repository at this point in the history
    absolete ->
    absolute
         ^
  • Loading branch information
kou committed Oct 7, 2015
1 parent 04349a0 commit 8c16dc2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/mrb/scripts/require.rb
Expand Up @@ -8,7 +8,7 @@ def initialize(path)
end

def load_once
if absolete_path?(@base_path)
if absolute_path?(@base_path)
loaded = load_once_path(@base_path)
if loaded.nil?
raise LoadError, error_message
Expand All @@ -17,7 +17,7 @@ def load_once
end
else
$LOAD_PATH.each do |load_path|
unless absolete_path?(load_path)
unless absolute_path?(load_path)
load_path = File.expand_path(load_path)
end
loaded = load_once_path(File.join(load_path, @base_path))
Expand All @@ -32,20 +32,20 @@ def error_message
"cannot load such file -- #{@base_path}"
end

def absolete_path?(path)
def absolute_path?(path)
path.start_with?("/")
end

def load_once_path(path)
loaded = load_once_absolete_path(path)
loaded = load_once_absolute_path(path)
return loaded unless loaded.nil?

return nil unless File.extname(path).empty?

load_once_absolete_path("#{path}.rb")
load_once_absolute_path("#{path}.rb")
end

def load_once_absolete_path(path)
def load_once_absolute_path(path)
return false if $".include?(path)
return false if @@loading_paths.key?(path)

Expand Down

0 comments on commit 8c16dc2

Please sign in to comment.