Class: JBundler::Cli

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

Instance Method Summary collapse

Instance Method Details

#consoleObject



81
82
83
# File 'lib/jbundler/cli.rb', line 81

def console
  # dummy - never executed !!!
end

#executableObject



75
76
77
78
# File 'lib/jbundler/cli.rb', line 75

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

#installObject



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/jbundler/cli.rb', line 99

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

#lock_downObject



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

def lock_down
  JBundler::LockDown.new( config ).lock_down( options[ :vendor ],
                                              options[ :debug ] )
end

#showObject



132
133
134
135
136
# File 'lib/jbundler/cli.rb', line 132

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

#treeObject

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



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

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

#updateObject



118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/jbundler/cli.rb', line 118

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