File.expand_path is way more useful than File.absolute_path
This commit is contained in:
parent
7a157faee0
commit
dfac755ce5
2 changed files with 3 additions and 3 deletions
2
bin/rpl
2
bin/rpl
|
@ -73,7 +73,7 @@ interpreter = Rpl.new
|
|||
|
||||
# first run provided files if any
|
||||
options[:files].each do |filename|
|
||||
interpreter.run "\"#{filename}\" feval"
|
||||
interpreter.run "\"#{File.expand_path( filename )}\" feval"
|
||||
end
|
||||
|
||||
# second run provided code if any
|
||||
|
|
|
@ -16,7 +16,7 @@ module RplLang
|
|||
proc do
|
||||
args = stack_extract( [[RplString]] )
|
||||
|
||||
path = File.absolute_path( args[0].value )
|
||||
path = File.expand_path( args[0].value )
|
||||
|
||||
@stack << Types.new_object( RplString, "\"#{File.read( path )}\"" )
|
||||
end )
|
||||
|
@ -32,7 +32,7 @@ module RplLang
|
|||
proc do
|
||||
args = stack_extract( [[RplString], :any] )
|
||||
|
||||
File.write( File.absolute_path( args[0].value ),
|
||||
File.write( File.expand_path( args[0].value ),
|
||||
args[1].value )
|
||||
end )
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue