Sha256: a70fa7a76607c656cb7118b94637f9ab91643700aefa21bb0e6c8daf41800b64

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

# ===========================================================================
# Project:   Abbot - SproutCore Build Tools
# Copyright: ©2009 Apple, Inc.
#            portions copyright @2006-2009 Sprout Systems, Inc.
#            and contributors
# ===========================================================================

module SC
  
  class Tools
    
    desc "server", "Starts the development server"
    method_options  :daemonize => false,
                    :port      => :optional,
                    :host      => :optional,
                    :irb       => false
    def server
      prepare_mode!('debug') # set mode again, using debug as default
      
      SC.env.build_prefix   = options.buildroot if options.buildroot
      SC.env.staging_prefix = options.stageroot if options.stageroot
      
      # get project and start service.
      project = requires_project!
      
      # start shell if passed
      if options.irb
        require 'irb'
        require 'irb/completion'
        if File.exists? ".irbrc"
          ENV['IRBRC'] = ".irbrc"
        end
        
        SC.project = project
        SC.logger << "SproutCore v#{SC::VERSION} Interactive Shell\n"
        SC.logger << "SC.project = #{project.project_root}\n"
        ARGV.clear # do not pass onto IRB
        IRB.start
      else
        SC::Rack::Service.start(options.merge(:project => project))
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 lib/sproutcore/tools/server.rb
sproutit-sproutcore-1.0.0.20090408130025 lib/sproutcore/tools/server.rb
sproutit-sproutcore-1.0.0.20090416161445 lib/sproutcore/tools/server.rb