Class: Castaway::CLI::Script
- Inherits:
-
Object
- Object
- Castaway::CLI::Script
- Extended by:
- GLI::App
- Defined in:
- lib/castaway/cli/script.rb
Class Method Summary collapse
Class Method Details
.define(command) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/castaway/cli/script.rb', line 12 def self.define(command) command.action do |_globals, , 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 ⇒ Object
8 9 10 |
# File 'lib/castaway/cli/script.rb', line 8 def self.description 'Display the given program as a script' end |