Sha256: 8ca6ec1dcd33333fdcc85415cb0dc59fde99922c4675860ecd6a16fe2bfa1dad

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

#! /usr/bin/env ruby
# encoding: UTF-8

$:.push File.expand_path("../../lib", __FILE__)
require "latest"

if ARGV.empty?
  puts Latest.usage
elsif ARGV.first =~ /^-(v|-version)$/
  puts "Latest v" + Latest::VERSION
else
  ARGV.each_with_index do |name, index|
    print name + " "    
    begin
      gem = Latest::Gem.new(name)    
      if ARGV[index + 1] == "--pre"
        ARGV.slice!(index + 1, 1)
        gem.pre = true
        print "--pre "
      end
      puts "#{gem.version} (#{gem.downloads} download#{'s' unless gem.downloads == 1})"
    rescue => e
      print "[Error] "
      puts e.message
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
latest-0.4.0 bin/latest