lib/whipped-cream/cli.rb in whipped-cream-0.0.1pre1 vs lib/whipped-cream/cli.rb in whipped-cream-0.0.1pre2
- old
+ new
@@ -23,16 +23,27 @@
plugin = Plugin.from_file(File.expand_path('../../../demo.rb', __FILE__))
server = Server.new(plugin)
server.start
end
+ desc "deploy PLUGIN IP", "Deploy a plugin to a Pi"
+ def deploy(plugin_name, pi_address)
+ plugin_path = resolve_plugin(plugin_name)
+
+ deployer = Deployer.new(plugin_path, pi_address)
+ deployer.deploy
+ end
+
desc "start PLUGIN", "Start a plugin"
+ method_option :daemonize,
+ type: :boolean,
+ desc: "Run the server in the background"
def start(plugin_name)
plugin_path = resolve_plugin(plugin_name)
plugin = Plugin.from_file(plugin_path)
server = Server.new(plugin)
- server.start
+ server.start(options)
end
no_tasks do
def resolve_plugin(name)
name # TODO: resolve name to filename