Permalink
Browse files

Add Rakefile which runs `spec lint` against all specs. And fix a few …

…specs.
  • Loading branch information...
alloy committed Nov 17, 2011
1 parent a0a6f17 commit 1999de5015e215477711708da3169d872a16fcb5
Showing with 37 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. +31 −0 Rakefile
  3. +3 −0 RestKit/0.9.3/RestKit.podspec
  4. +1 −0 SDURLCache/1.2/SDURLCache.podspec
View
@@ -1,3 +1,4 @@
*.swp
*.swo
-.DS_Store
+.DS_Store
+.gems
View
@@ -0,0 +1,31 @@
+GEMS_DIR = '.gems'
+
+desc "Installs the latest versions of the CocoaPods gems in `.gems'"
+task :install_gems do
+ unless File.exist?(GEMS_DIR)
+ sh "gem install cocoapods --install-dir='#{GEMS_DIR}' --no-rdoc --no-ri"
+ end
+end
+
+desc "Run `pod spec lint` on all specs"
+task :lint => :install_gems do
+ gems = Dir.glob(File.join(GEMS_DIR, 'gems', '*'))
+ pod = File.join(gems.find { |path| path =~ /cocoapods-[\d\.]+$/ }, 'bin/pod')
+ specs = FileList['**/*.podspec']
+ failures = []
+ specs.each do |spec|
+ begin
+ sh "macruby -I '#{gems.join("/lib' -I '")}/lib' '#{pod}' spec lint '#{spec}'"
+ rescue
+ failures << spec
+ end
+ end
+ unless failures.empty?
+ puts
+ puts "The following specs did not pass `spec lint`:"
+ puts failures.join("\n")
+ exit 1
+ end
+end
+
+task :default => :lint
@@ -12,4 +12,7 @@ This pod consists of the three sub-pods: RestKit-Network, RestKit-ObjectMapping,
s.dependency 'RestKit-Network', '0.9.3'
s.dependency 'RestKit-ObjectMapping', '0.9.3'
#s.dependency 'RestKit-CoreData', '0.9.3'
+
+ # Otherwise it won’t pass `spec lint`.
+ s.source_files = []
end
@@ -4,6 +4,7 @@ Pod::Spec.new do |s|
s.platform = :ios
s.summary = 'URLCache subclass with on-disk cache support on iPhone/iPad.'
s.homepage = 'https://github.com/rs/SDURLCache'
+ s.author = { 'Olivier Poitrey' => 'rs@dailymotion.com' }
s.source = { :git => 'https://github.com/rs/SDURLCache.git', :tag => '1.2' }
s.source_files = 'SDURLCache.h', 'SDURLCache.m'
end

0 comments on commit 1999de5

Please sign in to comment.