Sha256: b96e4ba966145a715cbf00838165cfffd99d3a4f9f4f745b3065eaa49529a431

Contents?: true

Size: 866 Bytes

Versions: 6

Compression:

Stored size: 866 Bytes

Contents

module Sprinkle
  module Installers
    # = Pear package installed
    #
    # Installs the specified pear package
    #
    # == Example Usage
    #
    #   package :php_stuff do
    #     pear 'PHP_Compat'
    #     verify { has_pear 'PHP_Compat' }
    #   end
    class Pear < Installer
      attr_accessor :package_name

      api do
        def pear(package, &block)
          install Pear.new(self, package, &block)
        end
      end

      verify_api do
        def has_pear(package)
          @commands << "pear list | grep \"#{package}\" | grep \"stable\""
        end
      end

      def initialize(parent, package_name, &block) #:nodoc:
        super parent, &block
        @package_name = package_name
      end

      protected
        def install_commands #:nodoc:
          "pear install --alldeps #{@package_name}"
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sprinkle-0.7.7 lib/sprinkle/installers/pear.rb
sprinkle-0.7.6.2 lib/sprinkle/installers/pear.rb
sprinkle-0.7.6.1 lib/sprinkle/installers/pear.rb
sprinkle-0.7.6 lib/sprinkle/installers/pear.rb
sprinkle-0.7.5 lib/sprinkle/installers/pear.rb
sprinkle-0.7.4 lib/sprinkle/installers/pear.rb