Class: Gamefic::Shell::Command::Play

Inherits:
Base
  • Object
show all
Includes:
Gamefic
Defined in:
lib/gamefic/shell/command/play.rb

Constant Summary

Constants included from Gamefic

DOWN, EAST, NORTH, NORTHEAST, NORTHWEST, Gamefic::SOUTH, Gamefic::SOUTHEAST, Gamefic::SOUTHWEST, UP, VERSION, WEST

Instance Method Summary collapse

Methods inherited from Base

#help, #options

Instance Method Details

#run(input) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/gamefic/shell/command/play.rb', line 10

def run input
  result = parse input
  file = result.arguments[1]
  raise "File not specified." if file.nil?
  raise "'#{file}' does not exist." if !File.exist?(file)
  raise "'#{file}' is a directory." if File.directory?(file)
  play file
end