aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-03-25 23:07:56 -0400
committerRalph Amissah <ralph@amissah.com>2013-03-25 23:07:56 -0400
commit88d06e3e9b40289ad2098a9bc7be82d5f1d22b89 (patch)
treefc217bf7ecb96747a7fa006ad30cd5c01ec896ea /lib/sisu/v4/sysenv.rb
parentdebian/changelog (4.0.16-1) (diff)
parentv4: version & changelog, dates touched (diff)
Merge tag 'sisu_4.0.17' into debian/sid
SiSU 4.0.17
Diffstat (limited to 'lib/sisu/v4/sysenv.rb')
-rw-r--r--lib/sisu/v4/sysenv.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index 92ba76b5..6ed94d5d 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -5904,14 +5904,11 @@ WOK
@vz=SiSU_Viz::Defaults.new
@vz_home=SiSU_Viz::Home.new
end
- def homepage
- home_pages_manually_created=Dir.glob("#{@env.path.rc}/home/*.html")
- FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}")
- if home_pages_manually_created.length > 0
- home_pages_manually_created.each do |homepage|
- FileUtils.cp(homepage,"#{@env.path.webserv}/#{@env.path.stub_pwd}")
- end
+ def create_default_sisu_homepage(action=:none)
+ if action==:none
+ puts %{ place your homepages in directory:\n "#{@env.path.rc}/home/*.html"\n (no action taken)}
else
+ puts %{ place your homepages in directory:\n "#{@env.path.rc}/home/*.html"\n (in order to replace default sisu homepage)}
filename_homepage="#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html"
filename_home_toc="#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html"
file_homepage=File.new(filename_homepage,'w')
@@ -5922,6 +5919,17 @@ WOK
file_home_toc.close
end
end
+ def homepage
+ home_pages_manually_created=Dir.glob("#{@env.path.rc}/home/*.html")
+ FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}")
+ if home_pages_manually_created.length > 0
+ home_pages_manually_created.each do |homepage|
+ FileUtils.cp(homepage,"#{@env.path.webserv}/#{@env.path.stub_pwd}")
+ end
+ else
+ create_default_sisu_homepage(:none)
+ end
+ end
def cp_images(src_path,dest_path)
if FileTest.directory?(src_path)
FileUtils::cd(src_path)