Sha256: 55a2ff6495683f98c80eecbcb28776a0263eb3dbc88c46fae2f764f54ca3acb2

Contents?: true

Size: 1.81 KB

Versions: 1

Compression:

Stored size: 1.81 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'commander/import'
require 'lock_jar'

# :name is optional, otherwise uses the basename of this executable
program :name, 'Lock Jar'
program :version, IO.read( File.expand_path(File.join(File.dirname(__FILE__),'../VERSION')) )
program :description, 'LockJar manages Java Jars for Ruby'

command :install do |c|
  c.syntax = 'lockjar install'
  c.description = 'Install Jars from a Jarfile.lock'
  c.option '--lockfile STRING', String, 'Path to Jarfile.lock, defaults to Jarfile.lock'
  c.option '--scopes ARRAY', Array, "Scopes to install from Jarfile.lock, defaults to 'compile, runtime'"
  c.action do |args, options|
    options.default :lockfile => 'Jarfile.lock', :scopes => ['compile', 'runtime']
    puts "Installing Jars from #{options.lockfile} for #{options.scopes.inspect}"
    LockJar.install( options.lockfile, options.scopes )
  end
end

command :list do |c|
  c.syntax = 'lockjar list'
  c.description = 'List Jars from a Jarfile.lock'
  c.option '--lockfile STRING', String, 'Path to Jarfile.lock, defaults to Jarfile.lock'
  c.option '--scopes ARRAY', Array, "Scopes to install from Jarfile.lock, defaults to 'compile, runtime'"
  c.action do |args, options|
    options.default :lockfile => 'Jarfile.lock', :scopes => ['compile', 'runtime']
    puts "Listing Jars from #{options.lockfile} for #{options.scopes.inspect}"
    puts LockJar.list( options.lockfile, options.scopes ).inspect
  end
end

command :lock do |c|
  c.syntax = 'lockjar lock'
  c.description = 'Lock Jars in a Jarfile'
  c.option '--jarfile STRING', String, 'Path to Jarfile, defaults to Jarfile'
  c.action do |args, options|
    options.default :lockfile => 'Jarfile.lock', :scopes => ['compile', 'runtime']
    puts "Locking #{options.lockfile}"
    LockJar.install( options.lockfile, options.scopes )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lock_jar-0.4.1 bin/lockjar