lib/jackhammer/cli.rb in jackhammer-0.1.0 vs lib/jackhammer/cli.rb in jackhammer-0.1.1
- old
+ new
@@ -2,13 +2,13 @@
module Jackhammer
class CLI
attr_reader :logger, :opts
- def initialize
+ def initialize(options = {})
@logger = Logger.new STDERR
- @opts = { require: './config/application' }
+ @opts = { require: './config/application' }.merge(options)
end
def parse(argv = ARGV)
@parser = OptionParser.new do |o|
o.on "-r", "--require PATH", "Location of application" do |arg|
@@ -24,9 +24,13 @@
end
def run
require opts[:require]
Log.info "Booting up Jackhammer v#{VERSION}"
- Jackhammer.configuration.server.start
+ server.start
+ end
+
+ def server
+ Jackhammer.configuration.server
end
end
end