bin/screw_server in screw_server-0.1.8 vs bin/screw_server in screw_server-0.1.9
- old
+ new
@@ -13,17 +13,25 @@
require "rubygems"
gem "bundler", SCREW_SERVER_BUNDLER_VERSION
require "bundler"
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile.run", __FILE__)
Bundler.require
+require 'yaml'
options = {
:port => 3210,
:spec_base_dir => "spec/javascripts",
:code_base_dir => "public"
}
+begin
+ YAML.load_file('.screw_server.yml').each do |key, value|
+ options[key.to_sym] = value
+ end
+rescue Errno::ENOENT
+end
+
OptionParser.new do |opt|
opt.on('--port -p ', Integer, 'port to start screw_server on (default is 3210)') do |port|
options[:port] = port
end
opt.on(
@@ -37,9 +45,12 @@
"directory that contains the javascript code (default is ./#{options[:code_base_dir]})"
) do |code_base_dir|
options[:code_base_dir] = code_base_dir
end
end.parse!
+
+puts "Starting Screw Server on port #{options[:port]} " +
+ "with spec_base_dir '#{options[:spec_base_dir]}' and code_base_dir '#{options[:code_base_dir]}'"
ScrewServer::Base.spec_base_dir = File.expand_path(options[:spec_base_dir])
ScrewServer::Base.code_base_dir = File.expand_path(options[:code_base_dir])
ScrewServer::App.run!(:host => 'localhost', :port => options[:port], :environment => "production")