<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/simple_gem/version.rb</filename>
    </added>
    <added>
      <filename>templates/Rakefile.erb</filename>
    </added>
    <added>
      <filename>templates/lib_version.rb.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1 +1,50 @@
-Generating gems is fun. Doing it with hoe / newgem / bones / etc... is a pain in (my) ass
\ No newline at end of file
+# SimpleGem
+
+## Description
+
+Creating RubyGems is fun work, but dealing with the complexity of hoe / bones / newgem is not (for me, at least).  SimpleGem is a way to quickly create a gem structure with the bare minimum needed to build and deploy. 
+
+## Installation
+
+    sudo gem install reagent-simple-gem --source=http://gems.github.com
+
+## Usage
+
+    $ simple-gem my-gem
+    
+This will create a gem structure under the 'my-gem' directory.  The command is pretty forgiving with the name you supply, it will automatically transform anything that is camelcased into something more ruby-like.
+
+After generating your gem, go ahead and add information about your gem to both the `Rakefile` and `README.markdown` files.  The default version number is &quot;0.1.0&quot;, but if you want to change that, take a look at `lib/my_gem/version.rb` to make the change - this will automatically be picked up when you rebuild your gem.
+
+Your new gem provides some Rake tasks for convenience:
+
+* `rake gem` - Build the gem and drop it into the `pkg/` directory for installation.
+* `rake test` - The default test task, it will run the tests in `test`. If this is a newly-created gem, your tests will flunk.
+* `rake github` - Generate `my_gem.gemspec` file to use if you're serving your gem from GitHub (requires flagging your GitHub project as a rubygem).
+
+That's it. Enjoy.
+
+## License
+
+Copyright (c) 2008 Patrick Reagan (reaganpr@gmail.com)
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the &quot;Software&quot;), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
 require 'rubygems'
 require 'rake/gempackagetask'
+require 'rake/testtask'
 
-require 'lib/simple_gem'
+require 'lib/simple_gem/version'
+
+task :default =&gt; :test
 
 spec = Gem::Specification.new do |s|
   s.name             = 'simple-gem'
@@ -20,6 +23,12 @@ Rake::GemPackageTask.new(spec) do |pkg|
   pkg.gem_spec = spec
 end
 
+Rake::TestTask.new do |t|
+  t.libs &lt;&lt; 'test'
+  t.test_files = FileList[&quot;test/**/*_test.rb&quot;]
+  t.verbose = true
+end
+
 desc 'Generate the gemspec to serve this Gem from Github'
 task :github do
   file = File.dirname(__FILE__) + &quot;/#{spec.name}.gemspec&quot;</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,10 @@
-#!/usr/bin/env ruby
\ No newline at end of file
+#!/usr/bin/env ruby
+
+require 'simple_gem/gem'
+
+if ARGV[0]
+  gem = SimpleGem::Gem.new(`pwd`.strip, ARGV[0])
+  gem.generate
+else
+  puts &quot;Please specify a name for your gem&quot;
+end
\ No newline at end of file</diff>
      <filename>bin/simple-gem</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,2 @@
-module SimpleGem
-  module Version
-    
-    MAJOR = 0
-    MINOR = 1
-    TINY  = 0
-    
-    def self.to_s
-      [MAJOR, MINOR, TINY].join('.')
-    end
-    
-  end
-end
\ No newline at end of file
+require 'simple_gem/version'
+require 'simple_gem/gem'
\ No newline at end of file</diff>
      <filename>lib/simple_gem.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'erb'
+
 module SimpleGem
   class Gem
     
@@ -19,12 +21,39 @@ module SimpleGem
     def ruby_name
       transform_name('_') {|part| part.downcase }
     end
+
+    def generate
+      generate_root_directory
+      generate_subdirectories
+      generate_file('lib.rb.erb', &quot;lib/#{self.ruby_name}.rb&quot;)
+      generate_file('lib_version.rb.erb', &quot;lib/#{self.ruby_name}/version.rb&quot;)
+      generate_file('Rakefile.erb', 'Rakefile')
+      generate_file('README.markdown.erb', 'README.markdown')
+      generate_file('test.rb.erb', &quot;test/#{self.ruby_name}_test.rb&quot;)
+    end
     
     private
     def transform_name(glue = nil, &amp;block)
-      # pattern = /_/
       self.name.split(/[_-]/).map {|part| block.call(part) }.join(glue)
     end
     
+    def generate_root_directory
+      FileUtils.mkdir(&quot;#{self.root_path}/#{self.name}&quot;)
+    end
+    
+    def generate_subdirectories
+      ['lib', 'test', &quot;lib/#{self.ruby_name}&quot;].each do |dir|
+        FileUtils.mkdir(&quot;#{self.root_path}/#{self.name}/#{dir}&quot;)
+      end
+    end
+    
+    def generate_file(source, output)
+      source_file = File.dirname(__FILE__) + &quot;/../../templates/#{source}&quot;
+      output_file = &quot;#{self.root_path}/#{self.name}/#{output}&quot;
+      
+      erb = ERB.new(File.read(source_file))
+      File.open(output_file, 'w') {|f| f &lt;&lt; erb.result(binding) }
+    end
+    
   end
 end
\ No newline at end of file</diff>
      <filename>lib/simple_gem/gem.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,12 +4,12 @@ Gem::Specification.new do |s|
 
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Patrick Reagan&quot;]
-  s.date = %q{2008-10-27}
+  s.date = %q{2008-10-29}
   s.default_executable = %q{simple-gem}
   s.email = %q{reaganpr@gmail.com}
   s.executables = [&quot;simple-gem&quot;]
-  s.extra_rdoc_files = [&quot;README&quot;]
-  s.files = [&quot;README&quot;, &quot;Rakefile&quot;, &quot;lib/simple_gem.rb&quot;, &quot;bin/simple-gem&quot;]
+  s.extra_rdoc_files = [&quot;README.markdown&quot;]
+  s.files = [&quot;README.markdown&quot;, &quot;Rakefile&quot;, &quot;lib/simple_gem&quot;, &quot;lib/simple_gem/gem.rb&quot;, &quot;lib/simple_gem/version.rb&quot;, &quot;lib/simple_gem.rb&quot;, &quot;test/simple_gem&quot;, &quot;test/simple_gem/gem_test.rb&quot;, &quot;templates/lib.rb.erb&quot;, &quot;templates/lib_version.rb.erb&quot;, &quot;templates/Rakefile.erb&quot;, &quot;templates/README.markdown.erb&quot;, &quot;templates/test.rb.erb&quot;, &quot;bin/simple-gem&quot;]
   s.has_rdoc = true
   s.homepage = %q{http://sneaq.net}
   s.require_paths = [&quot;lib&quot;]</diff>
      <filename>simple-gem.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,38 @@
+# &lt;%= self.module_name %&gt;
+
+## Description
+
+Describe your gem here ... 
+
+## Installation
+
+    sudo gem install &lt;%= self.name %&gt;
+
+## Usage
+
+    require '&lt;%= self.ruby_name %&gt;'
+
+## License
+
+Copyright (c) &lt;year&gt; &lt;copyright holders&gt;
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the &quot;Software&quot;), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.</diff>
      <filename>templates/README.markdown.erb</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1 @@
+# require '&lt;%= self.ruby_name %&gt;/...'
\ No newline at end of file</diff>
      <filename>templates/lib.rb.erb</filename>
    </modified>
    <modified>
      <diff>@@ -0,0 +1,9 @@
+require 'test/unit'
+
+class &lt;%= self.module_name %&gt;Test &lt; Test::Unit::TestCase
+
+  def test_truth
+    flunk &quot;Please provide some tests&quot;
+  end
+
+end
\ No newline at end of file</diff>
      <filename>templates/test.rb.erb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ module SimpleGem
   class GemTest &lt; Test::Unit::TestCase
 
     def self.should_generate(expectations)
-      context &quot;when given a #{expectations[:from]} name&quot; do
+      describe &quot;An instance of Gem when given a #{expectations[:from]} name&quot; do
         before do
           path = '/this/path'
           @name = expectations[:from]
@@ -25,19 +25,80 @@ module SimpleGem
       end
     end
 
-    should_generate :name =&gt; 'simple_gem', :module_name =&gt; 'SimpleGem', :ruby_name =&gt; 'simple_gem', :from =&gt; 'SimpleGem'
-    should_generate :name =&gt; 'simple-gem', :module_name =&gt; 'SimpleGem', :ruby_name =&gt; 'simple_gem', :from =&gt; 'simple-gem'
-    should_generate :name =&gt; 'simple_gem', :module_name =&gt; 'SimpleGem', :ruby_name =&gt; 'simple_gem', :from =&gt; 'simple_gem'
-    should_generate :name =&gt; 'simple_gem', :module_name =&gt; 'SimpleGem', :ruby_name =&gt; 'simple_gem', :from =&gt; 'simpleGem'
+    should_generate :name        =&gt; 'simple_gem', 
+    :module_name =&gt; 'SimpleGem', 
+    :ruby_name   =&gt; 'simple_gem', 
+    :from        =&gt; 'SimpleGem'
+
+
+    should_generate :name        =&gt; 'simple-gem', 
+    :module_name =&gt; 'SimpleGem', 
+    :ruby_name   =&gt; 'simple_gem', 
+    :from        =&gt; 'simple-gem'
+
+    should_generate :name        =&gt; 'simple_gem', 
+    :module_name =&gt; 'SimpleGem', 
+    :ruby_name   =&gt; 'simple_gem', 
+    :from        =&gt; 'simple_gem'
+
+    should_generate :name        =&gt; 'simple_gem', 
+    :module_name =&gt; 'SimpleGem', 
+    :ruby_name   =&gt; 'simple_gem', 
+    :from        =&gt; 'simpleGem'
 
     describe &quot;An instance of Gem&quot; do
       before { @path = '/this/path' }
-      
+
       it &quot;should know its root path&quot; do
         Gem.new(@path, 'name').root_path.should == @path
       end
-      
+
+      context &quot;when generating the directory structure&quot; do
+
+        before do
+          @tmp_dir = File.dirname(__FILE__) + '/../../tmp'
+          FileUtils.mkdir(@tmp_dir) unless File.exist?(@tmp_dir)
+
+          @name = 'simple-gem'
+          Gem.new(@tmp_dir, @name).generate
+        end
+
+        after do
+          FileUtils.rm_rf(@tmp_dir)
+        end
+
+        it &quot;should be able to make the root directory&quot; do
+          File.exist?(&quot;#{@tmp_dir}/#{@name}&quot;).should == true
+        end
+
+        %w(lib test lib/simple_gem).each do |dir|
+          it &quot;should create the #{dir} subdirectory&quot; do
+            File.exist?(&quot;#{@tmp_dir}/#{@name}/#{dir}&quot;).should == true
+          end
+        end
+
+        it &quot;should create the main library file&quot; do
+          File.exist?(&quot;#{@tmp_dir}/#{@name}/lib/simple_gem.rb&quot;).should == true
+        end
+        
+        it &quot;should create the version file&quot; do
+          File.exist?(&quot;#{@tmp_dir}/#{@name}/lib/simple_gem/version.rb&quot;).should == true
+        end
+
+        it &quot;should create the main Rakefile&quot; do
+          File.exist?(&quot;#{@tmp_dir}/#{@name}/Rakefile&quot;).should == true
+        end
+
+        it &quot;should create the README file&quot; do
+          File.exist?(&quot;#{@tmp_dir}/#{@name}/README.markdown&quot;).should == true
+        end
+
+        it &quot;should generate the test file&quot; do
+          File.exist?(&quot;#{@tmp_dir}/#{@name}/test/simple_gem_test.rb&quot;).should == true
+        end
+
+      end
+
     end
-    
   end
 end
\ No newline at end of file</diff>
      <filename>test/simple_gem/gem_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>templates/Rakefile.tmpl</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>bc306562e2cb534c3f2447badfe72e6b0e5b9c7b</id>
    </parent>
  </parents>
  <author>
    <name>Patrick Reagan</name>
    <email>patrick.reagan@viget.com</email>
  </author>
  <url>http://github.com/reagent/simple-gem/commit/25d255e30b628a67882ba6c62e3371a666456eeb</url>
  <id>25d255e30b628a67882ba6c62e3371a666456eeb</id>
  <committed-date>2008-10-29T07:59:37-07:00</committed-date>
  <authored-date>2008-10-29T07:59:37-07:00</authored-date>
  <message>Implemented gem generation; updated documentation files</message>
  <tree>0a09a5d527d42f82f683397ed6a33a196fef3190</tree>
  <committer>
    <name>Patrick Reagan</name>
    <email>patrick.reagan@viget.com</email>
  </committer>
</commit>
