Sha256: 9022d7dc80080f1ff138e55907b9bb9d1018c27493cc2601472f263417493afb

Contents?: true

Size: 1.73 KB

Versions: 2

Compression:

Stored size: 1.73 KB

Contents

#!/usr/bin/env ruby

# Set String encoding to Unicode
$KCODE = 'u'

APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
$:.unshift File.join(APP_ROOT,'lib') ;

# Require Merb, SproutCore & SproutCore/Merb support
require 'rubygems'
require 'rubigen'
gem('merb-core', '>= 0.9.1')
require 'merb-core'
require 'sproutcore'
require 'sproutcore/merb'

# Load BlueRibbon
#Dir.glob(File.join(APP_ROOT,'blueribbon','**','*.rb')).each { |x| require(x) }

############################################################
## Setup Default Options
##

begin
  require 'thin'
  server_kind = 'thin'
rescue LoadError
  server_kind = 'mongrel'
end

unless ARGV.index('-a') || ARGV.index('-i')
  ARGV.push *['-a', server_kind]
end

# Make BlueRibbon run on a different port by default
unless ARGV.index('-p')
  ARGV.push *%w[-p 4020]
end

unless ARGV.index('--merb-root')
  ARGV.push "--merb-root=#{SC.library.root_path}"
end

############################################################
## Configure Merb
##

Merb::Router.prepare { |r| r.connect_clients('/') }
Merb::Config.use { |c|
  c[:framework]           = {},
  c[:session_store]       = 'none',
  c[:exception_details]   = true,
  c[:reload_classes]      = false,
  c[:use_mutex]           = false,
  c[:log_auto_flush]      = true
}

############################################################
## Register Exception Handler
##

# required in 0.9.5-0.9.7, when defining an exception controller
class Application < Merb::Controller ; end

class Exceptions < Merb::Controller
  def base
    params[:exception].to_s
  end
end

############################################################
## Start Merb
##

puts "Running SproutCore Build Tools v#{SproutCore::VERSION::STRING}"
puts "Welcome to SproutCore"
Merb.start

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sproutcore-0.9.19 bin/sc-server
sproutcore-0.9.18 bin/sc-server