Class: ClusterFsck::Commands::Create

Inherits:
Object
  • Object
show all
Includes:
ClusterFsckEnvArgumentParser
Defined in:
lib/clusterfsck/commands/create.rb

Instance Method Summary collapse

Methods included from ClusterFsckEnvArgumentParser

included, #set_cluster_fsck_env_and_key_from_args

Instance Method Details

#run_command(args, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
# File 'lib/clusterfsck/commands/create.rb', line 9

def run_command(args, options = {})
  raise ArgumentError, "must provide a project name" if args.empty?
  set_cluster_fsck_env_and_key_from_args(args)
  obj = s3_object(key)
  raise ConflictError, "#{key} already exists!" if obj.exists?
  obj.write('')
  Edit.new.run_command(args)
end