Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
clean up runner
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanheim committed Aug 19, 2012
1 parent 8c5b8e9 commit 682cbc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions lib/nachos/controller.rb
Expand Up @@ -27,6 +27,13 @@ def info
Github username: #{user.github_username}
You watch #{user.watched_repos.size} repos
You belong to #{user.organizations.size} organizations: #{user.organizations.map(&:login).sort}
EOL
end

def watched
out =<<EOL
You are watching the following repos:
#{user.watched}
EOL
end

Expand Down
4 changes: 2 additions & 2 deletions lib/nachos/runner.rb
@@ -1,7 +1,7 @@
require 'trollop'
module Nachos
class Runner
SUB_COMMANDS = %w(help info sync watched)
SUB_COMMANDS = %w(info init sync watched)

def self.start(args = ARGV)
global_opts = Trollop::options do
Expand All @@ -14,7 +14,7 @@ def self.start(args = ARGV)
case cmd
when nil, "--help"
puts "Usage: nachos COMMAND"
when "info", "init", "sync"
when *SUB_COMMANDS
Nachos::Controller.execute cmd
when "copy"
Trollop::options do
Expand Down
2 changes: 1 addition & 1 deletion spec/nachos_acceptance_spec.rb
Expand Up @@ -72,7 +72,7 @@ def run!(args)
end

context "init" do
fit "writes out an example config file" do
it "writes out an example config file" do
stdout, stderr, error = capture do
Nachos::Runner.start ["init"]
end
Expand Down

0 comments on commit 682cbc7

Please sign in to comment.