Class: Warbler::Traits::NoGemspec
Overview
The NoGemspec trait is used when no gemspec file is found for a
jar project. It assumes a standard layout including bin and
lib directories.
Instance Attribute Summary
#config
Class Method Summary
collapse
Instance Method Summary
collapse
#executable, #update_archive_add_executable
#apply_pathmaps
#add_init_load_path, #add_main_rb, included, #initialize, #jruby_jars, #update_gem_path
Class Method Details
.conflicts ⇒ Object
22
23
24
|
# File 'lib/warbler/traits/nogemspec.rb', line 22
def self.conflicts
[ Traits::Gemspec ]
end
|
.detect? ⇒ Boolean
18
19
20
|
# File 'lib/warbler/traits/nogemspec.rb', line 18
def self.detect?
Jar.detect? && !detect_any_conflicts?
end
|
Instance Method Details
30
31
32
33
34
|
# File 'lib/warbler/traits/nogemspec.rb', line 30
def after_configure
if File.directory?("lib")
add_init_load_path(config.pathmaps.application.inject("lib") {|pm,x| pm.pathmap(x)})
end
end
|
26
27
28
|
# File 'lib/warbler/traits/nogemspec.rb', line 26
def before_configure
config.dirs = ['.']
end
|
#default_executable ⇒ Object
40
41
42
43
44
45
46
47
48
|
# File 'lib/warbler/traits/nogemspec.rb', line 40
def default_executable
exes = Dir['bin/*'].sort
unless exe = exes.grep(/#{config.jar_name}/).first
exe = exes.first
warn "No executable matching config.jar_name found, using #{exe}" if exe
end
raise "No executable script found" unless exe
exe
end
|
#update_archive(jar) ⇒ Object
36
37
38
|
# File 'lib/warbler/traits/nogemspec.rb', line 36
def update_archive(jar)
update_archive_add_executable(jar)
end
|