Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5c0d956e35
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 50 lines (40 sloc) 1.02 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
begin
  require 'irbtools/configure'
  Irbtools.libs -= ['irb_rocket']
  Irbtools.init
rescue LoadError

  def try_require module_name, &block
    begin
      require module_name
      yield unless block.nil?
    rescue LoadError
      $stderr.puts "Error: Unable to load \"#{module_name}\""
    end
  end
  try_require 'what_methods'
  try_require 'pp'

  # Load the readline module.
  IRB.conf[:USE_READLINE] = true

  # Remove the annoying irb(main):001:0 and replace with >>
  IRB.conf[:PROMPT_MODE] = :SIMPLE

  # Tab Completion
  require 'irb/completion'

  # Automatic Indentation
  IRB.conf[:AUTO_INDENT]=true

  # Save History between irb sessions
  try_require 'irb/ext/save-history'
  IRB.conf[:SAVE_HISTORY] = 100
  IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"

  try_require 'wirble' do
    Wirble.init
    Wirble.colorize
  end

  # Clear the screen
  def clear
    system 'clear'
    if ENV['RAILS_ENV']
      return "Rails environment: " + ENV['RAILS_ENV']
    end
  end
  alias c clear

end
Something went wrong with that request. Please try again.