assets/src/org/ruboto/JRubyAdapter.java in ruboto-1.0.2 vs assets/src/org/ruboto/JRubyAdapter.java in ruboto-1.0.3
- old
+ new
@@ -132,11 +132,13 @@
// END Ruboto HeapAlloc
setDebugBuild(appContext);
Log.d("Setting up JRuby runtime (" + (isDebugBuild ? "DEBUG" : "RELEASE") + ")");
System.setProperty("jruby.backtrace.style", "normal"); // normal raw full mri
System.setProperty("jruby.bytecode.version", "1.6");
- // System.setProperty("jruby.compat.version", "RUBY2_0"); // RUBY1_9 is the default in JRuby 1.7
+ // BEGIN Ruboto RubyVersion
+ // System.setProperty("jruby.compat.version", "RUBY1_9"); // RUBY1_9 is the default in JRuby 1.7
+ // END Ruboto RubyVersion
// System.setProperty("jruby.compile.backend", "DALVIK");
System.setProperty("jruby.compile.mode", "OFF"); // OFF OFFIR JITIR? FORCE FORCEIR
System.setProperty("jruby.interfaces.useProxy", "true");
System.setProperty("jruby.ir.passes", "LocalOptimizationPass,DeadCodeElimination");
System.setProperty("jruby.management.enabled", "false");
@@ -375,17 +377,22 @@
private static String scriptsDirName(Context context) {
File storageDir = null;
if (isDebugBuild()) {
storageDir = context.getExternalFilesDir(null);
- if (storageDir == null || (!storageDir.exists() && !storageDir.mkdirs())) {
+ if (storageDir == null) {
Log.e("Development mode active, but sdcard is not available. Make sure you have added\n<uses-permission android:name='android.permission.WRITE_EXTERNAL_STORAGE' />\nto your AndroidManifest.xml file.");
storageDir = context.getFilesDir();
}
} else {
storageDir = context.getFilesDir();
}
- return storageDir.getAbsolutePath() + "/scripts";
+ File scriptsDir = new File(storageDir, "scripts");
+ if ((!scriptsDir.exists() && !scriptsDir.mkdirs())) {
+ Log.e("Unable to create the scripts dir.");
+ scriptsDir = new File(context.getFilesDir(), "scripts");
+ }
+ return scriptsDir.getAbsolutePath();
}
private static void setDebugBuild(Context context) {
PackageManager pm = context.getPackageManager();
PackageInfo pi;