Wham, Bam, Thank You Spam!
My ultra-secure commenting system has finally fallen foul of the malicious robots of spammers. They're probably terrorists, hijacking the precious interblah.net-page-rank fluids to build some kind of net-bomb. Unthinkable!
Anyway, this is good for me, because it forces me to develop some new stuff to counter the spam. And the first step is being able to delete snips. Here's my quick-n-dirty dynasnip for the moment:
delete
Usage: (no details)
[Error rendering 'code' - "can't convert nil into String"] /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:46:in `initialize' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:46:in `new' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:46:in `start' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/common.rb:76:in `tokenize' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/syntax-1.0.0/lib/syntax/convertors/html.rb:16:in `convert' ./lib/code_highlighter.rb:6:in `handle' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/ruby.rb:33:in `process_text' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:76:in `render_without_including_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:65:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:62:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:70:in `rendering' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:61:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:47:in `include_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:35:in `gsub' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:35:in `include_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:66:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:62:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:70:in `rendering' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:61:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:47:in `include_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:35:in `gsub' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:35:in `include_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:66:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:62:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:70:in `rendering' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:61:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/dynasnips/current_snip.rb:25:in `handle' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/ruby.rb:33:in `process_text' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:76:in `render_without_including_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:65:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:62:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:70:in `rendering' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:61:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:47:in `include_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:35:in `gsub' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:35:in `include_snips' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/renderers/base.rb:66:in `render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:47:in `formatted_render' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/app.rb:32:in `call' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/vanilla-1.9.17/lib/vanilla/static.rb:18:in `call' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/session/cookie.rb:37:in `call' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/application_spawner.rb:114:in `run' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/application_spawner.rb:65:in `spawn_application' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/utils.rb:184:in `safe_fork' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/application_spawner.rb:58:in `spawn_application' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/rack/application_spawner.rb:41:in `spawn_application' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:159:in `spawn_application' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in `__send__' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in `main_loop' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.9/bin/passenger-spawn-server:61
(If the dynasnip only contains a class name, it's probably loaded from the Vanilla application directly. This is typical of the basic dynasnips like link_to, etc)
I've also added the link to the template, but this in turn raises some interesting, unanswered questions about how to take Vanilla.rb from an interesting toy into a proper web platform.