Need to delete old cache files. (rm -rf ./tmp/*
)
and, change the syntax.
# before
module Foobar | |
class App < Padrino::Application | |
enable :sessions | |
configure :development do | |
use BetterErrors::Middleware | |
BetterErrors.application_root = PADRINO_ROOT | |
set :protect_from_csrf, except: %r{/__better_errors/\d+/\w+\z} | |
end | |
.... |
require 'MeCab' | |
require 'kconv' | |
class MecabParser | |
def initialize(param = nil) | |
@mecab = param ? MeCab::Tagger.new(param) : MeCab::Tagger.new | |
end | |
def parse(str) | |
@mecab.parse(str).split(/\n/).inject([]) do |data, line| |
module Sandbox | |
class App < Padrino::Application | |
register Padrino::Helpers | |
register Padrino::Cache | |
enable :caching | |
get :test, "/test/:test_id", :cache => true do |test_id| | |
cache_key test_id | |
test_id | |
end |
module Padrino | |
module Contrib | |
module RichBreadcrumb | |
attr_accessor :home, :items | |
DEFAULT_HOME_URL = "/" | |
DEFAULT_HOME_NAME = "Home" | |
ITEM_TYPE = "http://data-vocabulary.org/Breadcrumb" |
def list_app_routes_to_html(app, args) | |
app_routes = app.named_routes | |
app_routes.reject! { |r| r.identifier.to_s !~ /#{args.query}/ } if args.query.present? | |
app_routes.map! { |r| [r.verb, r.name, r.path] } | |
return if app_routes.empty? | |
app_routes.map! do |route| | |
"<tr>" + route.map{|elm| "<td>#{elm}</td>" }.join + "</tr>" | |
end | |
"<table>#{app_routes * "\n"}</table>" | |
end |
(function (global) { | |
if(typeof HTMLCollection === 'undefined') | |
HTMLCollection = function () {}; | |
var Enumerable = function (data) { | |
return (this instanceof Enumerable) ? this.init(data) : new Enumerable(data); | |
}; | |
Enumerable.prototype = { |
var Hoge; | |
(function (Hoge) { | |
var Fuga = (function () { | |
function Fuga(x) { | |
this.x = x; | |
} | |
Fuga.prototype.increment = function () { | |
return ++this.x; | |
}; | |
Fuga.prototype.decrement = function () { |
require 'rexml/document' | |
require 'erb' | |
class HatenaToOctopress | |
@@octo_format = <<-MKDN | |
--- | |
layout: post | |
title: <%= @item[:title] %> | |
date: <%= @item[:date] %> |