Parent

Class/Module Index [+]

Quicksearch

PhusionPassenger::PlatformInfo::Depcheck::ConsoleRunner

Attributes

missing_dependencies[R]

Public Class Methods

new() click to toggle source
# File lib/phusion_passenger/platform_info/depcheck.rb, line 298
def initialize
  @stdout = STDOUT
  @dep_identifiers = []
end

Public Instance Methods

add(identifier) click to toggle source
# File lib/phusion_passenger/platform_info/depcheck.rb, line 303
def add(identifier)
  @dep_identifiers << identifier
end
check_all() click to toggle source
# File lib/phusion_passenger/platform_info/depcheck.rb, line 307
def check_all
  old_log_impl = PlatformInfo.log_implementation
  begin
    PlatformInfo.log_implementation = lambda do |message|
      message = PlatformInfo.send(:reindent, message, 10)
      message.sub!(/^          /, '')
      STDOUT.puts "       -> #{message}"
    end
    @missing_dependencies = []
    @dep_identifiers.each do |identifier|
      dep = Depcheck.find(identifier)
      raise "Cannot find depcheck spec #{identifier.inspect}" if !dep
      puts_header "Checking for #{dep.name}..."
      result = dep.check
      result = { :found => false } if !result

      if result[:found] && !result[:error]
        puts_detail "Found: <green>yes</green>"
      else
        if result[:error]
          puts_detail "Found: #{result[:found] ? "<yellow>yes, but there was an error</yellow>" : "<red>no</red>"}"
          puts_detail "Error: <red>#{result[:error]}</red>"
        else
          puts_detail "Found: #{result[:found] ? "<green>yes</green>" : "<red>no</red>"}"
        end
        @missing_dependencies << dep
      end

      result.each_pair do |key, value|
        if key.is_a?(String)
          puts_detail "#{key}: #{value}"
        end
      end
    end

    return @missing_dependencies.empty?
  ensure
    PlatformInfo.log_implementation = old_log_impl
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.