<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,10 +11,11 @@ class PackageGenerator
   def generate
     delete_previous
     copy_files
-    write_header
+    process_code
     pack_js
     minify_js
     compress
+  ensure
     clean_up
   end
   
@@ -24,13 +25,20 @@ class PackageGenerator
   
   def copy_files
     FileUtils.mkdir package_dir
-    FileUtils.cp root_files(&quot;date_input.css&quot;, &quot;LICENCE&quot;, &quot;README&quot;, &quot;CHANGELOG&quot;, &quot;NOTES&quot;), package_dir
+    FileUtils.cp root_files(&quot;date_input.css&quot;, &quot;LICENCE&quot;, &quot;README&quot;, &quot;CHANGELOG&quot;), package_dir
   end
   
-  def write_header
+  def process_code
+    code = File.read(root_file(plugin_file))
+    
+    code.gsub!(/\/\/[^\n]+/,  &quot;&quot;) # Remove any other '//' comments (without deleting the line)
+    code.gsub!(/\/\*.+\*\//m, &quot;&quot;) # Remove '/* */' comments
+    
+    code.gsub!(/(\n +\n)( +\n)+/) { $1 } # Remove any multiple empty lines
+    
     open(package_file(plugin_file), &quot;w&quot;) do |file|
       file &lt;&lt; header
-      file &lt;&lt; File.read(root_file(plugin_file))
+      file &lt;&lt; code
     end
   end
   </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -292,10 +292,10 @@ DateInput.prototype = {
     return (end - start) / 86400000;
   },
   
-  // changeDayTo: Given a date, move along the date line in the given direction until we reach the
-  // desired day of week.
-  
   /*
+  changeDayTo: Given a date, move along the date line in the given direction until we reach the
+  desired day of week.
+  
   The maths is a bit complex, here's an explanation.
   
   Think of a continuous repeating number line like:</diff>
      <filename>jquery.date_input.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7626f811383ed9c88674ed0ffd59cd660a5d5787</id>
    </parent>
  </parents>
  <author>
    <name>Jon Leighton</name>
    <email>j@jonathanleighton.com</email>
  </author>
  <url>http://github.com/jonleighton/date_input/commit/dfe11af4a9679aac2e12892333b83a1aedecafb8</url>
  <id>dfe11af4a9679aac2e12892333b83a1aedecafb8</id>
  <committed-date>2009-04-08T06:46:41-07:00</committed-date>
  <authored-date>2009-04-08T06:46:41-07:00</authored-date>
  <message>Auto-remove the comments from the source when packaging</message>
  <tree>a8ff4989144c444048031dde3dce3b62d0416d3a</tree>
  <committer>
    <name>Jon Leighton</name>
    <email>j@jonathanleighton.com</email>
  </committer>
</commit>
