aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--data/doc/sisu/CHANGELOG_v47
-rw-r--r--lib/sisu/v4/sysenv.rb5
-rw-r--r--lib/sisu/v4/utils.rb11
3 files changed, 20 insertions, 3 deletions
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4
index c79ebe1a..9cdd4885 100644
--- a/data/doc/sisu/CHANGELOG_v4
+++ b/data/doc/sisu/CHANGELOG_v4
@@ -26,7 +26,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.6.orig.tar.xz
* v4: html, screen reporting for --html-scroll, correctly identify output file
-* v4: utils (debug renamed) SiSU_Utils::CodeMarker (from Debug::Mark)
+* v4: utils (debug renamed)
+ * SiSU_Utils::CodeMarker (from Debug::Mark)
+ * SiSU_Utils::Path.new.base_markup provides base markup directory that
+ contains sisu markup files, any language sub-directories (with sisu markup
+ files) and sisu resource configuration sub-directory, if any (./_sisu)
+ (identifies when needed in runtime)
%% 4.0.5.orig.tar.xz (2013-02-03:04/7)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.5
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index c5a1cebb..2ac8897f 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -60,6 +60,7 @@
@@lang_info=nil
module SiSU_Env
require_relative 'constants' # constants.rb
+ require_relative 'utils' # utils.rb
require 'fileutils'
include FileUtils::Verbose
require 'singleton'
@@ -213,7 +214,7 @@ module SiSU_Env
}
@@default_dir=DEFAULT_DIR
m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m
- @@pwd=@pwd=(/(\S+?)(?:\/(?:#{Px[:lng_lst_rgx]}))?$/).match(Dir.pwd)[1]
+ @@pwd=@pwd=SiSU_Utils::Path.new.base_markup
stub_pwd=@pwd[m,1]
attr_accessor :user,:home,:hostname,:pwd,:host,:arch,:rbver,:dir_arch,:dir_sitearch,:dir_bin,:locale,:webserv_path,:webserv_host_cgi,:webserv_port_cgi,:default_dir,:rc_path,:ad_path
def initialize
@@ -3926,7 +3927,7 @@ WOK
class InfoDb < InfoEnv
@@rc=nil
def initialize
- @@pwd=@pwd=(/(\S+?)(?:\/(?:#{Px[:lng_lst_rgx]}))?$/).match(Dir.pwd)[1]
+ @@pwd=@pwd=SiSU_Utils::Path.new.base_markup
@env=SiSU_Env::InfoEnv.new
pt=Pathname.new(@pwd)
r=Px[:lng_lst_rgx]
diff --git a/lib/sisu/v4/utils.rb b/lib/sisu/v4/utils.rb
index 7567d26a..040e06b6 100644
--- a/lib/sisu/v4/utils.rb
+++ b/lib/sisu/v4/utils.rb
@@ -99,6 +99,17 @@ module SiSU_Utils
@file.gsub(/([^\/]+$)/,"#{c[:on]}\\1#{c[:off]}")
end
end
+ class Path
+ def initialize(dir=Dir.pwd)
+ @dir=dir
+ end
+ def base_markup
+ (/(\S+?)(?:\/(?:#{Px[:lng_lst_rgx]}))?$/).match(Dir.pwd)[1]
+ end
+ def bmd
+ base_markup
+ end
+ end
end
__END__
puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:red)