Skip to content

Commit

Permalink
Add a composer (PHP) installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
weakish committed May 3, 2016
1 parent 303b371 commit e780ef0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions lib/sprinkle/installers/composer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module Sprinkle
module Installers
# The composer package installer installs PHP packages.
#
#
# == Example Usage
#
# A simple installation:
#
# package :magic_beans do
# description "Beans beans they're good for your heart..."
# composer 'magic_beans'
# end
class Composer < Installer

api do
def composer(name, options = {}, &block)
install Composer.new(self, name, options, &block)
end
end

attr_accessor :composer #:nodoc:

def initialize(parent, composer, options = {}, &block) #:nodoc:
super parent, options, &block
@composer = composer
end


protected


def install_commands #:nodoc:
cmd = "#{sudo_cmd}composer global require '#{composer}'"
end

end
end
end

0 comments on commit e780ef0

Please sign in to comment.