• R/O
  • SSH
  • HTTPS

hiki: Commit


Commit MetaInfo

Revisão905 (tree)
Hora2008-01-06 14:49:30
Autorznz

Mensagem de Log

  • hiki/config.rb, hiki/hiki_formatter.rb,
    misc/webrick/hikilet.rb, plugin/01sp.rb, hiki/pluginutil.rb,
    style/default/html_formatter.rb: partially support ruby 1.9.0.

Mudança Sumário

Diff

--- hiki/trunk/hiki/pluginutil.rb (revision 904)
+++ hiki/trunk/hiki/pluginutil.rb (revision 905)
@@ -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 $
22 #
33 # apply_plugin(str):
44 # Eval the string as a plugin.
@@ -25,6 +25,7 @@
2525 set_conf(conf)
2626 method, *args = methodwords(str)
2727 begin
28+ method.untaint
2829 if plugin.respond_to?(method) && !Object.method_defined?(method)
2930 if args
3031 plugin.send(method, *args)
--- hiki/trunk/hiki/config.rb (revision 904)
+++ hiki/trunk/hiki/config.rb (revision 905)
@@ -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 $
22 # Copyright (C) 2004-2005 Kazuhiko <kazuhiko@fdiary.net>
33 #
44 # TADA Tadashi <sho@spc.gr.jp> holds the copyright of Config class.
@@ -33,6 +33,7 @@
3333 @repos = Hiki::const_get("Repos#{@repos_type.capitalize}").new(@repos_root, @data_path)
3434
3535 instance_variables.each do |v|
36+ v = v.to_s
3637 v.sub!( /@/, '' )
3738 instance_eval( <<-SRC
3839 def #{v}
--- hiki/trunk/hiki/hiki_formatter.rb (revision 904)
+++ hiki/trunk/hiki/hiki_formatter.rb (revision 905)
@@ -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 $
22 # Copyright (C) 2003 TAKEUCHI Hitoshi <hitoshi@namaraii.com>
33
44 module Hiki
@@ -11,7 +11,7 @@
1111 title = ''
1212 html = ''
1313
14- orig_html.each do |line|
14+ orig_html.each_line do |line|
1515 if H2_RE =~ line
1616 html << tdiary_section(title, section) unless title.empty? && section.empty?
1717 section = ''
--- hiki/trunk/ChangeLog (revision 904)
+++ hiki/trunk/ChangeLog (revision 905)
@@ -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+
16 2007-10-29 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
27 * hiki/command.rb: revert partial patched
38 toc_lv. (see [Hiki-dev:01106], [Hiki-dev:01164])
--- hiki/trunk/misc/webrick/hikilet.rb (revision 904)
+++ hiki/trunk/misc/webrick/hikilet.rb (revision 905)
@@ -1,5 +1,5 @@
11 #!/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 $
33 # Copyright (C) 2005-2007 Kazuhiro NISHIYAMA
44
55 require 'hiki/config'
@@ -78,7 +78,11 @@
7878 saved_HTTP_ACCEPT_LANGUAGE = ENV['HTTP_ACCEPT_LANGUAGE']
7979 ENV['HTTP_ACCEPT_LANGUAGE'] = req['Accept-Language']
8080 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
8286 end
8387
8488 cgi = DummyCGI::new(req, res)
--- hiki/trunk/plugin/01sp.rb (revision 904)
+++ hiki/trunk/plugin/01sp.rb (revision 905)
@@ -1,4 +1,4 @@
1-# 01sp.rb - select-plugins plugin $Revision: 1.4 $
1+# 01sp.rb - select-plugins plugin $Revision: 1.5 $
22
33 =begin ChangeLog
44 See ../ChangeLog for changes after this.
@@ -34,7 +34,12 @@
3434 =end ChangeLog
3535
3636 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
3843 @sp_path = @sp_path.collect do |path|
3944 /\/$/ =~ path ? path.chop : path
4045 end
--- hiki/trunk/style/default/html_formatter.rb (revision 904)
+++ hiki/trunk/style/default/html_formatter.rb (revision 905)
@@ -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 $
22 # Copyright (C) 2002-2003 TAKEUCHI Hitoshi <hitoshi@namaraii.com>
33
44 require 'hiki/util'
@@ -46,7 +46,7 @@
4646 num = -1
4747 level = 1
4848 to_s unless @html_converted
49- @html_converted.each do |line|
49+ @html_converted.each_line do |line|
5050 if HEADING_RE =~ line
5151 new_level = $1.to_i - 1
5252 num += 1
Show on old repository browser