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
desc "Delete an user" | |
task :delete_user => :environment do | |
user_id = ENV['user_id'] | |
email = ENV['email'] | |
user = nil | |
if user_id | |
user = User.find(user_id) | |
elsif email | |
user = User.find_by_email(email) |
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
require 'monitor' | |
require 'set' | |
require 'active_support/core_ext/module/synchronization' | |
module ActiveRecord | |
# Raised when a connection could not be obtained within the connection | |
# acquisition timeout period. | |
class ConnectionTimeoutError < ConnectionNotEstablished | |
end |
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
source 'http://rubygems.org' | |
# Bundle edge Rails instead: | |
gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'mysql' | |
# Use unicorn as the web server | |
# gem 'unicorn' |
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 Foo | |
def hello | |
puts "Hello from Foo" | |
end | |
end | |
module Bar | |
def self.included(base_klass) | |
base_klass.class_eval do | |
alias_method :old_hello, :hello |
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
input | |
----- | |
emacs - records | |
vim - columns | |
wow | |
windowd and linux | |
windows - records | |
macs | |
output |
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 Tickle | |
extend self | |
def load_rails_environment(environment) | |
ENV["RAILS_ENV"] = environment | |
Object.const_set :RAILS_ENV, environment | |
require(File.join(RAILS_ROOT, 'config', 'environment')) | |
$: << "#{Rails.root}/test" | |
require "#{Rails.root}/test/test_helper" |
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
def prepare_analyzer() | |
saved_aggregate_data = rcov_load_aggregate_data($options.aggregate_file) | |
if(saved_aggregate_data[:coverage]) | |
$rcov_code_coverage_analyzer = saved_aggregate_data[:coverage] | |
end | |
$rcov_code_coverage_analyzer.install_hook | |
end |
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
#define EXIT_FAILURE 1 | |
static VALUE | |
rb_f_exit_bang(argc, argv, obj) | |
int argc; | |
VALUE *argv; | |
VALUE obj; | |
{ | |
VALUE status; | |
int istatus; |
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
From 865176c6fe90aa5262317a24fd7df15cc7685018 Mon Sep 17 00:00:00 2001 | |
From: Hemant Kumar <[email protected]> | |
Date: Sat, 3 Apr 2010 03:09:03 +0530 | |
Subject: [PATCH] fix the exit status code of exit! | |
--- | |
kernel/common/kernel.rb | 2 +- | |
kernel/common/process.rb | 2 +- | |
2 files changed, 2 insertions(+), 2 deletions(-) |
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
Read error: #<ObjectBoundsExceededError: fetch is more than available bytes> | |
kernel/common/io.rb:152:in `shift' | |
kernel/common/io.rb:1164:in `read_all' | |
kernel/common/io.rb:1130:in `read' | |
/home/crriadmin/rubinius/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:27:in `tail_log' | |
/home/crriadmin/rubinius/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:18:in `call' | |
/home/crriadmin/rubinius/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call' | |
/home/crriadmin/rubinius/gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call' | |
/home/crriadmin/rubinius/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process' | |
/home/crriadmin/rubinius/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client {}' |