Skip to content

Instantly share code, notes, and snippets.

@akishin
Created December 10, 2011 07:18
Show Gist options
  • Save akishin/1454765 to your computer and use it in GitHub Desktop.
Save akishin/1454765 to your computer and use it in GitHub Desktop.
Windows用irbrc
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