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
# Put this file in config/initializers/irb.rb | |
# Works in Rails 3.0+, should also work in 2.3 | |
# Override the IRB, to provide the Rails environment in the prompt | |
module IRB | |
class << self | |
def setup_with_prompt_override(ap_path) | |
setup_without_prompt_override(ap_path) | |
env = (Rails.env.to_sym == :production ? "\033[00;31mPRODUCTION\033[00m" : Rails.env) |
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
#!/usr/bin/ruby | |
# gem install things-client --source http://gemcutter.org | |
# gem install broadcast | |
require 'rubygems' | |
require 'things' | |
require 'broadcast' | |
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
# You can use this class in your console. For example | |
# p = ProfilingTools.new | |
# p.profiled_request(:controller => :welcome, :action => :index) | |
# this will profile whole application stack and save file in your tmp/profiler folder | |
# You can also use +request+ method just to see the output for example: | |
# | |
# p.request(:controller => :offers, :action => :index) | |
# | |
# p.response.body | |
# p.response.cookies # and so on |