Class: Plat4m::Sniffer::Darwin::MacPkgManager
Defined Under Namespace
Classes: Homebrew, MacPorts
Instance Method Summary
collapse
Methods inherited from PkgManager
#has_sudo?, #install, #select_available, #select_uninstalled, #uninstall
Constructor Details
Returns a new instance of MacPkgManager.
65
66
67
68
69
70
|
# File 'lib/plat4m/sniff/darwin.rb', line 65
def initialize
super
@has_sudo = system('command -v sudo > /dev/null')
@has_macports = system('command -v port>/dev/null')
@has_homebrew = system('command -v brew>/dev/null')
end
|
Instance Method Details
#available?(pkg) ⇒ Boolean
76
77
78
|
# File 'lib/plat4m/sniff/darwin.rb', line 76
def available?(pkg)
pkg_manager.available?(pkg)
end
|
#homebrew? ⇒ Boolean
92
93
94
|
# File 'lib/plat4m/sniff/darwin.rb', line 92
def homebrew?
Homebrew === pkg_manager
end
|
#installed?(pkg) ⇒ Boolean
72
73
74
|
# File 'lib/plat4m/sniff/darwin.rb', line 72
def installed?(pkg)
pkg_manager.installed?(pkg)
end
|
#macports? ⇒ Boolean
88
89
90
|
# File 'lib/plat4m/sniff/darwin.rb', line 88
def macports?
MacPorts === pkg_manager
end
|
#make_install_command(*pkgs) ⇒ Object
80
81
82
|
# File 'lib/plat4m/sniff/darwin.rb', line 80
def make_install_command(*pkgs)
pkg_manager.make_install_command(*pkgs)
end
|
#make_uninstall_command(*pkgs) ⇒ Object
84
85
86
|
# File 'lib/plat4m/sniff/darwin.rb', line 84
def make_uninstall_command(*pkgs)
pkg_manager.make_uninstall_command(*pkgs)
end
|