Class: Powify::Utils
Constant Summary collapse
- AVAILABLE_METHODS =
%w(install reinstall uninstall remove help)
Constants included from Powify
Class Method Summary collapse
-
.install ⇒ Object
(also: reinstall)
Install powify.dev.
- .run(args = []) ⇒ Object
-
.uninstall ⇒ Object
(also: remove)
Uninstall powify.dev.
Methods included from Powify
config, current_path, extension
Class Method Details
.install ⇒ Object Also known as: reinstall
Install powify.dev
17 18 19 20 21 22 |
# File 'lib/powify/utils.rb', line 17 def install uninstall $stdout.puts "Cloning powify.dev from github and bundling powify.dev..." %x{git clone -q https://github.com/sethvargo/powify.dev.git powify && cd powify && bundle install --deployment && cd .. && mv powify "#{config['hostRoot']}"} $stdout.puts "Done!" end |
.run(args = []) ⇒ Object
10 11 12 13 14 |
# File 'lib/powify/utils.rb', line 10 def run(args = []) method = args[0].to_s.downcase raise "The command `#{args.first}` does not exist for `powify utils`!" unless Powify::Utils::AVAILABLE_METHODS.include?(method) self.send(method) end |
.uninstall ⇒ Object Also known as: remove
Uninstall powify.dev
26 27 28 29 |
# File 'lib/powify/utils.rb', line 26 def uninstall %x{rm -rf "#{config['hostRoot']}/powify"} $stdout.puts "Successfully removed powify.dev" end |