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
### Rails 3 | |
$:.unshift File.join(File.dirname(__FILE__), 'rack-router/lib') | |
$:.unshift File.join(File.dirname(__FILE__), 'rack-mount/lib') | |
$:.unshift File.join(File.dirname(__FILE__), 'rails/activesupport/lib') | |
$:.unshift File.join(File.dirname(__FILE__), 'rails/actionpack/lib') | |
require 'active_support' | |
require 'action_view' | |
require 'action_view/base' |
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
### Rails Edge | |
$:.unshift File.join(File.dirname(__FILE__), 'rack-mount/lib') | |
$:.unshift File.join(File.dirname(__FILE__), 'rails/activesupport/lib') | |
$:.unshift File.join(File.dirname(__FILE__), 'rails/actionpack/lib') | |
require 'active_support' | |
require 'action_view' | |
require 'action_view/base' | |
require 'action_controller' | |
require 'action_controller/abstract' |
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
class User | |
include DataMapper::Resource | |
property :id, Serial | |
property :email, String, :format=> :email_address | |
property :email_confirmation, String, :format=> :email_address | |
validates_is_confirmed :email | |
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 File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
describe PostsController do | |
integrate_views | |
describe 'GET /index' do | |
before(:each) do | |
get :index |
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
#!/bin/sh | |
# Update Thor script, sources and gems. | |
bin/thor merb:tasks:update | |
bin/thor merb:source:refresh | |
bin/thor merb:edge --install | |
bin/thor merb:edge:plugins --install | |
bin/thor merb:edge:dm_core --install | |
bin/thor merb:edge:dm_more --install |
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
#!/bin/sh | |
# Create a bleeding edge Merb application with DataMapper. | |
curl -L http://merbivore.com/merb.thor > merb.thor | |
thor merb:tasks:setup | |
bin/thor merb:edge --install | |
bin/thor merb:edge:plugins --install | |
bin/thor merb:edge:dm_core --install | |
bin/thor merb:edge:dm_more --install | |
bin/thor merb:source:install dm-more/merb_datamapper |
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
# simple.red | |
Ruby.puts "Hello World!" |
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
// jquery.red.js | |
var domReady = function(handler) { jQuery(document).ready(handler); }; | |
var j = jQuery; |
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
class Cmd | |
attr_reader :output, :pid, :status | |
def initialize(cmd_line) | |
IO.popen(cmd_line) do |f| | |
@output = f.readlines | |
@pid, @status = Process.wait2 | |
end | |
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
# Hack for make_resourceful plugin. | |
module Resourceful | |
class Builder | |
module BuilderExtension | |
def set_flash(action, message) | |
after(action) { flash[:notice] = message } | |
end | |
end | |
include BuilderExtension |