DJZhou wzdf1982

View config.go
1 2 3 4 5 6 7 8 9 10
// Copyright 2013 Joe Walnes and the websocketd team.
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
 
package libwebsocketd
 
import (
"time"
)
View spec_helper.rb
1 2 3
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
View rspec-syntax-cheat-sheet.rb
1 2 3 4 5 6 7 8 9 10
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
 
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
View rails31init.md

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

View rails engine setup
1 2 3 4 5 6 7 8 9
generate
 
rails plugin new importable --dummy-path=spec/dummy --full --mountable -T
 
add to gemspec
 
s.add_dependency 'jquery-rails'
s.add_dependency 'sass-rails'
s.add_dependency 'bootstrap-sass', '~> 2.0.3'
View gist:2437803
1 2 3 4 5 6 7 8 9 10
# https://rvm.beginrescueend.com/integration/capistrano/
# sudo and scons must be installed even though i don't want to use sudo at all. And i don't change user.
# also for git clone to work i have to set up ssh key in .ssh
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'ruby-1.9.2@rails31' # Or whatever env you want it to run in.
set :rvm_type, :user # Copy the exact line. I really mean :user here
 
#http://blog.josephholsten.com/2010/09/deploying-with-bundler-and-capistrano/
require 'bundler/capistrano'
View gist:2437767

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

View Step_1.rb
1 2 3 4 5 6 7 8 9 10
# Step 1. Update your "Gemfile"
gem 'haml'
gem 'haml-rails', :group => :development
 
group :assets do
gem 'twitter-bootstrap-rails'
gem 'coffee-rails'
gem 'compass-rails'
gem 'jquery-rails'
gem 'sass-rails'
View README.md

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup

Something went wrong with that request. Please try again.