Skip to content
Browse files

Add Penguin::Server and #start CLI command.

  • Loading branch information...
1 parent 18dc087 commit 77cc3f6fb3b69d8451b00219f37950ec87df056a @jimmycuadra committed May 12, 2012
Showing with 23 additions and 3 deletions.
  1. +1 −1 bin/penguin
  2. +2 −1 lib/penguin.rb
  3. +6 −0 lib/penguin/cli.rb
  4. +6 −0 lib/penguin/server.rb
  5. +2 −1 penguin.gemspec
  6. +6 −0 spec/penguin/cli_spec.rb
View
2 bin/penguin
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require "penguin/cli"
+require "penguin"
Penguin::CLI.start
View
3 lib/penguin.rb
@@ -1,4 +1,5 @@
module Penguin
- autoload :VERSION, "penguin/version"
autoload :CLI, "penguin/cli"
+ autoload :Server, "penguin/server"
+ autoload :VERSION, "penguin/version"
end
View
6 lib/penguin/cli.rb
@@ -2,5 +2,11 @@
module Penguin
class CLI < Thor
+ default_task :start
+
+ desc "start", "starts your presentation"
+ def start
+ Server.run!
+ end
end
end
View
6 lib/penguin/server.rb
@@ -0,0 +1,6 @@
+require "sinatra/base"
+
+module Penguin
+ class Server < Sinatra::Base
+ end
+end
View
3 penguin.gemspec
@@ -15,8 +15,9 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = Penguin::VERSION::STRING
- gem.add_runtime_dependency("thor", ">= 0.15.0")
+ gem.add_runtime_dependency("sinatra", ">= 1.3.0")
gem.add_runtime_dependency("sprockets", ">= 2.4.0")
+ gem.add_runtime_dependency("thor", ">= 0.15.0")
gem.add_development_dependency("rspec", ">= 2.10.0")
end
View
6 spec/penguin/cli_spec.rb
@@ -1,4 +1,10 @@
require "spec_helper"
describe Penguin::CLI do
+ describe "#start" do
+ it "starts up the server" do
+ Penguin::Server.should_receive(:run!)
+ described_class.start([])
+ end
+ end
end

0 comments on commit 77cc3f6

Please sign in to comment.
Something went wrong with that request. Please try again.