@@ -1,4 +1,4 @@ | ||
1 | -# $Id: pluginutil.rb,v 1.9 2005-07-20 01:18:54 fdiary Exp $ | |
1 | +# $Id: pluginutil.rb,v 1.10 2008-01-06 05:49:30 znz Exp $ | |
2 | 2 | # |
3 | 3 | # apply_plugin(str): |
4 | 4 | # Eval the string as a plugin. |
@@ -25,6 +25,7 @@ | ||
25 | 25 | set_conf(conf) |
26 | 26 | method, *args = methodwords(str) |
27 | 27 | begin |
28 | + method.untaint | |
28 | 29 | if plugin.respond_to?(method) && !Object.method_defined?(method) |
29 | 30 | if args |
30 | 31 | plugin.send(method, *args) |
@@ -1,4 +1,4 @@ | ||
1 | -# $Id: config.rb,v 1.125 2007-09-25 06:23:41 fdiary Exp $ | |
1 | +# $Id: config.rb,v 1.126 2008-01-06 05:49:30 znz Exp $ | |
2 | 2 | # Copyright (C) 2004-2005 Kazuhiko <kazuhiko@fdiary.net> |
3 | 3 | # |
4 | 4 | # TADA Tadashi <sho@spc.gr.jp> holds the copyright of Config class. |
@@ -33,6 +33,7 @@ | ||
33 | 33 | @repos = Hiki::const_get("Repos#{@repos_type.capitalize}").new(@repos_root, @data_path) |
34 | 34 | |
35 | 35 | instance_variables.each do |v| |
36 | + v = v.to_s | |
36 | 37 | v.sub!( /@/, '' ) |
37 | 38 | instance_eval( <<-SRC |
38 | 39 | def #{v} |
@@ -1,4 +1,4 @@ | ||
1 | -# $Id: hiki_formatter.rb,v 1.7 2005-09-30 11:53:15 fdiary Exp $ | |
1 | +# $Id: hiki_formatter.rb,v 1.8 2008-01-06 05:49:30 znz Exp $ | |
2 | 2 | # Copyright (C) 2003 TAKEUCHI Hitoshi <hitoshi@namaraii.com> |
3 | 3 | |
4 | 4 | module Hiki |
@@ -11,7 +11,7 @@ | ||
11 | 11 | title = '' |
12 | 12 | html = '' |
13 | 13 | |
14 | - orig_html.each do |line| | |
14 | + orig_html.each_line do |line| | |
15 | 15 | if H2_RE =~ line |
16 | 16 | html << tdiary_section(title, section) unless title.empty? && section.empty? |
17 | 17 | section = '' |
@@ -1,3 +1,8 @@ | ||
1 | +2008-01-06 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | |
2 | + * hiki/config.rb, hiki/hiki_formatter.rb, | |
3 | + misc/webrick/hikilet.rb, plugin/01sp.rb, hiki/pluginutil.rb, | |
4 | + style/default/html_formatter.rb: partially support ruby 1.9.0. | |
5 | + | |
1 | 6 | 2007-10-29 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> |
2 | 7 | * hiki/command.rb: revert partial patched |
3 | 8 | toc_lv. (see [Hiki-dev:01106], [Hiki-dev:01164]) |
@@ -1,5 +1,5 @@ | ||
1 | 1 | #!/usr/bin/ruby -Ke |
2 | -# $Id: hikilet.rb,v 1.11 2007-09-25 06:23:42 fdiary Exp $ | |
2 | +# $Id: hikilet.rb,v 1.12 2008-01-06 05:49:30 znz Exp $ | |
3 | 3 | # Copyright (C) 2005-2007 Kazuhiro NISHIYAMA |
4 | 4 | |
5 | 5 | require 'hiki/config' |
@@ -78,7 +78,11 @@ | ||
78 | 78 | saved_HTTP_ACCEPT_LANGUAGE = ENV['HTTP_ACCEPT_LANGUAGE'] |
79 | 79 | ENV['HTTP_ACCEPT_LANGUAGE'] = req['Accept-Language'] |
80 | 80 | conf = Hiki::Config::new |
81 | - ENV['HTTP_ACCEPT_LANGUAGE'] = saved_HTTP_ACCEPT_LANGUAGE | |
81 | + if saved_HTTP_ACCEPT_LANGUAGE | |
82 | + ENV['HTTP_ACCEPT_LANGUAGE'] = saved_HTTP_ACCEPT_LANGUAGE | |
83 | + else | |
84 | + ENV.delete('HTTP_ACCEPT_LANGUAGE') | |
85 | + end | |
82 | 86 | end |
83 | 87 | |
84 | 88 | cgi = DummyCGI::new(req, res) |
@@ -1,4 +1,4 @@ | ||
1 | -# 01sp.rb - select-plugins plugin $Revision: 1.4 $ | |
1 | +# 01sp.rb - select-plugins plugin $Revision: 1.5 $ | |
2 | 2 | |
3 | 3 | =begin ChangeLog |
4 | 4 | See ../ChangeLog for changes after this. |
@@ -34,7 +34,12 @@ | ||
34 | 34 | =end ChangeLog |
35 | 35 | |
36 | 36 | SP_PREFIX = 'sp' |
37 | -@sp_path = ( @conf["#{SP_PREFIX}.path"] || "#{PATH}/misc/plugin" ).to_a | |
37 | +@sp_path = ( @conf["#{SP_PREFIX}.path"] || "#{PATH}/misc/plugin" ) | |
38 | +if @sp_path.respond_to? :to_a | |
39 | + @sp_path = @sp_path.to_a | |
40 | +else | |
41 | + @sp_path = @sp_path.split(/\r?\n/) | |
42 | +end | |
38 | 43 | @sp_path = @sp_path.collect do |path| |
39 | 44 | /\/$/ =~ path ? path.chop : path |
40 | 45 | end |
@@ -1,4 +1,4 @@ | ||
1 | -# $Id: html_formatter.rb,v 1.61 2006-10-11 13:06:14 yanagita Exp $ | |
1 | +# $Id: html_formatter.rb,v 1.62 2008-01-06 05:49:30 znz Exp $ | |
2 | 2 | # Copyright (C) 2002-2003 TAKEUCHI Hitoshi <hitoshi@namaraii.com> |
3 | 3 | |
4 | 4 | require 'hiki/util' |
@@ -46,7 +46,7 @@ | ||
46 | 46 | num = -1 |
47 | 47 | level = 1 |
48 | 48 | to_s unless @html_converted |
49 | - @html_converted.each do |line| | |
49 | + @html_converted.each_line do |line| | |
50 | 50 | if HEADING_RE =~ line |
51 | 51 | new_level = $1.to_i - 1 |
52 | 52 | num += 1 |