c&d: some cruft
[software/sisu] / lib / sisu / current / se_clear.rb
1 # encoding: utf-8
2 =begin
3
4 * Name: SiSU
5
6 ** Description: documents, structuring, processing, publishing, search
7 *** system environment, resource control and configuration details
8
9 ** Author: Ralph Amissah
10 <ralph@amissah.com>
11 <ralph.amissah@gmail.com>
12
13 ** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
14 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Ralph Amissah,
15 All Rights Reserved.
16
17 ** License: GPL 3 or later:
18
19 SiSU, a framework for document structuring, publishing and search
20
21 Copyright (C) Ralph Amissah
22
23 This program is free software: you can redistribute it and/or modify it
24 under the terms of the GNU General Public License as published by the Free
25 Software Foundation, either version 3 of the License, or (at your option)
26 any later version.
27
28 This program is distributed in the hope that it will be useful, but WITHOUT
29 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
30 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
31 more details.
32
33 You should have received a copy of the GNU General Public License along with
34 this program. If not, see <http://www.gnu.org/licenses/>.
35
36 If you have Internet connection, the latest version of the GPL should be
37 available at these locations:
38 <http://www.fsf.org/licensing/licenses/gpl.html>
39 <http://www.gnu.org/licenses/gpl.html>
40
41 <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html>
42
43 ** SiSU uses:
44 * Standard SiSU markup syntax,
45 * Standard SiSU meta-markup syntax, and the
46 * Standard SiSU object citation numbering and system
47
48 ** Hompages:
49 <http://www.jus.uio.no/sisu>
50 <http://www.sisudoc.org>
51
52 ** Git
53 <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
54 <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/current/se_clear.rb;hb=HEAD>
55
56 =end
57 module SiSU_Clear
58 require_relative 'constants' # constants.rb
59 require_relative 'utils' # utils.rb
60 require_relative 'se_info_env' # se_info_env.rb
61 begin
62 require 'singleton'
63 rescue LoadError
64 SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).
65 error('singleton NOT FOUND (LoadError)')
66 end
67 class Clear < SiSU_Info_Env::InfoEnv # se_info_env.rb
68 #todo unify with FileOp
69 def initialize(cmd,fns,operation='')
70 @cmd=cmd
71 begin
72 super(fns)
73 @env=SiSU_Env::InfoEnv.new(fns)
74 SiSU_Env::InfoVersion.instance
75 if operation.class.inspect =~/SiSU_Param/
76 @md=operation
77 end
78 case operation #watch
79 when /pdf/ then @env_out=''
80 when /sql/
81 when /xml|plaintext|ascii/ then @env_out=@env.path.output + @fnb #check change of name to plaintext from ascii
82 else
83 if defined? @md.sfx_src \
84 and @md.sfx_src =~/ss[ftsumc]/
85 @env_out_root=@env.path.output
86 @env_out="#{@env.path.output}/#{@fnb}"
87 @@publisher='SiSU http://www.jus.uio.no/sisu'
88 @env_pdf="#{@env_out_root}/pdf"
89 end
90 end
91 rescue
92 SiSU_Screen::Ansi.new(@cmd,$!,$@).rescue do
93 __LINE__.to_s + ':' + __FILE__
94 end
95 ensure
96 end
97 end
98 def param_instantiate
99 @cX||=SiSU_Screen::Ansi.new(@cmd)
100 @@date=SiSU_Env::InfoDate.new
101 @@proc=@@filename_txt=@@filename_texinfo=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=@@yaml=@@yamladdr=nil
102 @@publisher='SiSU scribe'
103 end
104 end
105 end
106 __END__