Sha256: 07efd3944804eaa24a127d63d0e1a961eea517bb66404488947506bf924180d3

Contents?: true

Size: 607 Bytes

Versions: 3

Compression:

Stored size: 607 Bytes

Contents

require 'minarai/actions/base'

module Minarai
  module Actions
    class HomebrewCask < Base
      attribute :item, required: true

      def run
        install
      end

      private

      def install
        run_command "brew cask install #{item}"
      end

      def complete?
        has_homebrew? && installed?
      end

      def installed?
        check_command "/usr/local/bin/brew cask list -1 | grep -E '^#{item}$'"
      end

      def has_homebrew?
        check_command 'which brew-cask'
      end

      def name
        super || "brew cask install #{item}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minarai-0.0.3 lib/minarai/actions/homebrew_cask.rb
minarai-0.0.2 lib/minarai/actions/homebrew_cask.rb
minarai-0.0.1 lib/minarai/actions/homebrew_cask.rb