Class: JBundler::Cli

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

Instance Method Summary collapse

Instance Method Details

#installObject



11
12
13
14
# File 'lib/jbundler/cli.rb', line 11

def install
  require 'jbundler'
  puts 'Your jbundle is complete! Use `jbundle show` to see where the bundled jars are installed.'
end

#showObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/jbundler/cli.rb', line 30

def show
  if ARGV.size == 1
    require 'java' 
    require 'jbundler/aether'
    require 'jbundler/classpath_file'
    config = JBundler::AetherConfig.new
    classpath_file = JBundler::ClasspathFile.new('.jbundler/classpath.rb')#config.classpath_file)
    if classpath_file.exists?
      classpath_file.require_classpath
      puts "JBundler classpath:"
      JBUNDLER_CLASSPATH.each do |path|
        puts "  * #{path}"
      end
    else
      puts "JBundler classpath is not installed."
    end
  end
end

#updateObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/jbundler/cli.rb', line 17

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