qi (quick install) gem install version
[software/sisu] / lib / sisu.rb
1 # encoding: utf-8
2 =begin
3
4 * Name: SiSU
5
6 ** Description: documents, structuring, processing, publishing, search
7 *** hub
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.rb;hb=HEAD>
55
56 =end
57 module SiSU_libs
58 require_relative 'sisu/hub' # sisu/hub.rb
59 require_relative 'sisu/se' # sisu/se.rb
60 require_relative 'sisu/utils' # sisu/utils.rb
61 class CallHubMaster
62 def initialize(argv,sisu_runtime)
63 begin
64 SiSU::HubMaster.new(argv,sisu_runtime)
65 rescue
66 SiSU_Screen::Ansi.new(argv).rescue do
67 __LINE__.to_s + ':' + __FILE__
68 end
69 ensure
70 Dir.chdir(sisu_runtime[:call_path])
71 end
72 end
73 end
74 class HubClose
75 def initialize(argv,call_path)
76 begin
77 env=SiSU_Env::InfoEnv.new
78 rescue
79 ensure
80 if FileTest.directory?(env.processing_path.processing) \
81 and FileTest.directory?(env.processing_path.processing_base_tmp) \
82 and env.processing_path.processing_base_tmp =~/#{env.processing_path.processing}/ \
83 and env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/ \
84 and not argv.inspect =~/"--maintenance"|"-M"/
85 FileUtils::cd(env.processing_path.processing_base_tmp) do
86 FileUtils::rm_rf('.')
87 end
88 end
89 Dir.chdir(call_path)
90 end
91 end
92 end
93 end
94 __END__