Sha256: 204dd04227c6247c988fd3ea9ddf09e463a4275e243382a40a558d3983ca05eb

Contents?: true

Size: 1.62 KB

Versions: 3

Compression:

Stored size: 1.62 KB

Contents

#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.dirname(__FILE__), '..', 'lib')
require 'gem_stalker'

def usage
  puts ""
  puts "Usage:" 
  puts ""
  puts "  #{File.basename $0} <username> <repository> [version] [--install]"
  puts ""
  puts "Begins stalking a gem at the specified location. Example:" 
  puts ""
  puts "  #{File.basename $0} techinicalpickles jeweler"
end

if ARGV.length == 0 || ARGV.include?("-h") || ARGV.include?("--help")
  usage
  exit
end

trap "SIGINT" do
  puts ""
  puts "Stopping"
  exit
end

options = {:username => ARGV[0], :repository => ARGV[1]}
options[:version] = ARGV[2] if ARGV.length >= 3 && ARGV[2] != '--install'
options[:install] = true if ARGV.include?('--install')
stalker = GemStalker.new(options)

$stdout.sync = true

unless stalker.gem?
  puts "The repository is not configured as a rubygem yet." 
  puts "Go to the following url, and check 'RubyGem'"
  puts "\t#{stalker.edit_repo_url}"
  exit
end

if ARGV.length < 3
  puts "Using version #{stalker.version}"
end

waiting = false

puts "Checking to see if the gem has been built:"
loop do
  if stalker.built?
    puts "." if waiting
    puts "=> Zomg, it's built, I'm so telling everyone!" 
    puts "=> http://gems.github.com/#{stalker.gem_path}" 
    break    
  end
  print "."
  waiting = true
  sleep(5)
end

# Now that it is built lets install
if options[:install]
  puts "=> Installing built gem"
  stalker.install
end

waiting = false

puts "Checking to see if it is in the specfile:"
loop do
  if stalker.in_specfile?
    puts "." if waiting
    puts "=> Sweeeet, everyone can install it now!"
    break
  end
  print "."
  waiting = true
  sleep(60*5)
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
jeffrafter-gemstalker-0.3.4 bin/gemstalk
technicalpickles-gemstalker-0.3.4 bin/gemstalk
technicalpickles-gemstalker-0.4.0 bin/gemstalk