Sha256: 8b19a496f919d9a3fa7f55e2abf3868b4f590256ec2541aa7e67bf9417992b22

Contents?: true

Size: 892 Bytes

Versions: 32

Compression:

Stored size: 892 Bytes

Contents

#! /usr/bin/env ruby

require 'getoptlong'
require 'rbconfig'
require 'ftools'
require 'find'

SRC_BASE = 'lib'
SRC = 'gratr'


INSTDIR = File.join Config::CONFIG['sitedir']
DESTDIR = File.join INSTDIR, SRC

opts = GetoptLong.new( [ "--uninstall",	"-u",		GetoptLong::NO_ARGUMENT ] )

def install
  begin
    File.makedirs( DESTDIR )
    pwd = Dir.pwd
    Dir.chdir(SRC_BASE)
	Dir['*.rb'].each do |file|
      dst = File.join( INSTDIR, file )
      File.install(file, dst, 0644, true)
    end
    Find.find(SRC) do |file|
      dst = File.join( INSTDIR, file )
      File.install(file, dst, 0644, true) if file =~ /.rb$/
    end
    Dir.chdir(pwd)
  rescue
    puts $!
  end
end

def uninstall
  begin
    puts "Deleting:"
    Find.find(DESTDIR) { |file| File.rm_f file,true }
    Dir.delete DESTDIR
  rescue
  end
end

if (opt = opts.get) and opt[0] =~ /^-?-u/
  uninstall
else
  install
end

Version data entries

32 entries across 32 versions & 5 rubygems

Version Path
auser-poolparty-1.3.0 vendor/gems/gratr/install.rb
auser-poolparty-1.3.1 vendor/gems/gratr/install.rb
auser-poolparty-1.3.10 vendor/gems/gratr/install.rb
auser-poolparty-1.3.11 vendor/gems/gratr/install.rb
auser-poolparty-1.3.12 vendor/gems/gratr/install.rb
auser-poolparty-1.3.13 vendor/gems/gratr/install.rb
auser-poolparty-1.3.14 vendor/gems/gratr/install.rb
auser-poolparty-1.3.15 vendor/gems/gratr/install.rb
auser-poolparty-1.3.16 vendor/gems/gratr/install.rb
auser-poolparty-1.3.17 vendor/gems/gratr/install.rb
auser-poolparty-1.3.2 vendor/gems/gratr/install.rb
auser-poolparty-1.3.3 vendor/gems/gratr/install.rb
auser-poolparty-1.3.4 vendor/gems/gratr/install.rb
auser-poolparty-1.3.5 vendor/gems/gratr/install.rb
auser-poolparty-1.3.6 vendor/gems/gratr/install.rb
auser-poolparty-1.3.7 vendor/gems/gratr/install.rb
auser-poolparty-1.3.8 vendor/gems/gratr/install.rb
fairchild-poolparty-1.3.17 vendor/gems/gratr/install.rb
fairchild-poolparty-1.3.5 vendor/gems/gratr/install.rb
gratr19-0.4.4.1 install.rb