lib/shelly/cli/main.rb in shelly-0.4.41 vs lib/shelly/cli/main.rb in shelly-0.4.42
- old
+ new
@@ -287,17 +287,24 @@
say "Your public SSH key has been removed from Shelly Cloud" if user.ssh_keys.destroy
say "You have been successfully logged out" if user.logout
end
desc "rake TASK", "Run rake task"
- method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
+ method_option :cloud, :type => :string, :aliases => "-c",
+ :desc => "Specify cloud"
+ method_option :server, :type => :string, :aliases => "-s",
+ :desc => "Specify virtual server, it's random by default"
def rake(task = nil)
task = rake_args.join(" ")
app = multiple_clouds(options[:cloud], "rake #{task}")
- app.rake(task)
+ app.rake(task, options[:server])
rescue Client::ConflictException
say_error "Cloud #{app} is not running. Cannot run rake task."
+ rescue Client::NotFoundException => e
+ raise unless e.resource == :virtual_server
+ say_error "Virtual server '#{options[:server]}' not found or" \
+ " not configured for running rake task."
end
desc "dbconsole", "Run rails dbconsole"
method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
def dbconsole(task = nil)
@@ -391,10 +398,10 @@
skip_next = false
[].tap do |out|
args.each do |arg|
case arg
when "rake", "--debug"
- when "--cloud", "-c"
+ when "--cloud", "-c", "--server", "-s"
skip_next = true
else
out << arg unless skip_next
skip_next = false
end