c: hub options, fix
authorRalph Amissah <ralph@amissah.com>
Tue, 21 Apr 2015 17:19:55 +0000 (13:19 -0400)
committerRalph Amissah <ralph@amissah.com>
Sat, 25 Apr 2015 17:46:02 +0000 (13:46 -0400)
lib/sisu/current/hub_options.rb

index 35398758ee46bdaccc987867e9b2a3641d6db777..8a9af1564a1d93c8cccee5d094444de3a020449f 100644 (file)
@@ -178,9 +178,27 @@ module SiSU_Commandline
     def sisu_run_from?
       @sisu_run_from
     end
+    def sisu_bin_filepath?
+      @sisu_run_from
+    end
     def sisu_install_type?
       @sisu_install_type
     end
+    def sisu_data_dir?
+      env=RbConfig::CONFIG
+      if sisu_install_type? ==:full_path_to_sisu_bin_in_sisu_dir_tree
+        sisu_bin_filepath?.gsub(/\/bin\/sisu\S*/,'/data/sisu')
+        #sisu_lib_dir?.gsub(/\/lib\/sisu\/(?:current|develop)\S*/,'/data/sisu')
+      elsif sisu_install_type? ==:gem_install
+        #sisu_run_from?.gsub(/\/bin\/.+/,'/data/sisu')
+        env['datadir']
+      elsif sisu_install_type? ==:system_install
+        #SiSU_Info_Env::InfoEnv.new.path.share
+        env['datadir']
+      else
+        env['datadir']
+      end
+    end
     def find_all(find_flag,opt)
       if find_flag
         x=Dir.glob('*.ss[tm]')