Skip to content
Browse files

Update .irbc file

  • Loading branch information...
1 parent 9a645fa commit 19adf09e8a462a4eb906ff37ba43633da8694a81 @edsinclair committed Jun 5, 2013
Showing with 24 additions and 56 deletions.
  1. +24 −56 .irbrc
View
80 .irbrc
@@ -1,56 +1,24 @@
-require 'rubygems'
-
-begin
- #nice history and color
- gem 'blackwinter-wirble' # blackwinter branch has history_uniq fixes
- require 'wirble'
- Wirble::History::DEFAULTS[:history_uniq] = 'reverse'
-
- Wirble.init
- Wirble.colorize
-rescue LoadError => e
-end
-
-
-#Show Rails output
-# quick-and-dirty possibility to redirect the logger-output to console
-# http://techspeak.plainlystated.com/2009/03/watching-your-logs-from-console.html
-# dynamic_logger_switcher.rb
-#
-# Created by Roman Heinrich on 2009-06-05.
-# Copyright 2009 DaWanda. All rights reserved.
-#
-
-def show_rails_log
- unless @log_buffer_size
- @log_file = Rails.logger.instance_variable_get("@log")
- @log_level = Rails.logger.level
- @log_buffer_size = Rails.logger.auto_flushing
- end
- Rails.logger.flush
- Rails.logger.instance_variable_set("@log", STDOUT)
- Rails.logger.level = Logger::DEBUG
- Rails.logger.auto_flushing = 1
- nil
-end
-
-def hide_rails_log
- if @log_buffer_size
- Rails.logger.instance_variable_set("@log", @log_file)
- Rails.logger.level = @log_level
- Rails.logger.auto_flushing = @log_buffer_size
- end
- nil
-end
-
-class Time
- def self.benchmark
- t = Time.now.to_f
- yield
- Time.now.to_f - t
- end
-end
-
-def sql(query)
- ActiveRecord::Base.connection.select_all(query)
-end
+require "rubygems" unless defined? Gem
+require "irb/ext/save-history"
+require "hirb"
+require "bond"
+require "fancy_irb"
+require "awesome_print"
+
+IRB.conf[:SAVE_HISTORY] = 100
+IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
+
+FancyIrb.start :colorize => {
+ :rocket_prompt => [:blue],
+ :result_prompt => [:blue],
+ :input_prompt => nil,
+ :irb_errors => [:red],
+ :stderr => [:red, :bright],
+ :stdout => [:white],
+ :input => nil,
+ :output => true,
+}
+
+Bond.start
+Hirb.enable
+AwesomePrint.irb!

0 comments on commit 19adf09

Please sign in to comment.
Something went wrong with that request. Please try again.