mirror of
https://github.com/rubyjs/libv8
synced 2023-03-27 23:21:48 -04:00
Dry up version and target parsing
This commit is contained in:
parent
f142f28254
commit
659ccdc8ad
1 changed files with 11 additions and 3 deletions
|
@ -17,12 +17,12 @@ module Libv8
|
|||
end
|
||||
|
||||
def version
|
||||
call('-v').output =~ version_regexp
|
||||
version_string =~ version_regexp
|
||||
$1
|
||||
end
|
||||
|
||||
def target
|
||||
call('-v').output =~ target_regexp
|
||||
version_string =~ target_regexp
|
||||
$1
|
||||
end
|
||||
|
||||
|
@ -31,11 +31,19 @@ module Libv8
|
|||
end
|
||||
|
||||
def call(*arguments)
|
||||
Compiler::execute_command arguments.unshift(@command).push('2>&1').join(' ')
|
||||
Compiler::execute_command arguments.unshift(@command).join(' ')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def version_string
|
||||
begin
|
||||
Compiler::version_string_of @command
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def version_regexp
|
||||
GENERIC_VERSION_REGEXP
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue