mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
30 lines
568 B
Ruby
30 lines
568 B
Ruby
require 'formula'
|
|
require 'keg'
|
|
require 'irb'
|
|
|
|
class Symbol
|
|
def f
|
|
Formula.factory(self.to_s)
|
|
end
|
|
end
|
|
class String
|
|
def f
|
|
Formula.factory(self)
|
|
end
|
|
end
|
|
|
|
module Homebrew extend self
|
|
def irb
|
|
if ARGV.include? "--help"
|
|
puts "'v8'.f # => instance of the Ack 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
|