def invoke
return false unless can_exec_command?
- [:version, :cflags, :libs].each do |f|
- @result[f] = lookup_flags(f)
+ begin
+ [:version, :cflags, :libs].each do |f|
+ @result[f] = lookup_flags(f)
+ end
+ rescue Exception
+ @result.clear
end
- true
+ !@result.empty?
end
protected
def lookup_flags(f)
tmp = `#{@command} --#{f}`.strip
- $?.exitstatus.zero? ? tmp : nil
+
+ raise unless $?.exitstatus.zero?
+ tmp
end
private
tmp = `#{@command} --silence-errors --#{f} #{@name}`.
strip.tr("\n", "/")
- $?.exitstatus.zero? ? tmp : nil
+
+ raise unless $?.exitstatus.zero?
+ tmp
end
end