Sha256: 868b0b29cbddc246c1c6e88e482ffd3078ee6e6f16aae30a413ac5221000994d
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
module Workbench # Web-server class class Application attr_reader :app # Initialize class # # @param [String] path path to working directory def initialize path @app = Rack::Builder.new { use Rack::Reloader, 0 use Rack::CommonLogger use Rack::ShowExceptions use Rack::ContentLength Compass.configuration do |config| config.project_path = path config.http_path = '/' config.http_images_path = '/img' config.http_stylesheets_path = '/css' config.http_javascripts_path = '/js' config.sass_dir = 'sass' config.css_dir = 'public/css' config.images_dir = 'public/img' config.javascripts_dir = 'public/js' config.relative_assets = false config.output_style = :compact config.line_comments = false end Compass.configure_sass_plugin! use Sass::Plugin::Rack use Rack::StaticCache, :urls => [ '/css', '/js', '/img', '/favicon.ico' ], :root => './public', :versioning => false run Workbench::DynamicHandler.new path }.to_app end # Start Unicorn server # # @param port [Numeric] port number # @param workers [Number] workers count def start port, workers Unicorn::HttpServer.new(@app, { :listeners => [port], :worker_processes => workers, :preload_app => true }).start.join end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
work-bench-1.0.9 | lib/work_bench/application.rb |