Sha256: e50355eebef11e1f73632cfc2536ab67dbc331b19a9ea4b5c1e16d168b5c665c

Contents?: true

Size: 891 Bytes

Versions: 10

Compression:

Stored size: 891 Bytes

Contents

require 'rocket_fuel/precheck/check'

module RocketFuel
  module Precheck
    class MacportsCheck < Check
      check_name :macports
      register!

      def ok?
        !blacklisted_files_not_found?
      end

      def check?
        RocketFuel::SystemDetails.platform_family?(:mac)
      end

      class << self
        def bin_path
          '/opt/local/bin/port'
        end
      end

      protected
      def blacklisted_files_not_found?
        blacklisted_files.each do |file|
          return true if FileTest.exist?(file)
        end

        return false
      end

      #TODO: this abstraction can be applied in many places (rbenv, rvm)
      def blacklisted_files
        [
          self.class.bin_path
        ]
      end

      def success_message
        "MacPorts NOT found."
      end

      def failure_message
        "MacPorts found!"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rocket_fuel-0.2.0 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.1.0 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.8 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.7 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.6 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.5 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.4 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.3 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.2 lib/rocket_fuel/precheck/macports_check.rb
rocket_fuel-0.0.1 lib/rocket_fuel/precheck/macports_check.rb