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
class GemHelper # :nodoc: | |
include Singleton | |
attr_accessor :project | |
attr_accessor :package | |
attr_accessor :gem_name | |
attr_accessor :version | |
def initialize | |
self.project = "magrathea" |
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
class WelcomeEmail | |
include Mack::Mailer | |
end | |
mail = WelcomeEmail.new | |
mail.to = "[email protected]" | |
mail.from = "[email protected]" | |
mail.subject = "Hello" | |
mail.body(:plain) = "This is my plain text body" | |
mail.body(:html) = "This is my <b>HTML</b> body" |
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
<script> | |
var helium = Array.new; | |
</script> | |
<div id=debate_1> | |
<script> | |
helium[0] = "debate_1" | |
</script> | |
</div> | |
... | |
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
<% | |
@simple = "hi" | |
@user = User.new(:username => "markbates", :level => 1) | |
@default_file = "~/resume.doc" | |
-%> | |
check_box | |
<%= :simple.check_box %> | |
<input type="checkbox" name="simple" id="simple" checked="checked"> | |
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
module Mack | |
module Rendering # :nodoc: | |
module Engine # :nodoc: | |
class Pdf < Mack::Rendering::Engine::Base | |
def render(io, binding) | |
if io.is_a?(File) | |
io = io.read | |
end | |
@_pdf = ::PDF::Writer.new |
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
pdf.select_font "Times-Roman" | |
pdf.fill_color(Color::RGB::Red) | |
pdf.text @post.title, :font_size => 24, :justification => :center | |
pdf.fill_color(Color::RGB::Black) | |
pdf.text "by #{@post.email}", :font_size => 12, :justification => :center | |
pdf.with_options(:font_size => 10, :justification => :left) do |p| | |
p.text "nn" | |
p.text @post.body | |
p.text "nn" | |
p.text "Created at: #{@post.created_at}" |
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
cachetastic_default_options: | |
# this will dump into the log, configuration info for each cache, as well as the .inspect | |
# for each object returned from the cache | |
debug: true # true | false (default: false) | |
# this is the type of file store to be used for this cache. | |
# more adapters can be developed and plugged in as desired | |
adapter: local_memory # local_memory | memcache | file | drb | html_file (default: local_memory) | |
# this will marshall objects into and out of the store. | |
marshall_method: none # none | yaml | ruby (default: none) | |
# this sets how long objects will live in the cache before they are auto expired. |
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
module Mack # :nodoc: | |
module Routes # :nodoc: | |
module Urls | |
# Retrieves a distributed route from a DRb server. | |
# | |
# Example: | |
# droute_url(:app_1, :home_page_url) | |
# droute_url(:registration_app, :signup_url, {:from => :google}) | |
def droute_url(app_name, route_name, options = {}) |
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
class Passport | |
include DataMapper::Resource | |
storage_names[:hls] = "tbl_pssptz" | |
property :id, Integer, :key => true | |
property :country_code, String, :nullable => false | |
property :expiration_date, Date, :nullable => false | |
repository(:hls) do |
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
class UsersController | |
include Mack::Controller | |
def show | |
@user = User.get(params[:id]) | |
wants(:xml) do | |
render(:text, @user.to_xml) | |
end | |
wants(:html) do | |
# do some more work to set up the view... |
OlderNewer