class Gzr::Commands::Space::Rm
Public Class Methods
new(space,options)
click to toggle source
Calls superclass method
Gzr::Command::new
# File lib/gzr/commands/space/rm.rb, line 32 def initialize(space,options) super() @space = space @options = options end
Public Instance Methods
execute(input: $stdin, output: $stdout)
click to toggle source
# File lib/gzr/commands/space/rm.rb, line 38 def execute(input: $stdin, output: $stdout) with_session do space = query_space(@space) begin puts "Space #{@space} not found" return nil end unless space children = query_space_children(@space) unless (space.looks.length == 0 && space.dashboards.length == 0 && children.length == 0) || @options[:force] then raise Gzr::CLI::Error, "Space '#{space.name}' is not empty. Space cannot be deleted unless --force is specified" end delete_space(@space) end end