Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add thor and Sonia::CLI

To start sonia type:

./bin/sonia start --config path_to_config
  • Loading branch information...
commit a7d13c8b12a1597ae7680d5d3b0e91c8303c073b 1 parent 9d8e7d2
Piotr Usewicz pusewicz authored
2  Gemfile
View
@@ -7,7 +7,7 @@ group :runtime do
gem "em-http-request", "0.2.7"
gem "yajl-ruby", "0.7.5"
gem "rake", "0.8.7"
- gem "optiflag", "0.7"
+ gem "thor", "0.13.6"
gem "nokogiri", "1.4.1"
gem "launchy", "0.3.5"
gem "thin", "1.2.7"
2  README.rdoc
View
@@ -12,7 +12,7 @@ Sonia is a Superawesome Dashboard
git clone git@github.com:pusewicz/sonia.git
cd sonia
bundle install
- ./bin/sonia -config example/config.yml
+ ./bin/sonia start --config example/config.yml
== Note on Patches/Pull Requests
8 bin/sonia
View
@@ -12,10 +12,6 @@ end
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
-require "sonia"
-require "sonia/options"
-require "launchy"
+require "sonia/cli"
-Sonia::Server.run!(ARGV.flags) do
- Launchy::Browser.run(Sonia::Server.webserver_url)
-end
+Sonia::CLI.start
17 lib/sonia/cli.rb
View
@@ -0,0 +1,17 @@
+require "sonia"
+require 'thor'
+require "launchy"
+
+module Sonia
+ class CLI < Thor
+ # namespace nil
+
+ desc "start", "Start Sonia server"
+ method_option :config, :type => :string, :aliases => "-c", :required => true
+ def start
+ Sonia::Server.run!(Config.new(options)) do
+ Launchy::Browser.run(Sonia::Server.webserver_url)
+ end
+ end
+ end
+end
BIN  vendor/cache/thor-0.13.6.gem
View
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.