Skip to content

Instantly share code, notes, and snippets.

View techpeace's full-sized avatar

Matt Buck techpeace

View GitHub Profile
namespace :check do
desc "Check to make sure you haven't left any 'debugger' calls lying around."
task :debugger do
%w{app lib spec test}.each do |dir|
puts `ack debugger #{dir}`
puts `ack 'ruby-debug' #{dir}`
end
end
end
http://www.rightscale.com/lp/webinar/index.php?ls=Webinar&sd=Webinar_TestDev_Internal_062309&campaign=70170000000L5i2&campaign_status=Registered&utm_campaign=Webinar%3A%20How%20to%20Create%20Test%20%26%20Dev%20Environments%20on%20the%20Cloud&utm_content=mattbuck@capitalthought.com&utm_medium=Email&utm_source=VerticalResponse&utm_term=How%20to%20Create%20Secure%20Test%20and%20Development%20Environments%20on%20the%20Cloud
Feature: author manages posts

As an author

I want to be able to manage the posts on my blog

So that my audience can read my content


Background:

Given I am logged in as the following active author account:

| Name | Email address | Password | Phone number | Fax number |

| John | john@myvenue.com | pass | 555-555-1212 | 555-555-1213 |
 

desc "Alias for yarddoc task - rake yard is funnier"
task :yard do
Rake::Task['yardoc'].invoke
end
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH
@techpeace
techpeace / gist:180579
Created September 3, 2009 22:24 — forked from mtodd/gist:180398
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH
Quotes also give you more freedom/creativity with the terminal ID:
<h1>New product</h1>
Are you creating a new Product object in this action? Try this:
<%= @product.inspect %>
If nothing shows up, then you need a <pre>Product.new</pre> in this controller action.
<% form_for(@product) do |f| %>
<%= f.error_messages %>
# Method to assist in finding out what group a user is in
def in_group?(group_name)
self.user_groups.include?(UserGroup.find_by_name(group_name))
end
require 'aws/s3'
require 'erb'
namespace :heroku do
def latest_bundle_name(app)
%x{ heroku bundles #{app_option(app)}| cut -f 1 -d ' ' }.chomp
end
def app_option(app)
module Thin
# To be included in classes to allow some basic logging
# that can be silenced (<tt>Logging.silent=</tt>) or made
# more verbose.
# <tt>Logging.debug=</tt>: log all error backtrace and messages
# logged with +debug+.
# <tt>Logging.trace=</tt>: log all raw request and response and
# messages logged with +trace+.
module Logging
class << self