aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-06-03 14:39:42 -0400
committerRalph Amissah <ralph@amissah.com>2012-06-03 14:39:42 -0400
commit26e5e47cb281d7ee98abcc619332b87b321aaed0 (patch)
tree10cc58f649f2569992fbbde9730baa3ee74054da /lib/sisu/v3/sysenv.rb
parentv3: manifest, paths, (for command line selection of output type) fix (diff)
v3: images, regular & sisupod
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index e03c668d..f57185fc 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -5668,6 +5668,38 @@ WOK
@pwd_stub=@pwd[m,1]
@env=SiSU_Env::InfoEnv.new
end
+ def apply
+ if @md.make.skin
+ skin_path=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/
+ [
+ "#{@env.path.pwd}/_sisu/skin",
+ "#{@env.path.home}/.sisu/skin",
+ '/etc/sisu/skin',
+ "#{@env.processing_path.processing_sisupod(@md.opt)}/external_document/skin"
+ ]
+ else #sisupod
+ pt=/(\/\S+?\/sisupod\/\S+?\/sisupod\/doc)/.match(@md.opt.f_pth[:pth])[1]
+ [ "#{pt}/_sisu/skin" ]
+ end
+ sk_doc,sk_dir="doc/#{@md.make.skin}.rb","dir/skin_#{@env.stub_pwd}.rb"
+ skin_path.each do |v| #document skin priority 1
+ if FileTest.file?("#{v}/#{sk_doc}")
+ @skin_apply={ name: @md.make.skin, name_path: "#{v}/#{sk_doc}", type: :doc }
+ break
+ end
+ end
+ unless @skin_apply.length > 0
+ skin_path.each do |v| #directory skin priority 2
+ if FileTest.file?("#{v}/#{sk_dir}")
+ @skin_apply={ name: "skin_#{@env.stub_pwd}.rb", name_path: "#{v}/#{sk_dir}", type: :dir }
+ break
+ end
+ end
+ end
+ else nil
+ end
+ @skin_apply
+ end
def select # skin loading logic here
load "#{SiSU_lib}/defaults.rb"
skin_path=[]