summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2006-05-16 18:35:00 +0200
committerHans Hagen <pragma@wxs.nl>2006-05-16 18:35:00 +0200
commit97c003887ee2b36079c07c7dab9414a266056b47 (patch)
treec0fa4e6fc829a19e2463bac69c86aee1239596b9 /scripts
parent6edea41ff329ce2d76f34a59e90fa5d80d0eaee2 (diff)
downloadcontext-97c003887ee2b36079c07c7dab9414a266056b47.tar.gz
stable 2006.05.16 18:35
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/ruby/base/merge.rb20
-rw-r--r--scripts/context/ruby/texmfstart.rb22
-rw-r--r--scripts/context/ruby/www/exa.rb2
-rw-r--r--scripts/context/ruby/www/lib.rb5
-rw-r--r--scripts/context/ruby/wwwwatch.rb2
5 files changed, 28 insertions, 23 deletions
diff --git a/scripts/context/ruby/base/merge.rb b/scripts/context/ruby/base/merge.rb
index 36ab85269..c6ea6c09e 100644
--- a/scripts/context/ruby/base/merge.rb
+++ b/scripts/context/ruby/base/merge.rb
@@ -53,9 +53,9 @@ module SelfMerge
end
end
- def SelfMerge::merge(filename=@@filename)
+ def SelfMerge::merge
begin
- if rbfile = IO.read(filename) then
+ if SelfMerge::ok? && rbfile = IO.read(@@filename) then
begin
inserts = "#{@@kpsemergestart}\n\n"
@@modules.each do |file|
@@ -80,7 +80,7 @@ module SelfMerge
return false
else
begin
- File.open(filename,'w') do |f|
+ File.open(@@filename,'w') do |f|
f << rbfile
end
rescue
@@ -95,9 +95,9 @@ module SelfMerge
end
end
- def SelfMerge::cleanup(filename=@@filename)
+ def SelfMerge::cleanup
begin
- if rbfile = IO.read(filename) then
+ if rbfile = IO.read(@@filename) then
begin
rbfile.sub!(/#{@@kpsemergestart}(.*)#{@@kpsemergestop}\s*/mois) do
"#{@@kpsemergestart}\n\n#{@@kpsemergestop}\n\n"
@@ -114,7 +114,7 @@ module SelfMerge
return false
else
begin
- File.open(filename,'w') do |f|
+ File.open(@@filename,'w') do |f|
f << rbfile
end
rescue
@@ -129,9 +129,11 @@ module SelfMerge
end
end
- def SelfMerge::replace(filename=@@filename)
- SelfMerge::cleanup(filename)
- SelfMerge::merge(filename)
+ def SelfMerge::replace
+ if SelfMerge::ok? then
+ SelfMerge::cleanup
+ SelfMerge::merge
+ end
end
end
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index 8bda35c7b..6cb5d5ccb 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -1331,9 +1331,9 @@ module SelfMerge
end
end
- def SelfMerge::merge(filename=@@filename)
+ def SelfMerge::merge
begin
- if rbfile = IO.read(filename) then
+ if SelfMerge::ok? && rbfile = IO.read(@@filename) then
begin
inserts = "#{@@kpsemergestart}\n\n"
@@modules.each do |file|
@@ -1358,7 +1358,7 @@ module SelfMerge
return false
else
begin
- File.open(filename,'w') do |f|
+ File.open(@@filename,'w') do |f|
f << rbfile
end
rescue
@@ -1373,9 +1373,9 @@ module SelfMerge
end
end
- def SelfMerge::cleanup(filename=@@filename)
+ def SelfMerge::cleanup
begin
- if rbfile = IO.read(filename) then
+ if rbfile = IO.read(@@filename) then
begin
rbfile.sub!(/#{@@kpsemergestart}(.*)#{@@kpsemergestop}\s*/mois) do
"#{@@kpsemergestart}\n\n#{@@kpsemergestop}\n\n"
@@ -1392,7 +1392,7 @@ module SelfMerge
return false
else
begin
- File.open(filename,'w') do |f|
+ File.open(@@filename,'w') do |f|
f << rbfile
end
rescue
@@ -1407,9 +1407,11 @@ module SelfMerge
end
end
- def SelfMerge::replace(filename=@@filename)
- SelfMerge::cleanup(filename)
- SelfMerge::merge(filename)
+ def SelfMerge::replace
+ if SelfMerge::ok? then
+ SelfMerge::cleanup
+ SelfMerge::merge
+ end
end
end
@@ -2379,7 +2381,7 @@ def execute(arguments)
# private:
$selfmerge = $directives['selfmerge'] || false
- $selfcleanup = $directives['selfcleanup'] || false
+ $selfcleanup = $directives['selfclean'] || $directives['selfcleanup'] || false
ENV['_CTX_VERBOSE_'] = 'yes' if $verbose
diff --git a/scripts/context/ruby/www/exa.rb b/scripts/context/ruby/www/exa.rb
index 6cf7d8a9b..c6d59d864 100644
--- a/scripts/context/ruby/www/exa.rb
+++ b/scripts/context/ruby/www/exa.rb
@@ -49,7 +49,7 @@ class WWW
end
def handle_exainterface()
- check_template_file('text','text-template.htm')
+ check_template_file('text','exalogin-template.htm')
if id = valid_session() then
filename = @interface.get('process:uri').to_s # kind of dup
if ! filename.empty? && filename.sub!(/^.*\//,'') then
diff --git a/scripts/context/ruby/www/lib.rb b/scripts/context/ruby/www/lib.rb
index b330c2a97..2a4f3e14f 100644
--- a/scripts/context/ruby/www/lib.rb
+++ b/scripts/context/ruby/www/lib.rb
@@ -158,8 +158,8 @@ class WWW
analyze_request()
update_interface()
- @interface.set('template:message' , 'text-template.htm')
- @interface.set('template:status' , 'text-template.htm')
+ @interface.set('template:message' , 'exalogin-template.htm')
+ @interface.set('template:status' , 'exalogin-template.htm')
@interface.set('template:login' , 'exalogin.htm')
@interface.set('process:timeout' , @@session_max_age)
@interface.set('process:threshold' , @@send_threshold)
@@ -278,6 +278,7 @@ class WWW
end
end
end
+ @interface.set('path:root', File.dirname(@interface.get('path:docroot')))
end
# name in calling script takes precedence
diff --git a/scripts/context/ruby/wwwwatch.rb b/scripts/context/ruby/wwwwatch.rb
index 1f61ef479..e5f0c0654 100644
--- a/scripts/context/ruby/wwwwatch.rb
+++ b/scripts/context/ruby/wwwwatch.rb
@@ -74,7 +74,7 @@ class Watch < Monitor
@files = Array.new
@stats = Hash.new
@skips = Hash.new
- @root_path = File.expand_path(File.join(File.dirname($0),'..')) if @root_path.empty?
+ @root_path = File.expand_path(File.join(File.dirname($0),'.')) if @root_path.empty?
@work_path = File.expand_path(File.join(@root_path,'work','watch')) if @work_path.empty?
@cache_path = File.expand_path(File.join(@root_path,'work','cache')) if @work_path.empty?
begin File.makedirs(@work_path) ; rescue ; end