Remove rubinius specific loader
This commit is contained in:
parent
5428f9addc
commit
cca235d6e2
1 changed files with 2 additions and 74 deletions
|
@ -31,7 +31,8 @@ module Mutant
|
|||
|
||||
# Eval based loader
|
||||
class Eval < self
|
||||
private
|
||||
|
||||
private
|
||||
|
||||
# Run loader
|
||||
#
|
||||
|
@ -54,78 +55,5 @@ module Mutant
|
|||
end
|
||||
end
|
||||
|
||||
# Rubinius script node based loaded
|
||||
class Rubinius < self
|
||||
private
|
||||
|
||||
# Run loader
|
||||
#
|
||||
# @return [undefined]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def run(root)
|
||||
Rubinius.run_script(compiled_code)
|
||||
end
|
||||
|
||||
# Return compiled code
|
||||
#
|
||||
# @return [Rubinius::CompiledCode]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
# FIXME: rbx on travis is older than on my devbox.
|
||||
#
|
||||
def compiled_code
|
||||
_script = script
|
||||
_script.respond_to?(:compiled_code) ? _script.compiled_code : _script.compiled_method
|
||||
end
|
||||
|
||||
# Return code script
|
||||
#
|
||||
# @return [Rubinius::CompiledCode::Script]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def script
|
||||
compiled_code_raw.create_script
|
||||
end
|
||||
|
||||
# Return compiled code for node
|
||||
#
|
||||
# @return [Rubinius::CompiledCode]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def compiled_code_raw
|
||||
compiler.run
|
||||
end
|
||||
|
||||
# Return compiler loaded with mutated ast
|
||||
#
|
||||
# @return [Rubinius::Compiler]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def compiler
|
||||
Rubinius::Compiler.new(:bytecode, :compiled_method).tap do |compiler|
|
||||
compiler.generator.input(@root)
|
||||
end
|
||||
end
|
||||
|
||||
# Return script node
|
||||
#
|
||||
# @param [Rubinius::AST::Node] node
|
||||
#
|
||||
# @return [Rubinius::AST::Script]
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
def script(node)
|
||||
Rubinius::AST::Script.new(node).tap do |script|
|
||||
script.file = source_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue