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
# To restart passenger with capistrano, use this: | |
namespace :deploy do | |
task :start, :roles => :app do | |
run "touch #{current_release}/tmp/restart.txt" | |
end | |
task :stop, :roles => :app do | |
# Do nothing. | |
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
#!/bin/bash | |
# path of MoinMoin shared files | |
SHARE=/usr/local/share/moin | |
# path to target instance location | |
INSTANCE=$1 | |
# should be nice | |
USER=nginx |
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
# Bundler Integration | |
# http://github.com/carlhuda/bundler/blob/master/lib/bundler/capistrano.rb | |
require 'bundler/capistrano' | |
# Application Settings | |
set :application, "youstack" | |
set :user, "deploy" | |
set :password, "FANCYpants" | |
set :deploy_to, "/home/#{user}/#{application}" | |
set :rails_env, "production" |
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
namespace :tail do | |
desc "Tail the Rails production log for this environment" | |
task :production_logs, :roles => :app do | |
run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data| | |
puts # for an extra line break before the host name | |
puts "#{channel[:server]} -> #{data}" | |
break if stream == :err | |
end | |
end | |
desc "Tail the Mongrel logs this environment" |
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
PLEASE NOTE: | |
Developer Mode is now a Rack middleware. | |
RPM Developer Mode is no longer available in Rails 2.1 and earlier. | |
However, starting in version 2.12 you can use Developer Mode in any | |
Rack based framework, in addition to Rails. To install developer mode | |
in a non-Rails application, just add NewRelic::Rack::DeveloperMode to | |
your middleware stack. |
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
Installing ri documentation for builder-2.1.2... | |
ERROR: While generating documentation for builder-2.1.2 | |
... MESSAGE: Unhandled special: Special: type=17, text="<!-- HI -->" | |
... RDOC args: --ri --op /Users/tbird/.rvm/gems/ruby-1.8.7-p334@rails31/doc/builder-2.1.2/ri --title Builder -- Easy XML Building --main README --line-numbers lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation --quiet |
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
[demo_app (master)]$ rake -T | |
WARNING: Global access to Rake DSL methods is deprecated. Please include | |
... Rake::DSL into classes and modules which use the Rake DSL methods. | |
WARNING: DSL method DemoApp::Application#task called at /Users/tbird/.rvm/gems/ruby-1.8.7-p334/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' | |
rake about # List versions of all Rails frameworks and the environment | |
rake db:create # Create the database from config/database.yml for the current Rail... | |
rake db:drop # Drops the database for the current Rails.env (use db:drop:all to ... | |
rake db:fixtures:load # Load fixtures into the current environment's database. | |
rake db:migrate # Migrate the database (options: VERSION=x, VERBOSE=false). | |
rake db:migrate:status # Display status of migrations |
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 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
puts "Give me a UPC code:" | |
upc = gets.chomp | |
url = "http://www.upcdatabase.com/item/" + upc | |
doc = Nokogiri::HTML(open(url)) |
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
rails plugin new my_engine --full --mountable | |
Engines Checklist | |
* Copy and namespace models, views, controllers, and helpers | |
* Copy routes | |
* Copy tests, add :use_route # so your test know which route to hit. | |
* Configure defaults | |
* Add dependencies to your gemspec | |
* Require your dependencies # because bundler doesn't boot strap them, etc. |
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
run "cd #{current_path} && bundle exec rake db:migrate" do |channel, stream, data| | |
puts # line break | |
puts "#{channel[:server]} -> #{data}" | |
break if stream == :err | |
end |