Sha256: 518a3c1037e8dbb81e1bb74d8a450e635b5320262d81b0c6192e53eb9c1aea6c

Contents?: true

Size: 1006 Bytes

Versions: 1

Compression:

Stored size: 1006 Bytes

Contents

#!/usr/bin/env ruby

require 'spinebox'

Spinebox::Command.dispatch do
  
  # Version
  on "--version, -v", "Show the version", :if => proc { ['--version', '-v'].include?(ARGV.first) } do
    puts "Spinebox #{Spinebox::VERSION}"
    exit(0)
  end
  
  # Help
  on "--help, -h", "Show this help", :if => proc { ['--help', '-h'].include?(ARGV.first) or ARGV.empty? } do
    puts Spinebox::Command.help
    exit(0)
  end
  
  # New application
  on "new APP", "Create a new APP", :if => proc { ['new', 'n'].include?(ARGV.first) } do
    ARGV.shift
    Spinebox::Generator.new(ARGV.first)
    exit(0)
  end
  
  # Compile
  on "compile, precompile", "Compile files to the public dir", :if => proc { ['compile', 'precompile'].include?(ARGV.first) } do
    Spinebox.boot!
    Spinebox::Compiler.compile
    exit(0)
  end
  
  # Run server
  on "s, server", "Run the development server", :if => proc { ['server', 's'].include?(ARGV.first) } do
    Rack::Handler::Thin.run(Spinebox.app, :Port => 3000)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spinebox-0.0.3 bin/spinebox