Skip to content

Commit

Permalink
Add console task
Browse files Browse the repository at this point in the history
  • Loading branch information
pusewicz committed May 1, 2010
1 parent 472ef4c commit effea5b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/sonia/cli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "sonia"
require 'thor'
require "launchy"

Expand All @@ -9,9 +8,19 @@ class CLI < Thor
desc "start", "Start Sonia server"
method_option :config, :type => :string, :aliases => "-c", :required => true
def start
require "sonia"
Sonia::Server.run!(Config.new(options)) do
Launchy::Browser.run(Sonia::Server.webserver_url)
end
end

desc "console", "Start Sonia console"
def console
ARGV.pop # Remove console as parameter
require 'irb'
require 'irb/completion'
require 'sonia'
IRB.start(__FILE__)
end
end
end

0 comments on commit effea5b

Please sign in to comment.