Merge pull request #14885 from apainintheneck/irb-add-cask-monkey-patch
irb: add cask monkey patch
This commit is contained in:
commit
b08029edc9
@ -2,18 +2,27 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "formulary"
|
require "formulary"
|
||||||
|
require "cask/cask_loader"
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
|
|
||||||
class Symbol
|
|
||||||
def f(*args)
|
|
||||||
Formulary.factory(to_s, *args)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class String
|
class String
|
||||||
def f(*args)
|
def f(*args)
|
||||||
Formulary.factory(self, *args)
|
Formulary.factory(self, *args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def c(config: nil)
|
||||||
|
Cask::CaskLoader.load(self, config: config)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Symbol
|
||||||
|
def f(*args)
|
||||||
|
to_s.f(*args)
|
||||||
|
end
|
||||||
|
|
||||||
|
def c(config: nil)
|
||||||
|
to_s.c(config: config)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
@ -45,6 +54,9 @@ module Homebrew
|
|||||||
:hub.f.latest_version_installed?
|
:hub.f.latest_version_installed?
|
||||||
:lua.f.methods - 1.methods
|
:lua.f.methods - 1.methods
|
||||||
:mpd.f.recursive_dependencies.reject(&:installed?)
|
:mpd.f.recursive_dependencies.reject(&:installed?)
|
||||||
|
|
||||||
|
'vlc'.c # => instance of the vlc cask
|
||||||
|
:tsh.c.livecheckable?
|
||||||
EOS
|
EOS
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user