Internal Server Error

undefined method `to_a' for "# encoding: sjis\n#\n# Copyright (C) 2003-2005 Kouichirou Eto\n# Copyright (C) 2005 Moriyoshi Koizumi\n# All rights reserved.\n# This is free software with ABSOLUTELY NO WARRANTY.\n#\n# You can redistribute it and/or modify it under the terms of\n# the GNU General Public License version 2.\n#\n\n$LOAD_PATH << '..' unless $LOAD_PATH.include?('..')\nrequire 'qwik/act-text'\n\nmodule Qwik\n class Action\n D_graphviz = {\n :dt => 'Graphviz plugin',\n :dd => 'You can make a graph.',\n :dc => \"* Examples\n{{graphviz\ndigraph G {\n \\\"A\\\" -> B\n \\\"C\\\" -> D\n \\\"E\\\" -> F\n}\n}}\n{{{\n{{graphviz\ndigraph G {\n \\\"A\\\" -> B\n \\\"C\\\" -> D\n \\\"E\\\" -> F\n}\n}}\n}}}\n\n{{graphviz\ndigraph G {\n node [shape=doublecircle]; Master\n node [shape=circle];\n Master -> Slave_1\n Master -> Slave_2\n Master -> Slave_3\n Master -> Slave_4\n}}\n{{{\n{{graphviz\ndigraph G {\n node [shape=doublecircle]; Master\n node [shape=circle];\n Master -> Slave 1\n Master -> Slave 2\n Master -> Slave 3\n Master -> Slave 4\n}}\n}}}\n\n* Configurable paramters\nPlease specify these parameter in \\\"etc/config.txt\\\".\n\n| '''name'''\t\t| '''description'''\t\t| '''example'''\n| graphviz_dot_path\t| path to 'dot' command\t\t| /usr/bin/dot\n| graphviz_font_name\t| font name\t\t\t| IPAUIGothic\n| graphviz_font_size\t| font size\t\t\t| 10\n\n* Specifing fonts\nYou can see the font list of the server by this command.\n % fc-list\nThe font name is passed as -Nforname= option for dot command.\n\nIf you'd like to use Japanese font, please use 'Sazanami font', etc.\n # apt-get install ttf-sazanami-gothic\n\n* Links\n- http://www.graphviz.org/\n- http://voltex.jp/.test/qwik/1.html\n- http://www.voltex.jp/patches/qwik-graphviz-plugin-200512041629.patch.diff\n\n* BUGS\n- You can not specify drawing options.\n- You can only set two parameters (font name, font size).\n- You can not use imagemap for the graph.\n\n* Thanks\nThe Graphviz plugin is created by Mr. Moriyoshi Koizumi.\nThank you very much.\n\"\n }\n\n def plg_graphviz(str=nil)\n y = yield if block_given?\n str = y.chomp if y && y != ''\n\n if str.nil?\n\tstr = @site.site_url\n\tn = @site.sitename\n else\n\tstr = str.to_s\n\thash_str = str.dup\n \thash_str << @config.graphviz_font_name if @config.respond_to?('graphviz_font_name')\n\thash_str << @config.graphviz_font_size if @config.respond_to?('graphviz_font_size')\n\tn = hash_str.md5hex\n end\n\n f = 'graphviz-'+n+'.png'\n files = @site.files('FrontPage')\n if ! files.exist?(f)\n\tres = graphviz_generate(f, str)\n\treturn res if res\n end\n\n ar = [:img, {:src=>'.files/'+f, :alt=>str}]\n h = ar\n h = [:a, {:href=>str}, ar] if is_valid_url?(str)\n div = [:div, {:class=>'graphviz'}, h]\n return div\n end\n\n def graphviz_generate(f, str)\n return if @config.test && !(defined?($test_graphviz) && $test_graphviz)\n\n gv = @memory.graphviz\n\n #str = str.set_sjis_charset.to_utf8_charset\n str = str.sjistou8\n\n begin\n\tpng = gv.generate_png(str)\n\treturn [:div, {:class=>'graphviz'}, ''] if png.nil?\n rescue\n\treturn [:div, {:class=>'graphviz'}, '']\n end\n\n files = @site.files('FrontPage')\n files.put(f, png)\n\n return nil \n end\n end\n\n class Graphviz\n def initialize(bin_path)\n @bin_path = bin_path\n @cmdline = ''\n end\n\n def font_name=(val)\n @cmdline << ' -Nfontname=\"' << val.gsub(/\\$|\"|`|\\!/, '\\\\\\&') << '\"'\n end\n\n def font_size=(val)\n @cmdline << ' -Nfontsize=\"' << val.gsub(/\\$|\"|`|\\!/, '\\\\\\&') << '\"'\n end\n\n def generate_png(str)\n out=''\n p @cmdline\n IO.popen(@bin_path + ' -Tpng ' + @cmdline, 'r+') { |io|\n\tio.puts str\n\tio.close_write\n\tout = io.read\n }\n return out\n end\n end\n\n class GraphvizMemory\n def initialize(config, memory)\n @config = config\n @memory = memory\n @graphviz = Graphviz.new(@config.graphviz_dot_path)\n @graphviz.font_name = @config.graphviz_font_name if @config.respond_to?('graphviz_font_name')\n @graphviz.font_size = @config.graphviz_font_size if @config.respond_to?('graphviz_font_size')\n end\n\n def generate_png(d)\n begin \n\treturn @graphviz.generate_png(d)\n rescue\n\treturn ''\n end\n end\n end\nend\n\n\nif $0 == __FILE__\n require 'qwik/test-common'\n $debug = true\nend\n\nif defined?($debug) && $debug\n class TestActGraphviz < Test::Unit::TestCase\n include TestSession\n\n def test_all\n ok_wi([:div, {:class=>\"graphviz\"},\n [:img, {:src=>\".files/graphviz-3c7bc23c6e7fc2e92cb971e53a18a842.png\",\n :alt=>\"digraph G {\\n \\\"A\\\" -> B\\n}\"}]],\n\"{{graphviz\ndigraph G {\n \\\"A\\\" -> B\n}\n}}\")\n end\n end\nend\n":String ar = str.to_a[b, margin*2+1] ^^^^^ Did you mean? to_c to_f to_r to_i to_s
qwikWeb/0.8.1+20060201 at localhost:9190