Sha256: a409f24c8280a772b50d1b535771c85856552046286e99fd53a987e4448da115

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Rip
  module Commands
    x 'Checks that your rip installation is valid.'
    def check(*args)
      Setup.check_installation
      ui.puts "All systems go."
    rescue => e
      ui.abort "Installation failed: #{e.message}"
    end

    o 'rip install SOURCE [options]'
    x 'Installs a package from SOURCE.'
    x '-f forces installation (overwrites existing)'
    def install(options = {}, source = nil, version = nil, *args)
      if source.to_s.empty?
        ui.abort "Please tell me what to install."
      end

      package = Rip::Package.for(source, version)

      if !package
        ui.abort "I don't know how to install #{source}"
      end

      if options[:f]
        Installer.new.uninstall(package) if package.installed?
        Installer.new.install(package)
      elsif package.installed?
        ui.puts "#{package} already installed"
      else
        installer = Installer.new
        installer.install(package)
#         puts "#{installer.installed.size.to_i} packages installed"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rip-0.0.1 lib/rip/commands/install.rb