<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -20,63 +20,79 @@ begin
     s.add_dependency 'httparty'
     s.add_dependency 'rails'
   end
-  Jeweler::RubyforgeTasks.new
+  Jeweler::GemcutterTasks.new
 rescue LoadError
   puts &quot;Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com&quot;
 end
 
+desc 'Test the rubber plugin.'
+Rake::TestTask.new(:test) do |t|
+  t.libs &lt;&lt; 'lib'
+  t.libs &lt;&lt; 'test'
+  t.pattern = 'test/**/*_test.rb'
+  t.verbose = true
+end
+
+desc 'Default: run unit tests.'
+task :default =&gt; :test
+
 task :changelog do
 
+  changelog_file = 'CHANGELOG'
+  entries = &quot;&quot;
+
+  # Get a list of current tags
   tags = `git tag -l`.split
 
-  out_file = ENV['OUTPUT'] || 'CHANGELOG'
-  if out_file.size &gt; 0
-    entries = File.read(out_file)
+  # If we already have a changelog, make the last tag be the
+  # last one in the changelog, and the next one be the one
+  # following that in the tag list
+  if File.exist?(changelog_file)
+    entries = File.read(changelog_file)
     head = entries.split.first
     if head =~ /\d\.\d\.\d/
       last_tag = &quot;v#{head}&quot;
       idx = tags.index(last_tag)
-      current_tag = tags[idx + 1] rescue nil
+      current_tag = tags[idx + 1]
     end
-  else
-    entries = &quot;&quot;
-    out_file=$stdout
   end
 
-  last_tag = ENV['LAST_TAG'] || last_tag || tags[-2]
-  current_tag = ENV['CURRENT_TAG'] || current_tag || tags[-1]
+  # Figure out last/current tags and do some validation
+  last_tag ||= tags[-2]
+  current_tag ||= tags[-1]
+
+  if last_tag.nil? &amp;&amp; current_tag.nil?
+    puts &quot;Cannot generate a changelog without first tagging your repository&quot;
+    puts &quot;Tags should be in the form vN.N.N&quot;
+    exit
+  end
 
   if last_tag == current_tag
     puts &quot;Nothing to do for equal revisions: #{last_tag}..#{current_tag}&quot;
     exit
   end
-  
+
+
+  # Generate changelog from repo
   log=`git log --pretty='format:%s &lt;%h&gt; [%cn]' #{last_tag}..#{current_tag}`
+
+  # Strip out maintenance entries
   log = log.to_a.delete_if {|l| l =~ /^Regenerated gemspec/ || l =~ /^Version bump/ || l =~ /^Updated changelog/ }
 
-  out = File.open(out_file, 'w')
-  
-  out.puts current_tag.gsub(/^v/, '')
-  out.puts &quot;-----&quot;
-  out.puts &quot;\n&quot;
-  out.puts log
-  out.puts &quot;\n&quot;
-  out.puts entries
-
-  if out_file != $stdout
-    sh &quot;git ci -m'Updated changelog' #{out_file}&quot;
-    sh &quot;git push #{out_file}&quot;
+  # Write out changelog file
+  File.open(changelog_file, 'w') do |out|
+    out.puts current_tag.gsub(/^v/, '')
+    out.puts &quot;-----&quot;
+    out.puts &quot;\n&quot;
+    out.puts log
+    out.puts &quot;\n&quot;
+    out.puts entries
   end
-end
 
-desc 'Test the rubber plugin.'
-Rake::TestTask.new(:test) do |t|
-  t.libs &lt;&lt; 'lib'
-  t.libs &lt;&lt; 'test'
-  t.pattern = 'test/**/*_test.rb'
-  t.verbose = true
+  # Commit and push
+  sh &quot;git ci -m'Updated changelog' #{changelog_file}&quot;
+  sh &quot;git push&quot;
 end
 
-desc 'Default: run unit tests.'
-task :default =&gt; :test
-
+task :my_release =&gt; ['version:bump:patch', 'release', 'changelog', 'gemcutter:release'] do
+end</diff>
      <filename>Rakefile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5043937106109ec699d67faa96d3dc947769c0a8</id>
    </parent>
  </parents>
  <author>
    <name>Matt Conway</name>
    <email>wr0ngway@yahoo.com</email>
  </author>
  <url>http://github.com/wr0ngway/rubber/commit/44d989b256e67f7ae19582923ef1403c5cab562a</url>
  <id>44d989b256e67f7ae19582923ef1403c5cab562a</id>
  <committed-date>2009-11-02T09:05:53-08:00</committed-date>
  <authored-date>2009-11-02T09:05:53-08:00</authored-date>
  <message>add gemcutter, simplify changelog</message>
  <tree>c1137a7e1396a8dc61217e9386dce6d36563dc88</tree>
  <committer>
    <name>Matt Conway</name>
    <email>wr0ngway@yahoo.com</email>
  </committer>
</commit>
