Class: Stamina::Command::Run

Inherits:
Object
  • Object
show all
Includes:
Robustness
Defined in:
lib/stamina-core/stamina/command/run.rb

Overview

Run a file with the Stamina Engine

SYNOPSIS

stamina #{command_name} FILE

OPTIONS #summarized_options

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Robustness

#assert_readable_file, #assert_writable_file

Instance Attribute Details

#imagesObject

Returns the value of attribute images.



16
17
18
# File 'lib/stamina-core/stamina/command/run.rb', line 16

def images
  @images
end

#outputObject

Returns the value of attribute output.



15
16
17
# File 'lib/stamina-core/stamina/command/run.rb', line 15

def output
  @output
end

Instance Method Details

#execute(args) ⇒ Object

Command execution

Raises:

  • (Quickl::Help)


45
46
47
48
49
50
51
# File 'lib/stamina-core/stamina/command/run.rb', line 45

def execute(args)
  raise Quickl::Help unless args.size == 1
  assert_readable_file(file = args.first)
  context = Stamina::Engine.execute(File.read(file), file)
  do_output(context, File.dirname(file))
  context
end