aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/irb.rb
blob: 32a3bfc6d9bd98b81ec3bc09e105e6d32c4b88d6 (plain)
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
require 'formula'
require 'keg'
require 'irb'

class Symbol
  def f
    Formulary.factory(to_s)
  end
end
class String
  def f
    Formulary.factory(self)
  end
end

module Homebrew
  def irb
    if ARGV.include? "--help"
      puts "'v8'.f # => instance of the v8 formula"
      puts ":hub.f.installed?"
      puts ":lua.f.methods - 1.methods"
      puts ":mpd.f.recursive_dependencies.reject(&:installed?)"
    else
      ohai "Interactive Homebrew Shell"
      puts "Example commands available with: brew irb --help"
      IRB.start
    end
  end
end