Sha256: bd8415e9ea033f24af71fba9c13243b077b13f39b746861abf1fc1f326be3a89
Contents?: true
Size: 869 Bytes
Versions: 2
Compression:
Stored size: 869 Bytes
Contents
class Stylish::Server def self.start(options={}) require 'rack' require 'rack/server' require 'pry' Stylish.config.apply(:library_path => Pathname(options.library_path)) config = Stylish.lib_root.join 'stylish', 'api.ru' Rack::Server.start :config => config.to_s, :Port => options.port, :Host => options.host end end command "server" do |c| c.syntax = "stylish server [OPTIONS]" c.description = "start the stylish server" c.option '--port PORT', String, 'Which port to listen on?' c.option '--host HOSTNAME', String, 'Which host to listen on?' c.option '--library-path PATH', nil, 'Which library should we load?' c.action do |args, options| options.default(:port => 8090, :host => "0.0.0.0", :library_path => Dir.pwd) Stylish::Server.start(options) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stylish-0.3.1 | lib/stylish/cli/server.rb |
stylish-0.3.0 | lib/stylish/cli/server.rb |