Skip to content
Browse files

Add stubs for comamnd classes.

  • Loading branch information...
1 parent f2e56cf commit c9e64e335e83172e3e60e7d677632bb3a4337013 @alloy alloy committed Aug 14, 2011
View
3 lib/cocoa_pods.rb
@@ -0,0 +1,3 @@
+module Pod
+ autoload :Command, 'cocoa_pods/command'
+end
View
19 lib/cocoa_pods/command.rb
@@ -0,0 +1,19 @@
+module Pod
+ module Command
+ autoload :Help, 'cocoa_pods/command/help'
+ autoload :Setup, 'cocoa_pods/command/setup'
+ autoload :Spec, 'cocoa_pods/command/spec'
+ autoload :Repo, 'cocoa_pods/command/repo'
+
+ def self.parse(*argv)
+ argv = argv.dup
+ command = case argv.shift
+ when 'help' then Help
+ when 'setup' then Setup
+ when 'spec' then Spec
+ when 'repo' then Repo
+ end
+ command.new(*argv)
+ end
+ end
+end
View
6 lib/cocoa_pods/command/help.rb
@@ -0,0 +1,6 @@
+module Pod
+ module Command
+ class Help
+ end
+ end
+end
View
7 lib/cocoa_pods/command/repo.rb
@@ -0,0 +1,7 @@
+module Pod
+ module Command
+ class Repo
+ end
+ end
+end
+
View
6 lib/cocoa_pods/command/setup.rb
@@ -0,0 +1,6 @@
+module Pod
+ module Command
+ class Setup
+ end
+ end
+end
View
6 lib/cocoa_pods/command/spec.rb
@@ -0,0 +1,6 @@
+module Pod
+ module Command
+ class Spec
+ end
+ end
+end
View
5 spec/spec_helper.rb
@@ -0,0 +1,5 @@
+require 'rubygems'
+require 'mac_bacon'
+
+$:.unshift File.expand_path('../../lib', __FILE__)
+require 'cocoa_pods'
View
10 spec/unit/command_spec.rb
@@ -0,0 +1,10 @@
+require File.expand_path('../../spec_helper', __FILE__)
+
+describe "Pod::Command" do
+ it "returns the proper command class" do
+ Pod::Command.parse("help").should.be.instance_of Pod::Command::Help
+ Pod::Command.parse("setup").should.be.instance_of Pod::Command::Setup
+ Pod::Command.parse("spec").should.be.instance_of Pod::Command::Spec
+ Pod::Command.parse("repo").should.be.instance_of Pod::Command::Repo
+ end
+end

0 comments on commit c9e64e3

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