Class: JBundler::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/jbundler/cli.rb

Instance Method Summary collapse

Instance Method Details

#consoleObject



72
73
74
# File 'lib/jbundler/cli.rb', line 72

def console
  # dummy - never executed !!!
end

#executableObject



66
67
68
69
# File 'lib/jbundler/cli.rb', line 66

def executable
  ex = JBundler::Executable.new( options[ 'bootstrap' ], config, options[ 'compile' ], options[ :verbose ], *( options[ 'groups' ] || [:default] ) )
  ex.packit
end

#installObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/jbundler/cli.rb', line 79

def install
  require 'jbundler'
  if options[ :no_deployment ]
    vendor = JBundler::Vendor.new( config.vendor_dir )
    vendor.clear
  end
  if options[ :deployment ]
    vendor = JBundler::Vendor.new( config.vendor_dir )
    if vendor.vendored?
      raise "already vendored. please 'jbundle install --no-deployment before."
    else
      vendor.setup( JBundler::ClasspathFile.new( config.classpath_file ) )
    end
  end
  do_show
  puts 'Your jbundle is complete! Use `jbundle show` to see where the bundled jars are installed.'
end

#showObject



112
113
114
115
116
# File 'lib/jbundler/cli.rb', line 112

def show
  if ARGV.size == 1
    do_show
 end
end

#treeObject

method_option :details, :type => :boolean, :default => false



57
58
59
# File 'lib/jbundler/cli.rb', line 57

def tree
  JBundler::Tree.new( config ).show_it
end

#updateObject



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/jbundler/cli.rb', line 98

def update
  if ARGV.size == 1
    require 'java'
    config = JBundler::Config.new
    FileUtils.rm_f(config.jarfile_lock)
    
    require 'jbundler'
    do_show
    puts ''
    puts 'Your jbundle is updated! Use `jbundle show` to see where the bundled jars are installed.'
  end
end