Skip to content

Instantly share code, notes, and snippets.

@maclover7
Created March 13, 2015 22:42
Show Gist options
  • Save maclover7/51716072ad087cc34423 to your computer and use it in GitHub Desktop.
Save maclover7/51716072ad087cc34423 to your computer and use it in GitHub Desktop.
Rakefile
namespace :claide do
task :namespace do
files = Dir.glob('lib/bundler/vendor/CLAide*/**/*.rb')
sh "sed -i.bak 's/CLAide/Bundler::CLAide/g' #{files.join(' ')}"
sh "rm #{files.join('.bak ')}.bak"
end
task :clean do
files = Dir.glob('lib/bundler/vendor/CLAide*/*', File::FNM_DOTMATCH).reject { |f| %(. .. lib).include? f.split('/').last }
puts files
sh "rm -r #{files.join(' ')}"
end
task :update, [:tag] => [] do |t, args|
tag = args[:tag]
Dir.chdir 'lib/bundler/vendor' do
`curl -L https://github.com/CocoaPods/claide/archive/#{tag}.tar.gz | tar -xz`
end
Rake::Task['claide:namespace'].invoke
Rake::Task['claide:clean'].invoke
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment