Module: AntwrapClassLoader

Defined in:
lib/antwrap_utilities.rb

Class Method Summary collapse

Class Method Details

.load_ant_libs(ant_home) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/antwrap_utilities.rb', line 20

def load_ant_libs(ant_home)
  jars = match(ant_home + '/lib') {|p| ext = p[-4...p.size]; ext && ext.downcase == '.jar'} 
  if(RUBY_PLATFORM == 'java')
    jars.each {|jar| require jar }
  else
    Rjb::load(jars.join(":"), [])
  end
end

.match(*paths) ⇒ Object



14
15
16
17
18
# File 'lib/antwrap_utilities.rb', line 14

def match(*paths)
  matched=[]
  Find.find(*paths){ |path| matched << path if yield path }
  return matched
end