Class: Lunchy
- Inherits:
-
Object
- Object
- Lunchy
- Defined in:
- lib/masquito/installer.rb
Overview
Lunchy doesn’t have uninstall method and also installs all plists to LaunchAgents. We can send a PR on spare time.
Constant Summary collapse
- CONFIG =
{ :verbose => false, :write => nil }
Instance Method Summary collapse
Instance Method Details
#install(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/masquito/installer.rb', line 8 def install(params) raise ArgumentError, "install [file]" if params.empty? filename = params[0] %w(/Library/LaunchDaemons).each do |dir| if File.exist?(File.(dir)) FileUtils.cp filename, File.join(File.(dir), File.basename(filename)) return puts "#{filename} installed to #{dir}" end end end |
#uninstall(params) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/masquito/installer.rb', line 19 def uninstall(params) raise ArgumentError, "uninstall [file]" if params.empty? filename = params[0] %w(/Library/LaunchDaemons).each do |dir| if File.exist?(File.(dir)) FileUtils.rm_rf(File.join(File.(dir), File.basename(filename))) return puts "#{filename} removed from #{dir}" end end end |