# Raking Podspecs

DevFeed: [Raking Podspecs](<https://devfeed.tech/articles/raking-podspecs-25380.md>)

Original publisher: [Read original article](<https://smileykeith.com/2013/01/04/raking-podspecs/>)

Author: Keith Smiley

Published: 2013-01-04T19:09:00Z

Content type: article

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [rubygems](<https://devfeed.tech/topics/rubygems.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [lint](<https://devfeed.tech/tags/lint.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [repo](<https://devfeed.tech/tags/repo.md>), [rewrite](<https://devfeed.tech/tags/rewrite.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [rubygems](<https://devfeed.tech/tags/rubygems.md>), [tool](<https://devfeed.tech/tags/tool.md>), [tools](<https://devfeed.tech/tags/tools.md>), [travis](<https://devfeed.tech/tags/travis.md>)

## AI overview

The article describes automating CocoaPods podspec linting across multiple Ruby versions with rbenv and a Rakefile.

## Source excerpt

I spend a decent amount of time these days helping maintain the CocoaPods specs repo by managing pull requests and issues. CococaPods is an awesome dependency manager similar to Rubygems for Objective-C projects. Unfortunately a lot of submitted podspecs haven't been correctly formatted or they're missing required information. CocoaPods has an awesome build in command pod spec lint that allows you to make sure the spec is valid and complete. Understandably people who are new to CocoaPods trying to submit their libraries are unaware of this awesome tool. Therefore when I look through the pull requests, I like to lint them myself (CocoaPods does utilize Travis but unfortunately it can't do everything). Since CocoaPods supports multiple versions of Ruby (1.8.7 and 1.9.3) to be complete ideally you'd lint them on both versions. Tools like RVM and rbenv(my tool of choice) make it easy to quickly switch between different versions of Ruby using .rvmrc and .rbenv-version respectively. As you can probably assume I wanted to automate this. So I wrote a quick Rakefile to do this for me. #!/usr/bin/env rake # NOTE: Must be using rbenv 4.0 to use `system` and `.ruby-version` ## Set your preferred ruby versions $V18 = 'system' $V19 = '1.9.3-p385' $RBENV = '.ruby-version' # The gem to use $GEM = 'cocoapods' task :default => :lint task :c => :clean desc "Lint podspecs on multiple versions of ruby with rbenv" task :lint do if Dir.glob('*.podspec').count < 1 puts "No podspecs in #{ Dir.pwd }" exit end existed = versionFileExists? if existed old_version = currentVersion end # Loop through all podspecs Dir.glob('*.podspec').each do |file| # Loop through ruby versions 2.times do |x| version = x == 0 ? $V18 : $V19 writeVersion(version) puts "Linting #{ file } on Ruby version #{ currentVersion }" puts lint(file) end end # If the dotfile already existed rewrite the original code if existed writeVersion(old_version) else File.delete($RBENV) if versionFileExists? end end desc "Delete all pod