Class: Libv8::Compiler::GenericCompiler

Inherits:
Object
  • Object
show all
Defined in:
ext/libv8/compiler/generic_compiler.rb

Direct Known Subclasses

Clang, GCC

Constant Summary collapse

GENERIC_VERSION_REGEXP =
/(\d+\.\d+(\.\d+)*)/
GENERIC_TARGET_REGEXP =
/Target: ([a-z0-9\-_.]*)/

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ GenericCompiler

Returns a new instance of GenericCompiler.



7
8
9
# File 'ext/libv8/compiler/generic_compiler.rb', line 7

def initialize(command)
  @command = command
end

Instance Method Details

#call(*arguments) ⇒ Object



33
34
35
# File 'ext/libv8/compiler/generic_compiler.rb', line 33

def call(*arguments)
  Compiler::execute_command arguments.unshift(@command).join(' ')
end

#compatible?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'ext/libv8/compiler/generic_compiler.rb', line 29

def compatible?
  false
end

#nameObject



11
12
13
# File 'ext/libv8/compiler/generic_compiler.rb', line 11

def name
  File.basename @command
end

#targetObject



24
25
26
27
# File 'ext/libv8/compiler/generic_compiler.rb', line 24

def target
  version_string =~ target_regexp
  $1
end

#to_sObject



15
16
17
# File 'ext/libv8/compiler/generic_compiler.rb', line 15

def to_s
  @command
end

#versionObject



19
20
21
22
# File 'ext/libv8/compiler/generic_compiler.rb', line 19

def version
  version_string =~ version_regexp
  $1
end