Sha256: 26ef7248d4d3e783927d632833519669b2e3c090ab33c7c400bebbf40142ab3c

Contents?: true

Size: 941 Bytes

Versions: 8

Compression:

Stored size: 941 Bytes

Contents

#!/usr/bin/env ruby

# NOTE: If you would like to execute this file as a developer
#       but not install the CSD gem, you can use this command:
#       ruby -I path/to/csd/lib path/to/csd/bin/ai

# First, let's load the RubyGems framework and the CSD gem.
# Even though RubyGems is already loaded for Ruby >= 1.9,
# we want to go sure here and load it to provide robustness
require 'rubygems'
require 'csd'

begin
  # Running the CSD library and telling it who started it
  CSD.bootstrap :executable => 'ai'
rescue CSD::Error::CSDError => e
  # Here we catch CSD internal errors and exit with the propriate status code
  # We output the error message only for status codes 50 and higher, because they are rather severe
  CSD.ui.error e.message unless e.status_code <= 49
  exit e.status_code
rescue Interrupt
  # Lastly, close the AI gracefully on abnormal termination
  CSD.ui.separator
  CSD.ui.info "Quitting the AI...".red
  exit 1
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
csd-0.1.18 bin/ai
csd-0.1.17 bin/ai
csd-0.1.16 bin/ai
csd-0.1.15 bin/ai
csd-0.1.14 bin/ai
csd-0.1.13 bin/ai
csd-0.1.12 bin/ai
csd-0.1.11 bin/ai