Sha256: 58b9ab3e3addd2d9d32eebd40cccf7ffd14469b96b322447f90584b0e986eae0

Contents?: true

Size: 846 Bytes

Versions: 3

Compression:

Stored size: 846 Bytes

Contents

require "locomotive/builder/server"
$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../..'))

require 'locomotive/builder/version'
require 'locomotive/builder/exceptions'
require 'locomotive/mounter'

module Locomotive
  module Builder
    class StandaloneServer < Server
      
      def initialize(path)
        # setting the logger
        logfile = File.join(path, 'log', 'mounter.log')
        FileUtils.mkdir_p(File.dirname(logfile))

        Locomotive::Mounter.logger = ::Logger.new(logfile).tap do |log|
          log.level = Logger::DEBUG
        end

        # get the reader
        reader = Locomotive::Mounter::Reader::FileSystem.instance
        reader.run!(path: path)
        reader

        # run the rack app
        Bundler.require 'misc'
        
        super(reader, disable_listen: true)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
locomotivecms_builder-1.0.0.alpha3 lib/locomotive/builder/standalone_server.rb
locomotivecms_builder-1.0.0.alpha2 lib/locomotive/builder/standalone_server.rb
locomotivecms_builder-1.0.0.alpha1 lib/locomotive/builder/standalone_server.rb