This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## enhance form_for(), fields_for(), and fieldset_for() to support :index_by option. | |
## see: | |
## http://merb.lighthouseapp.com/projects/7435/tickets/10 | |
## | |
## this patch is based on merb-helpers 1.0.0. | |
## | |
require 'merb-helpers' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## parse template with recognizing '#endfor', '#endif', and so on. | |
## | |
## ex: | |
## import tenjin | |
## from tenjin.helpers import * | |
## from my_template import MyTemplate | |
## engine = tenjin.Engine(templateclass=MyTemplate) | |
## print("------------- script") | |
## print(engine.get_template("file.pyhtml").script) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
module SelectTagHelper | |
## | |
## Generate <select> tag. Both <option> and <opttags> are supported. | |
## | |
## ex. | |
## <% values = {'H'=>'Haruhi', 'M'=>'Mikuru', 'Y'=>'Yuki'} %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
## | |
## requires Benchmarker 3.0 | |
## http://pypi.python.org/pypi/Benchmarker/ | |
## | |
from __future__ import with_statement | |
from benchmarker import Benchmarker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
## | |
## requires Benchmarker 3.0 | |
## http://pypi.python.org/pypi/Benchmarker/ | |
## | |
from __future__ import with_statement | |
from benchmarker import Benchmarker, cmdopt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### benchmark to measure library loading times. | |
### | |
require 'rubygems' | |
require 'benchmarker' | |
targets = %w[cgi cgi/session erb tempfile tmpdir openssl | |
logger pathname pstore time date2 uri drb fileutils | |
rss rexml/document yaml psych rubygems] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### benchmark to measure cgi program | |
### | |
require 'rubygems' | |
require 'benchmarker' | |
def cgi_file(file_name, content) | |
File.open(file_name, 'wb') do |f| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### benchmark to measure both h() and escape_html() | |
### | |
require 'rubygems' | |
require 'benchmarker' | |
ESCAPE_ = { | |
'&' => '&', | |
'<' => '<', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
### | |
### benchmark to measure CGI::parse() | |
### | |
require 'rubygems' | |
require 'benchmarker' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### benchmark to measure parsing both 'user[123][name]' and 'user.123.name' | |
### | |
require 'rubygems' | |
require 'benchmarker' | |
## copied from rack/utils.rb |
OlderNewer