Sha256: f0e6b1633d4024695936104bcc5fc1c9db4e1c7139a14922eef6c0c293bd714f
Contents?: true
Size: 1.08 KB
Versions: 9
Compression:
Stored size: 1.08 KB
Contents
require "jdc/cli/organization/base" =begin module JDC::Organization class Create < Base desc "Create an organization" group :organizations input :name, :desc => "Organization name", :argument => :optional input :target, :desc => "Switch to the organization after creation", :alias => "-t", :default => true input :add_self, :desc => "Add yourself to the organization", :default => true input :find_if_exists, :desc => "Use an existing organization if one already exists with the given name", :default => false def create_org org = client.organization org.name = input[:name] org.users = [client.current_user] if input[:add_self] begin with_progress("Creating organization #{c(org.name, :name)}") { org.create! } rescue JFoundry::OrganizationNameTaken raise unless input[:find_if_exists] org = client.organization_by_name(input[:name]) end if input[:target] invoke :target, :organization => org end end private def ask_name ask("Name") end end end =end
Version data entries
9 entries across 9 versions & 1 rubygems