Class: Warbler::Traits::JBundler
Overview
The JBundler trait uses JBundler to determine jar dependencies to be added to the project.
Instance Attribute Summary
#config
Class Method Summary
collapse
Instance Method Summary
collapse
#apply_pathmaps
#add_init_load_path, #add_main_rb, included, #initialize, #update_archive, #update_gem_path
Class Method Details
.detect? ⇒ Boolean
16
17
18
|
# File 'lib/warbler/traits/jbundler.rb', line 16
def self.detect?
File.exist?(ENV['JBUNDLE_JARFILE'] || "Jarfile")
end
|
.requires?(trait) ⇒ Boolean
20
21
22
|
# File 'lib/warbler/traits/jbundler.rb', line 20
def self.requires?(trait)
trait == Traits::War || trait == Traits::Jar
end
|
Instance Method Details
#add_jbundler_jars ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/warbler/traits/jbundler.rb', line 32
def add_jbundler_jars
require 'jbundler/config'
classpath = ::JBundler::Config.new.classpath_file
if File.exists?( classpath )
require File.expand_path( classpath )
else
raise 'jbundler support needs jruby to create a local config: jruby -S jbundle install'
end
config.java_libs.clear
JBUNDLER_CLASSPATH.each do |jar|
config.java_libs << jar
end
config.init_contents << "#{config.warbler_templates}/jbundler.erb"
end
|
28
29
30
|
# File 'lib/warbler/traits/jbundler.rb', line 28
def after_configure
add_jbundler_jars if config.jbundler
end
|
24
25
26
|
# File 'lib/warbler/traits/jbundler.rb', line 24
def before_configure
config.jbundler = true
end
|