From e783bde031bf91a0dd1348a7eb876db86b6ee1d4 Mon Sep 17 00:00:00 2001 From: winton Date: Mon, 28 Jun 2010 15:44:23 -0700 Subject: [PATCH] Find and replace for GemTemplate as well as gem_template --- Rakefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rakefile b/Rakefile index d9e8a30..d3afb8f 100644 --- a/Rakefile +++ b/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 \ No newline at end of file