This file contains 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 :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 |
This file contains 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
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 |
This file contains 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
desc "Alias for yarddoc task - rake yard is funnier" | |
task :yard do | |
Rake::Task['yardoc'].invoke | |
end |
This file contains 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
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 |
This file contains 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
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: |
This file contains 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
<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 %> |
This file contains 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
# 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 |
This file contains 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 '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) |
This file contains 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
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 |
OlderNewer