Skip to content

Commit

Permalink
[gem_template] Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Nov 9, 2009
1 parent 4ab38af commit 085cb14
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
34 changes: 26 additions & 8 deletions README.markdown
Expand Up @@ -3,16 +3,34 @@ GemTemplate

A gem template for new projects.

Setup
-----
Requirements
------------

<pre>
git clone git://github.com/winton/gem_template.git my_project
cd my_project
rake setup
git remote add origin git@github.com:winton/my_project.git
sudo gem install stencil --source http://gemcutter.org
</pre>

A project wide find-replace occurs on file names and contents.
Setup the template
------------------

Edit <code>gemspec.rb</code> and <code>MIT-LICENSE</code>, and your project is ready for its first commit.
You only have to do this once.

<pre>
git clone git@github.com:winton/gem_template.git
cd gem_template
stencil
</pre>

Setup a new project
-------------------

Do this for every new project.

<pre>
mkdir my_project
git init
stencil gem_template
rake rename
</pre>

The last command does a find-replace (gem\_template -> my\_project) on files and filenames.
8 changes: 3 additions & 5 deletions Rakefile
Expand Up @@ -24,10 +24,9 @@ Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
pkg.gem_spec = GEM_SPEC
end

desc "Setup project"
task :setup do
name = File.basename(Dir.pwd)
`rm -Rf .git`
desc "Rename project"
task :rename do
name = ENV['NAME'] || File.basename(Dir.pwd)
begin
dir = Dir['**/gem_template*']
from = dir.pop
Expand All @@ -43,7 +42,6 @@ task :setup do
`sed -i "" 's/gem_template/#{name}/g' #{path}`
end
end
`git init`
end

desc "Run specs"
Expand Down

0 comments on commit 085cb14

Please sign in to comment.