Skip to content

Instantly share code, notes, and snippets.

View rishav's full-sized avatar

Rishav Rastogi rishav

View GitHub Profile
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
@rishav
rishav / omniauth.rb
Created November 15, 2010 15:21 — forked from madhums/omniauth.rb
require 'openid/store/filesystem'
ActionController::Dispatcher.middleware.use OmniAuth::Builder do
provider :twitter, 'key', 'secret'
provider :facebook, 'app_id', 'secret'
provider :linked_in, 'key', 'secret'
provider :open_id, OpenID::Store::Filesystem.new('/tmp')
end
# you will be able to access the above providers by the following url
# /auth/providername for example /auth/twitter /auth/facebook
# rubygems DNS is temporarily down, put this into your /etc/hosts to install gems,
# but don't forget to remove the entries once their DNS is back up again
72.4.120.124 rubygems.org
207.171.181.231 production.s3.rubygems.org
216.137.45.24 production.cf.rubygems.org
fast: through middleware inserted at 0
slwr: through middleware inserted via @use@
rotr: through endpoint sent via the router
bare: through ActionController::Metal with self.response_body
cntr: through ActionController::Base with self.response_body
text: through ActionController::Base with render :text
tmpl: through ActionController::Base with simple render :template
layt: through ActionController::Base with render :template with layout
Note: These tests are being run without ActiveRecord, which currently
Before("@culerity,@celerity,@javascript") do |scenario|
unless @env_rvm_jruby
@env_rvm_jruby = {}
require 'yaml'
rvm_info = YAML::load(`bash -l -c 'source ~/.rvm/scripts/rvm; rvm jruby ; rvm info'`)
rvm_info['environment'].each do |k, v|
@env_rvm_jruby[k] = v
end
@env_jruby_path = rvm_info['binaries']['ruby'].gsub(%r{^(.*)/ruby$}, '\1')
end

Ruby on Rails 3.0 Release Notes

Rails 3.0 is a landmark release as it delivers on the Merb/Rails merge promise made in December 2008. Rails 3.0 provides many major upgrades to all of the major components of Rails, including a major overhaul of the router and query APIs.

One of the major achievements of this release, is that while there are loads of new features, old APIs have been deprecated with warnings wherever possible, so that you can implement the new features and conventions at your own pace. There is a backwards compatibility layer that will be supported during 3.0.x and removed in 3.1.

Rails 3.0 adds Active Model ORM abstraction, Abstract Controller generic controller abstraction as well as a consistent Plugin API giving developers full access to all the Rails internals that make Action Mailer, Action Controller, Action View, Active Record and Active Resource work.

These release notes cover the major upgrades, but don’t include every little bug fix and change. If you want to see everything,

@rishav
rishav / license
Created January 27, 2010 11:50 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
year=`date "+%Y"`
cat <<EOF
Copyright (c) $year Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
@rishav
rishav / gist:267477
Created January 2, 2010 12:11 — forked from rkh/gist:267470
# Installing Rails 3.0.pre in it's own gemset using rvm.
# I use Rube Enterprise Edition for rails development.
# You might want to replace ree with Your Favorite Ruby Implementation(tm)
rvm use ree%rails3 # Create new gemset called rails3.
gem install rake test-spec thor sqlite3-ruby # Get some gems we'll need (rails3 gemset should be empty)
git clone git://github.com/rails/rails.git && cd rails # Get rails source.
git submodule init && git submodule update # Get git dependencies.
cd rack && rake gem && gem install rack-1.1.*.gem # Install rack 1.1
cd ../arel && thor :build && thor :install && cd ../.. # Install arel
@rishav
rishav / url_dsl.rb
Created December 27, 2009 16:17 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
@rishav
rishav / archfear.rb
Created May 24, 2009 19:21 — forked from archfear/archfear.rb
another Rails Temolate
# Template which configures a generic Rails app with Shoulda, Factory Girl,
# HAML, etc while commiting each step into git.
#
# Make sure you have Rails 2.3rc1 or greater installed and run:
# rails -d mysql -m http://gist.github.com/raw/57458/06345c42a92048e699af3140ccd28bbcd8915bc5/archfear.rb my_app
# Helper methods
def environment(data = nil, options = {}, &block)
options = { :sentinel => 'Rails::Initializer.run do |config|' }.merge(options)