Hi everyone,
I just released the following Rails release candidates:
- 3.2.2.rc1
- 3.1.4.rc1
- 3.0.12.rc1
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
# We are not loading Active Record, nor the Assets Pipeline, etc. | |
# This could also be in your Gemfile. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
require "rails" |
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
# We are not loading Active Record, nor the Assets Pipeline, etc. | |
# This could also be in your Gemfile. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
require "rails" |
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
require "rails" | |
# Let's load only action controller. If you want | |
# to use active record, just require it as well. | |
require "action_controller/railtie" | |
class MyApp < Rails::Application |
module Core | |
def self.included(mod) | |
url = ENV['CORE_URL'] ? URI.parse(ENV['CORE_URL']) : URI.parse('postgres://postgres@localhost/heroku') | |
mod.establish_connection( | |
:adapter => "postgresql", | |
:host => url.host, | |
:username => url.userinfo.split(':')[0], | |
:password => url.userinfo.split(':')[1], | |
:database => url.path[1..-1] | |
) |
# for rails 3 or higher | |
module ActiveRecord | |
module Querying | |
delegate :random_order, :to => :scoped | |
end | |
module QueryMethods | |
def random_order | |
relation = clone |
int incomingByte = 0; | |
int ledPin = 13; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(ledPin, OUTPUT); | |
} | |
void loop() { | |
if (Serial.available() > 0) { |
c.f. bundle installするときはpathを指定しよう | FIRN.JP
プロジェクト用のディレクトリを作成して
[~] $ mkdir hogeproj
[~] $ cd hogeproj
Gemfileを編集
source 'https://rubygems.org' | |
gem 'rails', '3.2.1' | |
gem 'haml-rails' | |
gem 'rails-backbone' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
group :development, :test do |
#!/usr/bin/env ruby | |
# usage | |
# $ $(export_heroku_config.rb | grep OAUTH) | |
config = `heroku config` | |
config.split(/[\r\n]/).each do |line| | |
key, value = line.chomp.split(/\s+=>\s+/) | |
puts "export #{key}=#{value}" | |
end |