Skip to content

Commit

Permalink
Binary Installer / Simple archive extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
okiess committed Oct 15, 2009
1 parent 57e2535 commit b693236
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/sprinkle/installers/binary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Sprinkle
module Installers
# = Binary Installer
#
#
class Binary < Installer
def initialize(parent, source, options = {}, &block) #:nodoc:
@source = source
super parent, options, &block
end

def download_commands #:nodoc:
[ "wget -cq --directory-prefix='#{@options[:archives]}' #{@source}" ]
end

def install_commands #:nodoc:
commands = [ "bash -c 'wget -cq --directory-prefix=\'#{@options[:archives]}\' #{@source} "]
# TODO check archive type
commands << "cd #{@options[:prefix]} && tar xfvz #{@options[:archives]}/#{@source.split("/").last}'"
end
end
end
end
4 changes: 4 additions & 0 deletions lib/sprinkle/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ def source(source, options = {}, &block)
@installer = Sprinkle::Installers::Source.new(self, source, options, &block)
end

def binary(source, options = {}, &block)
@installer = Sprinkle::Installers::Binary.new(self, source, options, &block)
end

def rake(name, options = {}, &block)
@installer = Sprinkle::Installers::Rake.new(self, name, options, &block)
end
Expand Down

0 comments on commit b693236

Please sign in to comment.