aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-08-29 21:30:02 -0400
committerRalph Amissah <ralph@amissah.com>2012-08-29 21:30:02 -0400
commitb4694609f708d52b7dbd88dfab53f3178451ad27 (patch)
treefb066d979178187c5c9273b6a9ffa80722766e43 /lib
parentv3: sisu -v, provide version information, fix (diff)
v3: bin/sisu, hub, reorganize call
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/hub.rb58
1 files changed, 28 insertions, 30 deletions
diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb
index 6fa69753..ac103830 100644
--- a/lib/sisu/v3/hub.rb
+++ b/lib/sisu/v3/hub.rb
@@ -59,8 +59,33 @@
module SiSU
require_relative 'constants' # constants.rb
require_relative 'sysenv' # sysenv.rb
+ include SiSU_Env
include SiSU_Screen
- @@pwd_the=Dir.pwd
+ require_relative 'options' # options.rb
+ require_relative 'param' # param.rb
+ include SiSU_Param
+ require_relative 'defaults' # defaults.rb
+ include SiSU_Viz
+ require_relative 'help' # help.rb
+ include SiSU_Help
+ require 'uri'
+ class HubMaster
+ def initialize(argv)
+ pwd_the=Dir.pwd
+ begin #% select what to do
+ home=ENV['HOME']
+ opt=SiSU_Commandline::Options.new(argv)
+ SiSU::Processing.new(opt).actions
+ rescue
+ cmd=(opt ? opt.cmd : '')
+ SiSU_Screen::Ansi.new(cmd,$!,$@).rescue do
+ __LINE__.to_s + ':' + __FILE__
+ end
+ ensure
+ Dir.chdir(pwd_the)
+ end
+ end
+ end
class OptionLoopFiles
def initialize(opt)
@opt=opt
@@ -229,10 +254,11 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
class Processing
require 'fileutils'
include FileUtils
- @@env=SiSU_Env::InfoEnv.new
+ @@env=nil
attr_accessor :op
def initialize(opt)
@opt=opt
+ @@env=SiSU_Env::InfoEnv.new
@msg,@msgs='',nil
@tell=lambda { SiSU_Screen::Ansi.new(@opt.cmd,@msg,"#{@msgs.inspect if @msgs}") }
end
@@ -690,33 +716,5 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on
end
end
end
- begin #% select what to do
- if RUBY_VERSION < '1.9'
- require 'jcode'
- $KCODE='UTF8'
- end
- require_relative 'constants' # constants.rb
- require_relative 'options' # options.rb
- require_relative 'sysenv' # sysenv.rb
- include SiSU_Env; include SiSU_Screen
- require_relative 'param' # param.rb
- include SiSU_Param
- require_relative 'defaults' # defaults.rb
- include SiSU_Viz
- require_relative 'help' # help.rb
- include SiSU_Help
- require 'uri'
- home=ENV['HOME']
- argv=$*
- @opt=SiSU_Commandline::Options.new(argv)
- SiSU::Processing.new(@opt).actions
- rescue
- cmd=(@opt ? @opt.cmd : '')
- SiSU_Screen::Ansi.new(cmd,$!,$@).rescue do
- __LINE__.to_s + ':' + __FILE__
- end
- ensure
- Dir.chdir(@@pwd_the)
- end
end
__END__