class SiSU_Hub_Actions::Operations

Public Class Methods

new(opt='') click to toggle source
# File lib/sisu/hub_actions.rb, line 1062
def initialize(opt='')
  @opt=opt
  @cX=SiSU_Screen::Ansi.new(@opt).cX
end

Public Instance Methods

cgi() click to toggle source
# File lib/sisu/hub_actions.rb, line 1093
def cgi                                              # -F
  require_relative 'cgi'                             # cgi.rb
  SiSU_CGI::SearchSQL.new(@opt).read
end
convert_name_message(fns,type,i,o,rune) click to toggle source
# File lib/sisu/hub_actions.rb, line 1114
def convert_name_message(fns,type,i,o,rune)
  %{\nIn filename: "#{@cX.fuchsia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuchsia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.selections.str} processing skipped\n}
end
counter() click to toggle source
# File lib/sisu/hub_actions.rb, line 1066
def counter
  @@n_do=0
end
not_found() click to toggle source
# File lib/sisu/hub_actions.rb, line 1111
def not_found
  puts "\n#{@cX.fuchsia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.selections.str} processing skipped\n"
end
not_recognised() click to toggle source
# File lib/sisu/hub_actions.rb, line 1117
def not_recognised
  case @opt.fns
  when /(\.s[123])$/
    type=@opt.fns.gsub(/\S+?(#{$1})/,'\1')
    rune=%q{rename 's/\.s[123]$/\.sst/' *.s{1,2,3}}
    puts convert_name_message(@opt.fns,type,'.s1 .s2 and .s3','.sst',rune)
  when /(\.r[123])$/
    type=@opt.fns.gsub(/\S+?(#{$1})/,'\1')
    rune=%q{rename 's/\.r[123]$/\.ssm/' *.r{1,2,3}}
    puts convert_name_message(@opt.fns,type,'.r1 .r2 and .r3','.sst',rune)
    puts %{\n\tNote also that you will need to change the names of the files called/required\n\twithin the document text to build the composite document\n\t\t.s1 .s2 .s3 should be .sst \n\t\t.si should be .ssi\n\trequested #{@opt.selections.str} processing skipped\n}
  when /(\.ssi)$/
    puts "\n#{@cX.fuchsia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.selections.str} processing skipped\n"
  else
    puts "\n#{@cX.fuchsia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.selections.str} processing skipped\n"
  end
end
remote_put_base_site() click to toggle source
# File lib/sisu/hub_actions.rb, line 1081
def remote_put_base_site                             # -Cr
  SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \
    if @opt.act[:maintenance][:set] ==:on
  require_relative 'remote'                          # remote.rb
  SiSU_Remote::Put.new(@opt).scp_base
end
remote_put_base_site_all() click to toggle source
# File lib/sisu/hub_actions.rb, line 1087
def remote_put_base_site_all                         # -CCr
  SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \
    if @opt.act[:maintenance][:set] ==:on
  require_relative 'remote'                          # remote.rb
  SiSU_Remote::Put.new(@opt).scp_base_all
end
remote_put_base_site_rsync() click to toggle source
# File lib/sisu/hub_actions.rb, line 1069
def remote_put_base_site_rsync                       # -CR
  SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \
    if @opt.act[:maintenance][:set] ==:on
  require_relative 'remote'                          # remote.rb
  SiSU_Remote::Put.new(@opt).rsync_base
end
remote_put_base_site_rsync_match() click to toggle source
# File lib/sisu/hub_actions.rb, line 1075
def remote_put_base_site_rsync_match                 # -CCRZ
  SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \
    if @opt.act[:maintenance][:set] ==:on
  require_relative 'remote'                          # remote.rb
  SiSU_Remote::Put.new(@opt).rsync_base_sync
end
termsheet() click to toggle source
# File lib/sisu/hub_actions.rb, line 1097
def termsheet                                        # -t
  system("sisu_termsheet #{@opt.selections.str} #{@opt.fns}\n")
  @@n_do=@@n_do+1
  SiSU_Screen::Ansi.new(
    @opt.selections.str,@@n_do,
    'Termsheet(s) processed'
  ).term_sheet_title unless @opt.act[:quiet][:set] ==:on
end
webrick() click to toggle source
# File lib/sisu/hub_actions.rb, line 1105
def webrick                                          # -W
  prt=SiSU_Env::InfoEnv.new(@fns).port.webrick_port
  puts %{#{@cX.blue}<<#{@cX.off}#{@cX.green}Start Webrick web server on port: #{prt}#{@cX.off}#{@cX.blue}>> #{@cX.off*2} }
  require_relative 'webrick'
  SiSU_Webserv::WebrickStart.new
end