Class | JavaClass::Classpath::ConventionClasspath |
In: |
lib/javaclass/classpath/convention_classpath.rb
|
Parent: | FolderClasspath |
A Java project by naming convention, contains a classes and a lib folder.
Author: | Peter Kofler |
CLASSES | = | 'classes' |
Create a classpath for folder / classes.
# File lib/javaclass/classpath/convention_classpath.rb, line 20 def initialize(folder) super(File.join(folder, CLASSES)) @root = folder end
Check if the file is a valid location.
# File lib/javaclass/classpath/convention_classpath.rb, line 14 def self.valid_location?(file) FolderClasspath.valid_location?(file) && FolderClasspath.valid_location?(File.join(file, CLASSES)) end
Return list of additional classpath elements defined in the lib folder.
# File lib/javaclass/classpath/convention_classpath.rb, line 26 def additional_classpath lib = File.join(@root, 'lib') if FolderClasspath.valid_location?(lib) Dir.entries(lib).map { |e| File.join(lib, e) }.find_all { |e| JarClasspath.valid_location?(e) } else [] end end