class RocketFuel::Precheck::MacportsCheck

Public Class Methods

bin_path() click to toggle source
# File lib/rocket_fuel/precheck/macports_check.rb, line 18
def bin_path
  '/opt/local/bin/port'
end

Public Instance Methods

check?() click to toggle source
# File lib/rocket_fuel/precheck/macports_check.rb, line 13
def check?
  RocketFuel::SystemDetails.platform_family?(:mac)
end
ok?() click to toggle source
# File lib/rocket_fuel/precheck/macports_check.rb, line 9
def ok?
  !blacklisted_files_not_found?
end

Protected Instance Methods

blacklisted_files() click to toggle source

TODO: this abstraction can be applied in many places (rbenv, rvm)

# File lib/rocket_fuel/precheck/macports_check.rb, line 33
def blacklisted_files
  [
    self.class.bin_path
  ]
end
blacklisted_files_not_found?() click to toggle source
# File lib/rocket_fuel/precheck/macports_check.rb, line 24
def blacklisted_files_not_found?
  blacklisted_files.each do |file|
    return true if FileTest.exist?(file)
  end

  return false
end
failure_message() click to toggle source
# File lib/rocket_fuel/precheck/macports_check.rb, line 43
def failure_message
  "MacPorts found!"
end
success_message() click to toggle source
# File lib/rocket_fuel/precheck/macports_check.rb, line 39
def success_message
  "MacPorts NOT found."
end