public
Description: My config files (aka dotfiles)
Homepage:
Clone URL: git://github.com/jferris/config_files.git
config_files / irbrc
100644 30 lines (24 sloc) 0.652 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
# print SQL to STDOUT
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
  require 'logger'
  RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
 
# Autocomplete
require 'irb/completion'
 
# Prompt behavior
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
 
# History
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
 
# Easily print methods local to an object's class
class Object
  def local_methods
    (methods - Object.instance_methods).sort
  end
end
 
# copy a string to the clipboard
def pbcopy(string)
  `echo "#{string}" | pbcopy`
  string
end