30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/resources/cpan.rb', line 30
def info
return @info if defined?(@info)
@info = {}
@info[:type] = 'cpan'
@info[:name] = @package_name
lib_path = @perl_lib_path.nil? ? '' : "PERL5LIB=#{@perl_lib_path} "
cmd = inspec.command("#{lib_path+@perl_cmd} -le 'eval \"require $ARGV[0]\" and print $ARGV[0]->VERSION or exit 1' #{@package_name}")
@info[:installed] = cmd.exit_status.zero?
return @info unless cmd.exit_status.zero?
@info[:version] = cmd.stdout.strip
@info
end
|