Skip to content

Commit

Permalink
Tweak describe.rb so that it works on rbx despite incorrect __FILE__
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilson Bilkovich committed Oct 21, 2008
1 parent d6b2ac1 commit f5d9d6a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/bin/describe.rb
@@ -1,10 +1,10 @@
require 'pp'

unless defined?(RUBY_ENGINE) and RUBY_ENGINE == 'rbx'
$: << 'lib'
require File.join(File.dirname(__FILE__), '..', 'compiler', 'mri_shim')
end

require 'pp'

# "Interactive" mode
def interactive()
require 'readline'
Expand Down Expand Up @@ -53,8 +53,7 @@ def describe_compiled_method(cm)
end
end


if __FILE__ == $0 then
if __FILE__[$0] then
flags = []
file = nil

Expand Down Expand Up @@ -84,7 +83,7 @@ def describe_compiled_method(cm)
pp File.to_sexp(file)

puts "\nCompiled output:"
top = Compiler.compile_file(file, flags)
top = Compile.compile_file(file, flags)
describe_compiled_method(top)
rescue SyntaxError
exit 1
Expand Down

0 comments on commit f5d9d6a

Please sign in to comment.