Sha256: f5f25c47e827c48d3c95b784b4f04a8400388cee59eac4dc632da397a96d4d91
Contents?: true
Size: 851 Bytes
Versions: 9
Compression:
Stored size: 851 Bytes
Contents
require "jdc/cli/service/base" =begin module JDC::Service class Rename < Base desc "Rename a service" group :services, :manage input :service, :desc => "Service to rename", :argument => :optional, :from_given => by_name(:service_instance, :service) input :name, :desc => "New service name", :argument => :optional def rename_service service = input[:service] name = input[:name] service.name = name with_progress("Renaming to #{c(name, :name)}") do service.update! end end private def ask_service services = client.service_instances fail "No services." if services.empty? ask("Rename which service?", :choices => services.sort_by(&:name), :display => proc(&:name)) end def ask_name ask("New name") end end end =end
Version data entries
9 entries across 9 versions & 1 rubygems