Class: Jars::Classpath
- Inherits:
-
Object
- Object
- Jars::Classpath
- Defined in:
- lib/jars/classpath.rb
Constant Summary collapse
- DEPENDENCY_LIST =
'dependencies.list'
Instance Method Summary collapse
- #classpath(scope = nil) ⇒ Object
- #classpath_string(scope = nil) ⇒ Object
-
#initialize(spec = nil) ⇒ Classpath
constructor
A new instance of Classpath.
- #jars_lock ⇒ Object
- #require(scope = nil) ⇒ Object
- #workdir(dirname) ⇒ Object
Constructor Details
Instance Method Details
#classpath(scope = nil) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/jars/classpath.rb', line 55 def classpath( scope = nil ) classpath = [] process( scope ) do |jar| classpath << jar.file end classpath end |
#classpath_string(scope = nil) ⇒ Object
71 72 73 |
# File 'lib/jars/classpath.rb', line 71 def classpath_string( scope = nil ) classpath( scope ).join( File::PATH_SEPARATOR ) end |
#jars_lock ⇒ Object
18 19 20 21 22 23 |
# File 'lib/jars/classpath.rb', line 18 def jars_lock deps = Jars.lock return deps if File.exists?( deps ) deps = File.join( @mvn.basedir || '.', Jars.lock ) deps if File.exists?( deps ) end |
#require(scope = nil) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/jars/classpath.rb', line 45 def require( scope = nil ) process( scope ) do |jar| if jar.scope == :system Kernel.require jar.path else require_jar( *jar.gacv ) end end end |
#workdir(dirname) ⇒ Object
13 14 15 16 |
# File 'lib/jars/classpath.rb', line 13 def workdir( dirname ) dir = File.join( @mvn.basedir, dirname ) dir if File.directory?( dir ) end |