Class: Libv8::Compiler::GenericCompiler
- Inherits:
-
Object
- Object
- Libv8::Compiler::GenericCompiler
- Defined in:
- ext/libv8/compiler/generic_compiler.rb
Constant Summary collapse
- VERSION_REGEXP =
/(\d+\.\d+(\.\d+)*)/
- TARGET_REGEXP =
/Target: ([a-z0-9\-_.]*)/
Instance Method Summary collapse
- #call(*arguments) ⇒ Object
- #compatible? ⇒ Boolean
-
#initialize(path) ⇒ GenericCompiler
constructor
A new instance of GenericCompiler.
- #name ⇒ Object
- #target ⇒ Object
- #to_s ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(path) ⇒ GenericCompiler
Returns a new instance of GenericCompiler.
7 8 9 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 7 def initialize(path) @path = path end |
Instance Method Details
#call(*arguments) ⇒ Object
33 34 35 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 33 def call(*arguments) Open3.capture3 arguments.unshift(@path).join(' ') end |
#compatible? ⇒ Boolean
29 30 31 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 29 def compatible? false end |
#name ⇒ Object
11 12 13 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 11 def name File.basename @path end |
#target ⇒ Object
24 25 26 27 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 24 def target call('-v')[0..1].join =~ TARGET_REGEXP $1 end |
#to_s ⇒ Object
15 16 17 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 15 def to_s @path end |
#version ⇒ Object
19 20 21 22 |
# File 'ext/libv8/compiler/generic_compiler.rb', line 19 def version call('-v')[0..1].join =~ VERSION_REGEXP $1 end |