From c84fbddacab4cb86ec35fbf5c8dfa27b52a2b6be Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 6 Feb 2018 21:35:19 -0500 Subject: [PATCH] move ruby share files under share/svi/lib --- share/svi/{ => lib}/bootstrap.rb | 2 +- share/svi/{ => lib}/svi.rb | 0 src/main.cc | 6 ++---- 3 files changed, 3 insertions(+), 5 deletions(-) rename share/svi/{ => lib}/bootstrap.rb (75%) rename share/svi/{ => lib}/svi.rb (100%) diff --git a/share/svi/bootstrap.rb b/share/svi/lib/bootstrap.rb similarity index 75% rename from share/svi/bootstrap.rb rename to share/svi/lib/bootstrap.rb index ee2fe4f..277c491 100644 --- a/share/svi/bootstrap.rb +++ b/share/svi/lib/bootstrap.rb @@ -1,5 +1,5 @@ begin - load File.join(File.dirname(__FILE__), "svi.rb") + load "#{$SHARE_DIR}/lib/svi.rb" rescue Interrupt => e rescue Exception => e $stderr.puts "#{e.class}: #{e}" diff --git a/share/svi/svi.rb b/share/svi/lib/svi.rb similarity index 100% rename from share/svi/svi.rb rename to share/svi/lib/svi.rb diff --git a/src/main.cc b/src/main.cc index a990274..c2da1c1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -6,8 +6,6 @@ #include #include -#define SHARE_BOOTSTRAP "/share/svi/bootstrap.rb" - VALUE svi_ruby_protect_eval_string_rescue(VALUE exception, VALUE exception_object) { *(bool *)exception = true; @@ -85,7 +83,7 @@ const char * read_bootstrap_file() if (index != std::string::npos) { share_dir = std::string(exe_path, 0u, index) + "/share/svi"; - char * bootstrap = read_file((share_dir + "/bootstrap.rb").c_str()); + char * bootstrap = read_file((share_dir + "/lib/bootstrap.rb").c_str()); if (bootstrap != nullptr) { return bootstrap; @@ -93,7 +91,7 @@ const char * read_bootstrap_file() } } share_dir = SHARE_DIR; - return read_file(SHARE_DIR "/bootstrap.rb"); + return read_file(SHARE_DIR "/lib/bootstrap.rb"); } int main(int argc, char * argv[])