From 39e11a4420226c3238e787de5be1c9279f46cf1f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Aug 2014 00:10:22 -0400 Subject: v5 v6: code file renames, fairly extensive * v5 file renames sync with v6 for easier comparison * v5 here (5.5.6) remains as in previous version (5.5.5) --- lib/sisu/v6/se_createsite.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sisu/v6/se_createsite.rb') diff --git a/lib/sisu/v6/se_createsite.rb b/lib/sisu/v6/se_createsite.rb index c35d24d4..7b1046f5 100644 --- a/lib/sisu/v6/se_createsite.rb +++ b/lib/sisu/v6/se_createsite.rb @@ -63,7 +63,7 @@ module SiSU_Create_Site require_relative 'constants' # constants.rb require_relative 'utils' # utils.rb - require_relative 'screen_text_color' # screen_text_color.rb + require_relative 'utils_screen_text_color' # utils_screen_text_color.rb require_relative 'se_info_env' # se_info_env.rb begin require 'fileutils' -- cgit v1.2.3 From 64e5c9120ffb7a65b96eded0850f481e116f1d3f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Aug 2014 00:16:16 -0400 Subject: v6: use opt.act, code internals (simplify, cleaner; remove opt.cmd & opt.mod) * v5 dp, indentation changed to retain easy comparison with v6 --- lib/sisu/v6/se_createsite.rb | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'lib/sisu/v6/se_createsite.rb') diff --git a/lib/sisu/v6/se_createsite.rb b/lib/sisu/v6/se_createsite.rb index 7b1046f5..450ee10d 100644 --- a/lib/sisu/v6/se_createsite.rb +++ b/lib/sisu/v6/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