class Castaway::CLI::Script

Public Class Methods

define(command) click to toggle source
# File lib/castaway/cli/script.rb, line 12
def self.define(command)
  command.action do |_globals, _options, args|
    exit_now!('you have to supply a castaway program') if args.empty?

    production = Castaway::Production.from_script(args.first)

    production.new.scenes.each.with_index do |scene, idx|
      mark = scene.start || "##{idx}"
      puts "[#{mark}] #{scene.title}"
      puts scene.script if scene.script
      puts
    end
  end
end
description() click to toggle source
# File lib/castaway/cli/script.rb, line 8
def self.description
  'Display the given program as a script'
end