class RubyNext::Language::Rewriters::Dir
Special rewriter for Ruby <=2.3, which doesn't support __dir__ in iseq.eval
Constants
- MIN_SUPPORTED_VERSION
- SYNTAX_PROBE
Public Instance Methods
on_send(node)
click to toggle source
Calls superclass method
# File lib/ruby-next/language/rewriters/runtime/dir.rb, line 11 def on_send(node) return super(node) unless node.children[1] == :__dir__ context.track! self replace(node.loc.expression, "File.dirname(__FILE__)") process( node.updated( nil, [ s(:const, nil, :File), :dirname, s(:send, nil, "__FILE__") ] ) ) end