Permalink
Browse files

Merge branch 'master' of git@github.com:winton/gem_template

  • Loading branch information...
winton committed Nov 10, 2009
2 parents 101fe48 + f18fa45 commit 66cc78b46ebbafde231b475ab5577628abae9505
Showing with 21 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +20 −0 Rakefile
View
@@ -1,5 +1,6 @@
.DS_Store
*.gem
+*.gemspec
coverage
pkg
tmp
View
@@ -24,6 +24,26 @@ Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
pkg.gem_spec = GEM_SPEC
end
+desc "Rename project"
+task :rename do
+ name = ENV['NAME'] || File.basename(Dir.pwd)
+ begin
+ dir = Dir['**/gem_template*']
+ from = dir.pop
+ if from
+ rb = from.include?('.rb')
+ to = File.dirname(from) + "/#{name}#{'.rb' if rb}"
+ FileUtils.mv(from, to)
+ end
+ end while dir.length > 0
+ Dir["**/*"].each do |path|
+ next if path.include?('Rakefile')
+ if File.file?(path)
+ `sed -i "" 's/gem_template/#{name}/g' #{path}`
+ end
+ end
+end
+
desc "Run specs"
Spec::Rake::SpecTask.new do |t|
t.rcov = true

0 comments on commit 66cc78b

Please sign in to comment.