Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Find and replace for GemTemplate as well as gem_template

  • Loading branch information...
commit e783bde031bf91a0dd1348a7eb876db86b6ee1d4 1 parent 6b033da
@winton authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 Rakefile
View
4 Rakefile
@@ -44,6 +44,9 @@ task :default => :spec
desc "Rename project"
task :rename do
name = ENV['NAME'] || File.basename(Dir.pwd)
+ camelize = lambda do |str|
+ str.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
+ end
begin
dir = Dir['**/gem_template*']
from = dir.pop
@@ -57,6 +60,7 @@ task :rename do
next if path.include?('Rakefile')
if File.file?(path)
`sed -i 's/gem_template/#{name}/g' #{path}`
+ `sed -i 's/GemTemplate/#{camelize.call(name)}/g' #{path}`
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.