From 809034240a1be22cc00cb3b4c1df1dd2facdc8f8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Aug 2014 00:32:27 -0400 Subject: v5: merged v6 libraries * commandline, --act0 to --act9, rc-config with flag:act[0-9] * configurable command line options increased to 0 - 9 (instead of 0 - 5) * use --act0 to --act9 (previous flags -1 to -5; -0 to -9 now available) * default --act0 * rc config with flag:act0 to flag:act9 (previously roman numerals) * legacy roman numeral configuration works (for now) * use opt.act, code internals (simplify, cleaner; remove opt.cmd & opt.mod) * hub, further changes related to use of opt.act; hub file split --- lib/sisu/v5/se_createsite.rb | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'lib/sisu/v5/se_createsite.rb') diff --git a/lib/sisu/v5/se_createsite.rb b/lib/sisu/v5/se_createsite.rb index 33e334ce..a7ab7cf5 100644 --- a/lib/sisu/v5/se_createsite.rb +++ b/lib/sisu/v5/se_createsite.rb @@ -190,16 +190,20 @@ module SiSU_Create_Site if defined? @rc['permission_set']['css_modify'] \ and @rc['permission_set']['css_modify'] SiSU_Screen::Ansi.new( - @opt.cmd, + @opt.selections.str, "*WARN* modify is css set to: #{@rc['permission_set']['css_modify']}" - ).warn if @opt.cmd=~/[MV]/ + ).warn if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on css_path.each do |x| if FileTest.directory?(x) FileUtils::cd(x) source=Dir.glob("*.{css}") source.each do |i| if FileTest.file?(i) - FileUtils::cp(i,"#{@env.path.output}/#{@env.path.style}") + FileUtils::cp( + i, + @env.path.output + '/' + @env.path.style + ) else STDERR.puts %{\t*WARN* did not find css - "#{i}" [#{__FILE__}:#{__LINE__}]} end end @@ -208,62 +212,63 @@ module SiSU_Create_Site end else SiSU_Screen::Ansi.new( - @opt.cmd, + @opt.selections.str, "*WARN* modify css is not set or is set to: false" - ).warn if @opt.cmd=~/[MV]/ + ).warn if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on end fn_css=SiSU_Env::CSS_Default.new css=SiSU_Style::CSS.new path_style="#{@env.path.output}/#{@env.path.style}" FileUtils::mkdir_p(path_style) \ unless FileTest.directory?(path_style) - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.homepage}") style=File.new("#{path_style}/#{fn_css.homepage}",'w') style << css.homepage style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.html_tables}") style=File.new("#{path_style}/#{fn_css.html_tables}",'w') style << css.html_tables style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.html}") style=File.new("#{path_style}/#{fn_css.html}",'w') style << css.html style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.harvest}") style=File.new("#{path_style}/#{fn_css.harvest}",'w') style << css.harvest style.close end - if @opt.cmd =~/C/ \ - or (@opt.cmd =~/[x]/ \ + if @opt.act[:site_init][:set]==:on \ + or (@opt.act[:xml_sax][:set]==:on \ and not FileTest.file?("#{path_style}/#{fn_css.xml_sax}")) style=File.new("#{path_style}/#{fn_css.xml_sax}",'w') style << css.xml_sax style.close end - if @opt.cmd =~/C/ \ - or (@opt.cmd =~/[X]/ \ + if @opt.act[:site_init][:set]==:on \ + or (@opt.act[:xml_dom][:set]==:on \ and not FileTest.file?("#{path_style}/#{fn_css.xml_dom}")) style=File.new("#{path_style}/#{fn_css.xml_dom}",'w') style << css.xml_dom style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or (@opt.act[:xml_docbook_book][:set] == :on \ and not FileTest.file?("#{path_style}/#{fn_css.xml_docbook}")) style=File.new("#{path_style}/#{fn_css.xml_docbook}",'w') style << css.xml_docbook style.close end - if @opt.cmd =~/C/ \ - or (@opt.cmd =~/[b]/ \ + if @opt.act[:site_init][:set]==:on \ + or (@opt.act[:xhtml][:set] == :on \ and not FileTest.file?("#{path_style}/#{fn_css.xhtml}")) style=File.new("#{path_style}/#{fn_css.xhtml}",'w') style << css.xhtml -- cgit v1.2.3