Module: Chloe::Modules::Service
- Defined in:
- lib/chloe/modules/service.rb
Class Method Summary collapse
Class Method Details
.bootstrap(executable) ⇒ Object
4 5 6 |
# File 'lib/chloe/modules/service.rb', line 4 def self.bootstrap(executable) define(executable) end |
.define(executable) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/chloe/modules/service.rb', line 8 def self.define(executable) executable.class_eval do desc :service, 'Runs the service command on the given service' def service(provider, action) command = "vagrant ssh -c \"source ~/.bashrc && cd /vagrant && sudo /sbin/service #{provider} #{action}\"" Kernel.exec command end end end |