Sha256: ca697f401f977f64163c100ac3717a17b329834d78e2b8366664a4652b96c27a
Contents?: true
Size: 1.7 KB
Versions: 7
Compression:
Stored size: 1.7 KB
Contents
require 'rubygems' require 'thor' require 'lock_jar' module LockJar class CLI < Thor module ClassMethods def generate_lockfile_option method_option :lockfile, :aliases => "-l", :default => 'Jarfile.lock', :desc => "Path to Jarfile.lock" end def generate_scopes_option method_option :scopes, :aliases => "-s", :default => ['compile', 'runtime'], :desc => "Scopes to install from Jarfile.lock", :type => :array end def generate_jarfile_option method_option :jarfile, :aliases => "-j", :default => 'Jarfile', :desc => "Path to Jarfile" end end extend(ClassMethods) desc "version", "LockJar version" def version puts LockJar::VERSION end desc "install", "Install Jars from a Jarfile.lock" generate_lockfile_option generate_scopes_option def install puts "Installing Jars from #{options[:lockfile]} for #{options[:scopes].inspect}" LockJar.install( options[:lockfile], options[:scopes] ) end desc "list", "List Jars from a Jarfile.lock" generate_lockfile_option generate_scopes_option def list puts "Listing Jars from #{options[:lockfile]} for #{options[:scopes].inspect}" puts LockJar.list( options[:lockfile], options[:scopes] ).inspect end desc 'lock', 'Lock Jars in a Jarfile.lock' generate_jarfile_option generate_lockfile_option def lock puts "Locking #{options[:jarfile]} to #{options[:lockfile]}" LockJar.lock( options[:jarfile], { :lockfile => options[:lockfile] } ) end end end
Version data entries
7 entries across 7 versions & 1 rubygems