Sha256: 763c3baa9f30ee5e964d10eeef073a1221ba2e9eeff6de3d82857a2bf56cb318

Contents?: true

Size: 953 Bytes

Versions: 6

Compression:

Stored size: 953 Bytes

Contents

#!/usr/bin/env ruby

if ENV.key?('COLLINS_DEBUG') && ENV['COLLINS_DEBUG'] then
HTTP_DEBUG = true
end

# Make sure we're running a valid version of ruby
if RUBY_VERSION !~ /^1\.9\./ then
  puts("We require ruby 1.9.2")
  exit(1)
end

if not ENV.key?('HOME') || ENV['HOME'].empty? then
  puts("No HOME environment found. Exiting")
  exit(2)
end

$:.unshift File.join File.dirname(__FILE__), *%w[.. lib]
# Allows us to use a dev version of collins-client if needed
$:.unshift File.join File.dirname(__FILE__), *%w[.. .. ruby collins-client lib]
%w[collins_shell collins_shell/cli].each {|f| require f}

begin
  CollinsShell::Cli.start
rescue SystemExit => e
rescue CollinsShell::ConfigurationError => e
  cli = CollinsShell::Cli.new
  cli.say_status("fatal", "your environment is not setup correctly", :red)
  cli.say_status("message", "#{e.message}")
  exit(1)
rescue Exception => e
  cli = CollinsShell::Cli.new
  cli.print_error e
  exit(2)
end
exit(0)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
collins_shell-0.2.19 bin/collins-shell
collins_shell-0.2.18 bin/collins-shell
collins_shell-0.2.17 bin/collins-shell
collins_shell-0.2.16 bin/collins-shell
collins_shell-0.2.15 bin/collins-shell
collins_shell-0.2.14 bin/collins-shell