27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/ace/demo/cli/commands/create.rb', line 27
def call(name:, args: [], **options)
commands = collect_commands(args)
creator = Organisms::TapeCreator.new
result = creator.create(
name: name,
commands: commands,
description: options[:desc],
tags: options[:tags],
font_size: options[:font_size],
width: options[:width],
height: options[:height],
timeout: options[:timeout],
format: options[:format],
force: options[:force],
dry_run: options[:dry_run]
)
if result[:dry_run]
puts result[:content]
else
puts "Created: #{result[:path]}"
end
rescue TapeAlreadyExistsError => e
raise Ace::Support::Cli::Error, e.message
end
|