Class: Naether::Java::JRuby
- Inherits:
-
Object
- Object
- Naether::Java::JRuby
- Includes:
- Singleton
- Defined in:
- lib/naether/java.rb
Overview
Handle loading jars for JRuby
Instance Attribute Summary collapse
-
#loaded_jars ⇒ Object
readonly
Returns the value of attribute loaded_jars.
Instance Method Summary collapse
-
#initialize ⇒ JRuby
constructor
A new instance of JRuby.
- #load_jars(jars) ⇒ Object
Constructor Details
#initialize ⇒ JRuby
Returns a new instance of JRuby.
85 86 87 88 89 |
# File 'lib/naether/java.rb', line 85 def initialize require 'java' @loaded_jars = [] end |
Instance Attribute Details
#loaded_jars ⇒ Object (readonly)
Returns the value of attribute loaded_jars.
83 84 85 |
# File 'lib/naether/java.rb', line 83 def loaded_jars @loaded_jars end |
Instance Method Details
#load_jars(jars) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/naether/java.rb', line 91 def load_jars(jars) loaded_jars = [] unless jars.is_a? Array jars = [jars] end jars.each do |jar| = File.(jar) if !@loaded_jars.include? require loaded_jars << @loaded_jars << end end loaded_jars end |