Created
December 10, 2011 07:18
-
-
Save akishin/1454765 to your computer and use it in GitHub Desktop.
Windows用irbrc
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' rescue nil | |
require 'win32console' | |
require 'wirble' | |
require 'hirb' | |
# require 'hirb-unicode' | |
require 'pp' | |
require 'awesome_print' | |
# irb の設定 | |
IRB.conf[:SAVE_HISTORY] = 100000 | |
IRB.conf[:AUTO_INDENT] = true | |
# load wirble | |
Wirble.init | |
Wirble.colorize | |
# load hirb | |
Hirb.enable | |
# Rails Logger Setting | |
if ENV.include?('RAILS_ENV') | |
if !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
require 'logger' | |
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT)) | |
end | |
if ENV['RAILS_ENV'] == 'test' | |
require 'test/test_helper' | |
end | |
# for rails 3 | |
elsif defined?(Rails) && !Rails.env.nil? | |
if Rails.logger | |
Rails.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.logger = Rails.logger | |
end | |
if Rails.env == 'test' | |
require 'test/test_helper' | |
end | |
else | |
# nothing to do | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment