Internal Server Error

undefined method `to_a' for "# encoding: sjis\n#\n# Copyright (C) 2003-2005 Kouichirou Eto\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?('..')\n\nmodule Qwik\n class Action\n\t# From qwikWeb\n def plg_code(filename=nil, base_linenum=1)\n content = ''\n content = yield if block_given?\n pre = [:pre]\n content.each_with_index {|line, index|\n line.chomp!\n linenum = index + base_linenum.to_i\n klass = 'line '\n klass += if linenum % 2 == 0 then 'even' else 'odd' end\n style = \"background:url(.num/\#{linenum}.png) no-repeat;\"\n pre << [:span, {:class=>klass, :style=>style}, line]\n pre << \"\\n\"\n }\n return [:div, {:class=>'code'}, pre]\n end\n\n def act_num\n return c_nerror if ! $have_gd\n args = @req.path_args\n return c_nerror if args.nil? || args.empty?\n filename = args.first\n return c_nerror unless /\\A([0-9]+)\\.png\\z/ =~ filename\n str = $1\n return c_nerror if 10 < str.length\n files = @site.files('FrontPage')\n if ! files.exist?(filename)\n png = Action.generate_png(str)\n files.put(filename, png)\n end\n path = files.path(filename)\n return c_simple_send(path, 'image/png')\n end\n\n def self.generate_png(str)\n return nil if ! $have_gd\n font, fw, fh = GD::Font::TinyFont, 5, 8\n str = str.to_s\n width = fw * str.length\n height = fh\n img = GD::Image.new(width, height)\n white = img.colorAllocate(255, 255, 255)\n color = img.colorAllocate(127, 127, 127)\n img.transparent(white)\n img.string(font, 0, 0, str, color)\n return img.pngStr\n end\n # No comment version by Takeshi MUTOH\n def plg_code_nocomment(lang=nil)\n content = ''\n content = yield if block_given?\n\tp content\n pre = [:pre]\n # For igore comment\n content.each_with_index {|line, index|\n line.chomp!\n\tp line\n\tp index\n\tcs = line.sub!(/^#/,' hoge')\n\tp cs\n\tpre << line.sub!(/^#/,' hoge')\n\tpre << \"\\n\"\n }\n return [:div, {:class=>'code'},\n\t[pre]]\n end\n end\n\nif $0 == __FILE__\n require 'qwik/test-common'\n $test = true\nend\n\nif defined?($test) && $test\n class TestActCode < Test::Unit::TestCase\n include TestSession\n\n def test_code\n res = session\n ok_wi([:div, {:class=>'code'}, [:pre, \"t\\n\"]], \"{{code\\nt\\n}}\")\n end\n end\nend\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