Skip to content

Instantly share code, notes, and snippets.

@jsmecham
Last active July 16, 2018 19:50

Revisions

  1. jsmecham revised this gist Jul 16, 2018. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions .irbrc
    Original file line number Diff line number Diff line change
    @@ -3,14 +3,14 @@
    #

    # Support User Gems in Bundler-Managed Applications --------------------------

    if defined? ::Bundler
    user_gem_paths = Dir.glob("#{Gem.user_dir}/gems/*")
    user_gem_paths.each do |path|
    gem_path = "#{path}/lib"
    $LOAD_PATH << gem_path
    end
    end
    #
    # if defined? ::Bundler
    # user_gem_paths = Dir.glob("#{Gem.user_dir}/gems/*")
    # user_gem_paths.each do |path|
    # gem_path = "#{path}/lib"
    # $LOAD_PATH << gem_path
    # end
    # end

    # Save History ---------------------------------------------------------------

  2. jsmecham revised this gist Jan 31, 2014. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions .irbrc
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,16 @@
    # Justin's IRB Configuration
    #

    # Support User Gems in Bundler-Managed Applications --------------------------

    if defined? ::Bundler
    user_gem_paths = Dir.glob("#{Gem.user_dir}/gems/*")
    user_gem_paths.each do |path|
    gem_path = "#{path}/lib"
    $LOAD_PATH << gem_path
    end
    end

    # Save History ---------------------------------------------------------------

    require "irb/ext/save-history"
  3. jsmecham revised this gist Oct 24, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .irbrc
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    #
    # Justin's IRB Configuration
    #

    # Save History ---------------------------------------------------------------

  4. jsmecham revised this gist Oct 24, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion .irbrc
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,6 @@ end
    # Wirble ---------------------------------------------------------------------

    begin
    # load and initialize wirble
    require "wirble"
    Wirble.init
    Wirble.colorize
  5. jsmecham revised this gist Oct 24, 2013. 1 changed file with 27 additions and 16 deletions.
    43 changes: 27 additions & 16 deletions .irbrc
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@

    # Save History -------------------------------------------------------
    # Save History ---------------------------------------------------------------

    require "irb/ext/save-history"
    IRB.conf[:SAVE_HISTORY] = 200
    IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
    IRB.conf[:SAVE_HISTORY] = 1000
    IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irbhistory"

    # Awesome Print ------------------------------------------------------
    # Awesome Print --------------------------------------------------------------

    begin
    require "awesome_print"
    @@ -14,7 +14,7 @@ rescue LoadError => err
    warn "Couldn't load Awesome Print: #{err}"
    end

    # Wirble --------------------------------------------------------------
    # Wirble ---------------------------------------------------------------------

    begin
    # load and initialize wirble
    @@ -25,23 +25,34 @@ rescue LoadError => err
    warn "Couldn't load Wirble: #{err}"
    end

    # Bond ---------------------------------------------------------------
    # Bond -----------------------------------------------------------------------

    begin
    require "bond"
    Bond.start
    Bond.start readline: :ruby
    rescue LoadError => err
    warn "Couldn't load Bond: #{err}"
    end

    # Rails --------------------------------------------------------------
    # Interactive Editor ---------------------------------------------------------

    # Show log in Rails console
    if defined? Rails
    require 'logger'
    if Rails.version =~ /^2\./ # Rails 2.3
    Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
    else # Rails 3
    ActiveRecord::Base.logger = Logger.new(STDOUT) if defined? ActiveRecord
    begin
    require "interactive_editor"
    rescue LoadError => err
    warn "Couldn't load Interactive Editor: #{err}"
    end

    # Interesting Methods --------------------------------------------------------

    class Object
    def interesting_methods
    case self.class
    when Class
    self.public_methods.sort - Object.public_methods
    when Module
    self.public_methods.sort - Module.public_methods
    else
    self.public_methods.sort - Object.new.public_methods
    end
    end
    end
    end
  6. jsmecham revised this gist Oct 24, 2013. 1 changed file with 45 additions and 1 deletion.
    46 changes: 45 additions & 1 deletion .irbrc
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,47 @@
    require 'irb/ext/save-history'

    # Save History -------------------------------------------------------

    require "irb/ext/save-history"
    IRB.conf[:SAVE_HISTORY] = 200
    IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"

    # Awesome Print ------------------------------------------------------

    begin
    require "awesome_print"
    AwesomePrint.irb!
    rescue LoadError => err
    warn "Couldn't load Awesome Print: #{err}"
    end

    # Wirble --------------------------------------------------------------

    begin
    # load and initialize wirble
    require "wirble"
    Wirble.init
    Wirble.colorize
    rescue LoadError => err
    warn "Couldn't load Wirble: #{err}"
    end

    # Bond ---------------------------------------------------------------

    begin
    require "bond"
    Bond.start
    rescue LoadError => err
    warn "Couldn't load Bond: #{err}"
    end

    # Rails --------------------------------------------------------------

    # Show log in Rails console
    if defined? Rails
    require 'logger'
    if Rails.version =~ /^2\./ # Rails 2.3
    Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
    else # Rails 3
    ActiveRecord::Base.logger = Logger.new(STDOUT) if defined? ActiveRecord
    end
    end
  7. jsmecham created this gist Oct 16, 2013.
    3 changes: 3 additions & 0 deletions .irbrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    require 'irb/ext/save-history'
    IRB.conf[:SAVE_HISTORY] = 200
    IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"