I'm using ruboto (ruby) on an android tablet. I'd like my source to be in a subdirectory of the usual default source directory. Is there a way to do this?
-
In the IRB I can change directory using 'Dir.chdir "subdir"'. But ruboto's SCRIPTS page still uses the jruby directory. – Nick Keighley Dec 30 '15 at 10:34
-
or again in the irb I can use 'require "subdir/rbfile"'. Still not ideal tho... – Nick Keighley Dec 30 '15 at 21:22
1 Answers
You have not stated your motivation for placing the Ruby source in a subdirectory, so I'll speculate that it is for tidiness in a polyglot environment. Also, I'll assume you want all the Ruby source in the same directory, including source for Activity classes.
Adding your path to both the Ruby $LOAD_PATH and the Android component search path has been combined into one method in org.ruboto.JRubyAdapter.addLoadPath
. In JRubyAdapter.setUpJRuby
, you can find a call to addLoadPath
around line 289: https://github.com/ruboto/ruboto/blob/1.4.0/assets/src/org/ruboto/JRubyAdapter.java#L289
You can add your own call below the existing one:
addLoadPath("file:" + apkName + "!/<your_path_here>")
That will add the path to the Ruby load path and the Android component search path.
If you have a clear use case, I would submit it to the Ruboto tracker at https://github.com/ruboto/ruboto/issues . It sounds like something more Ruboto developers could use.

- 1,091
- 7
- 15