1
0
Fork 0
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:
ignisf 2014-06-15 15:00:32 +03:00
parent f142f28254
commit 659ccdc8ad

View file

@ -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