Sha256: e998a73e6213f716a62cfb44d9d90d37c11d3aaf0c8a4db0d2703f9650311bb3

Contents?: true

Size: 777 Bytes

Versions: 10

Compression:

Stored size: 777 Bytes

Contents

require 'rocket_fuel/precheck/check'

module RocketFuel
  module Precheck
    class RbenvCheck < Check
      check_name :rbenv
      register!

      def ok?
        !home_path_exists? && !global_path_exists?
      end

      class << self
        def home_path
          File.join(ENV['HOME'], '.rbenv')
        end

        #homebrew recommended, alternative path
        def global_path
          '/usr/local/var/rbenv'
        end
      end

      protected
      def success_message
        "rbenv NOT found."
      end

      def failure_message
        "rbenv found!"
      end

      def home_path_exists?
        FileTest.exist?(self.class.home_path)
      end

      def global_path_exists?
        FileTest.exist?(self.class.global_path)
      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/rbenv_check.rb
rocket_fuel-0.1.0 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.8 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.7 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.6 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.5 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.4 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.3 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.2 lib/rocket_fuel/precheck/rbenv_check.rb
rocket_fuel-0.0.1 lib/rocket_fuel/precheck/rbenv_check.rb