Permalink
Browse files

Make pod install take an optional podspec file to install the depende…

…ncies of instead of looking for ./Podfile
  • Loading branch information...
1 parent 260b4da commit 37f4f9bd5616317b31eff0da6b35fc87ef339091 @alloy alloy committed Sep 13, 2011
Showing with 31 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +10 −0 examples/TestLib.podspec
  3. +20 −4 lib/cocoa_pods/command/install.rb
View
@@ -2,3 +2,4 @@
*.swo
.DS_Store
tmp
+examples/Pods
View
@@ -0,0 +1,10 @@
+Pod::Spec.new do
+ name 'TestLib'
+ version '1.0'
+ summary 'A spec of a lib, to test that it too can be used to develop the lib.'
+ source :git => 'http://example.local/test.git', :tag => 'v1.0'
+
+ dependency 'SSZipArchive', '> 0.1'
+ dependency 'JSONKit'
+ dependency 'ASIHTTPRequest', '1.8'
+end
@@ -1,13 +1,29 @@
module Pod
class Command
class Install < Command
+ def initialize(*argv)
+ if podspec = argv.shift
+ @podspec = Pathname.new(podspec)
+ end
+ super
+ end
+
def run
- if config.project_podfile.exist?
- spec = Specification.from_podfile(config.project_podfile)
- Installer.new(spec, config.project_pods_root).install!
+ spec = nil
+ if @podspec
+ if @podspec.exist?
+ spec = Specification.from_podspec(@podspec)
+ else
+ raise "The specified podspec `#{@podspec}' doesn't exist."
+ end
else
- $stderr.puts "No Podfile found in current working directory."
+ if config.project_podfile.exist?
+ spec = Specification.from_podfile(config.project_podfile)
+ else
+ raise "No Podfile found in current working directory."
+ end
end
+ Installer.new(spec, config.project_pods_root).install!
end
end
end

0 comments on commit 37f4f9b

Please sign in to comment.