Skip to content

Commit

Permalink
Add Rakefile which runs spec lint against all specs. And fix a few …
Browse files Browse the repository at this point in the history
…specs.
  • Loading branch information
alloy committed Nov 17, 2011
1 parent a0a6f17 commit 1999de5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.swp
*.swo
.DS_Store
.DS_Store
.gems
31 changes: 31 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions RestKit/0.9.3/RestKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions SDURLCache/1.2/SDURLCache.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '[email protected]' }
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.