This file contains 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
def foo | |
puts "bar" | |
end |
This file contains 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
def capture(*args, &block) | |
ret = "" | |
captured = send("capture_#{@_template}", *args) do | |
ret = block.call | |
end | |
if captured.blank? | |
ret | |
else | |
captured | |
end |
This file contains 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
#================== config/dependencies.rb | |
dependency "merb-action-args", "0.9.9" # Provides support for querystring arguments to be passed in to controller actions | |
dependency "merb-assets", "0.9.9" # Provides link_to, asset_path, auto_link, image_tag methods (and lots more) | |
dependency "merb-cache", "0.9.9" # Provides your application with caching functions | |
dependency "merb-helpers", "0.9.9" # Provides the form, date/time, and other helpers | |
dependency "merb-mailer", "0.9.9" # Integrates mail support via Merb Mailer | |
dependency "merb-slices", "0.9.9" # Provides a mechanism for letting plugins provide controllers, views, etc. to your app | |
dependency "merb-auth", "0.9.9" # An authentication slice (Merb's equivalent to Rails' restful authentication) | |
dependency "dm-core", "0.9.5" # The datamapper ORM |
This file contains 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
require 'merb-core' | |
require 'merb-haml' | |
END { | |
require 'rbench' | |
expando = Expando.new | |
raise "haml's not fair" unless expando.efficient_haml == expando.naive_haml | |
raise "erb's not fair" unless expando.efficient_erb == expando.naive_erb |
This file contains 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
# return an address in the adr microformat | |
def format_address address | |
expand_template(:haml, <<-END, :address => address) | |
.adr | |
.street-address= address.street_address | |
%span.locality= address.city | |
, | |
%span.region= address.state | |
%span.postal-code= address.zip | |
END |
This file contains 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
require 'merb-core' | |
require 'merb-haml' | |
END { | |
require 'rbench' | |
expando = Expando.new | |
raise "haml's not fair" unless expando.efficient_haml == expando.naive_haml | |
raise "erb's not fair" unless expando.efficient_erb == expando.naive_erb |
This file contains 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
# Prototype of a mechanism for efficient inline template compilation | |
# via call site caching. | |
require 'merb-core' | |
require 'merb-haml' | |
END { | |
require 'rbench' | |
expando = Expando.new | |
This file contains 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
<dl class="realius" style="display:none"> | |
<dt>content</dt> | |
<dd><a href="#">foo</a></dd> | |
<dt>user</dt> | |
<dd> | |
<dl> | |
<dt>id</dt> | |
<dd>123asdfa</dd> | |
This file contains 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
<dl class="realius" style="display:none"> | |
<dt>content</dt> | |
<dd><a href="#">foo</a></dd> | |
<dt>user</dt> | |
<dd>asdfkjdslkfjdslfkjsdlfjdsalfjsdalkfjdsaklfjdslf</dd> | |
<dt>listing</dt> | |
<dd> | |
<dl> |
This file contains 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
<a class="launch_realius" style="display: none" | |
listing_id="40366444" | |
street_address="123 foobar st." | |
lat="37.3" | |
lng="-121.9" | |
market="CLAMLS" | |
price="100000" | |
category="San Fran">Predict sales price</a> | |
<dl class="realius" style="display:none"> |
OlderNewer