Posted By

banzaiman on 09/16/08


Tagged

rails ruby jar jruby


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Load all *.jar files in RAILS_ROOT/lib


 / Published in: Ruby
 

  1. # for JRuby, load JDBC adapter and all the .jar files in lib.
  2. if (RUBY_PLATFORM =~ /java/)
  3. require 'jdbc_adapter'
  4. Dir.foreach(File.join(RAILS_ROOT, 'lib')) do |file|
  5. if m = /([^\s]+)\.jar$/.match(file)
  6. require m[1]
  7. end
  8. end
  9. end

Report this snippet  

You need to login to post a comment.