diff options
author | Hans Hagen <pragma@wxs.nl> | 2007-03-22 13:34:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2007-03-22 13:34:00 +0100 |
commit | 307dc2a385a62e9c390e045f39c1b288631c9481 (patch) | |
tree | e0adef349da6d29672bed7ba802b33744f0b0963 /scripts | |
parent | 8a354e9fa5309910252aee3e7c5fdb4303deae45 (diff) | |
download | context-307dc2a385a62e9c390e045f39c1b288631c9481.tar.gz |
stable 2007.03.22 13:34
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/ruby/ctxtools.rb | 15 | ||||
-rw-r--r-- | scripts/context/ruby/xmltools.rb | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb index a70501cd5..27240583a 100644 --- a/scripts/context/ruby/ctxtools.rb +++ b/scripts/context/ruby/ctxtools.rb @@ -2596,7 +2596,17 @@ class Commands def fetchfile(site, name, target=nil) begin - http = Net::HTTP.new(site) + proxy = @commandline.option('proxy') + if proxy && ! proxy.empty? then + address, port = proxy.split(":") + if address && port then + http = Net::HTTP::Proxy(address, port).new(site) + else + http = Net::HTTP::Proxy(proxy, 80).new(site) + end + else + http = Net::HTTP.new(site) + end resp, data = http.get(name.gsub(/^\/*/, '/')) rescue return false @@ -2697,12 +2707,13 @@ commandline.registeraction('listentities' , 'create doctype entity definiti commandline.registeraction('brandfiles' , 'add context copyright notice [--force]') commandline.registeraction('platformize' , 'replace line-endings [--recurse --force] [pattern]') commandline.registeraction('dependencies' , 'analyze depedencies within context [--save --compact --filter=[macros|filenames]] [filename]') -commandline.registeraction('updatecontext' , 'download latest version and remake formats') +commandline.registeraction('updatecontext' , 'download latest version and remake formats [--proxy]') commandline.registeraction('disarmutfbom' , 'remove utf bom [--force]') commandline.registervalue('type','') commandline.registervalue('filter','') commandline.registervalue('maproot','') +commandline.registervalue('proxy','') commandline.registerflag('recurse') commandline.registerflag('force') diff --git a/scripts/context/ruby/xmltools.rb b/scripts/context/ruby/xmltools.rb index e0ff3c0f7..c28df200d 100644 --- a/scripts/context/ruby/xmltools.rb +++ b/scripts/context/ruby/xmltools.rb @@ -476,7 +476,7 @@ class Commands "<#{elements.length}>" end # abc[-/]def - data.gsub!(/([a-z]{3,})([\/\-\(\)])([a-z]{3,})/moi) do + data.gsub!(/([a-z]{3,})([\/\-\(\)]+)([a-z]{3,})/moi) do done = true report("compound: #{$1}#{$2}#{$3}") if verbose "#{$1}<compound token='#{$2}'/>#{$3}" |