init.rb in rwdshell-0.96 vs init.rb in rwdshell-0.97
- old
+ new
@@ -21,10 +21,11 @@
#* at "steven@superant.com".
#***********************************************************************/
require "ev/rwd"
require 'fileutils'
+require 'extras/rconftool'
$progdir = File::expand_path( File.dirname(__FILE__))
$tempdoc = " "
@@ -57,21 +58,38 @@
end
end
end
end
+# integrate the new configuration files
+MAINconfignew = "rwdconfig.cnf"
+MAINconfigdist = "rwdconfig.dist"
+Rconftool::install(MAINconfigdist,MAINconfignew)
+
+ Dir.chdir("configuration") #changes the current working directory
+
+ fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /dist$/) } #creates an Array separated with \n
+ @doc = ""
+ fileList.length.times{ #opening of a block
+ configdist =fileList.pop #pops the first item out of the Array
+tempconfigfile = configdist.gsub(/\.dist$/, "")
+confignew = tempconfigfile + ".cnf"
+Rconftool::install(configdist,confignew) #integrates new file with old
+ } #closing block
+ # END of configuration integration
+Dir.chdir($progdir)
+
# Read in the configuration files
-
Dir.chdir("configuration") #changes the current working directory
fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
@doc = ""
fileList.length.times{ #opening of a block
fileName=fileList.pop #pops the first item out of the Array
load fileName #loads the the config file thats in fileName
} #closing block
# END of configuration reading
-
+
Dir.chdir($progdir) # change back to top program directory
# build the English Language hash file from the parts
languagehashvariable = 'Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
langmessage = {' + "\n"