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
puts "Setting up Devise" | |
# Install devise | |
run "rails generate devise_install" | |
gsub_file "config/initializers/devise.rb", "require 'devise/orm/active_record'", "require 'devise/orm/mongoid'" | |
# Install mongoid | |
# Disable activerecord framework |
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 = ActionController::Base.instance_method(:render) | |
=> #<UnboundMethod: ActionController::Base#render> | |
>> b = ActionController::Base.instance_method(:render_with_amf) | |
=> #<UnboundMethod: ActionController::Base#render_with_amf> | |
>> a == b | |
=> true |
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
alias_method :orig_render, :render | |
def render(*args, &block) | |
p args.inspect | |
orig_render(args.first, opt, block) | |
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
class SimpleFactoryBuilder | |
def self.build_factories( klass, field_for_factory_name, *excluded ) | |
attributes = klass.new.attributes | |
excluded.each { |e| attributes.symbolize_keys!.delete(e.to_sym) } | |
klass.all.each do |row| | |
attributes_string = "" | |
attributes.each_key do |key| | |
attributes_string << factory_attribute_row(row, key) | |
end | |
factory = <<-STRING |
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
From 930c2177ffa6b560c7718974f52be2b20f149dcb Mon Sep 17 00:00:00 2001 | |
From: =?utf-8?q?S=C5=82awosz=20S=C5=82awi=C5=84ski?= <slawosz@slawosz-laptop.(none)> | |
Date: Wed, 9 Jun 2010 15:42:47 +0200 | |
Subject: [PATCH] render signature compatible with rails | |
--- | |
vendor/plugins/rubyamf/util/action_controller.rb | 6 +++--- | |
1 files changed, 3 insertions(+), 3 deletions(-) | |
diff --git a/vendor/plugins/rubyamf/util/action_controller.rb b/vendor/plugins/rubyamf/util/action_controller.rb |
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 'rubygems' | |
if RUBY_VERSION >= '1.9' | |
require 'time' | |
require 'date' | |
require 'active_support/time' | |
else | |
require 'active_support' | |
require 'active_support/core_ext' | |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# don't overwrite GNU Midnight Commander's setting of `ignorespace'. | |
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups |
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
== Installation | |
require 'dir_dsl' | |
== Usage | |
Directory 'foo' in current directory, with subdirectory 'bar' and file 'baz' | |
Dir 'foo' do | |
dir 'bar' |
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
module Foo | |
def foo | |
begin | |
super | |
p 'foo!' | |
rescue | |
p 'foo' | |
end | |
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
# people write such a code | |
class Person | |
def say(word) | |
puts word | |
end | |
end | |
class Person | |
alias_method :old_say, :say |