<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,7 +12,7 @@ rescue LoadError
 end
 
 module Jake
-  VERSION = '1.0.0'
+  VERSION = '1.0.1'
   
   CONFIG_FILE = 'jake.yml'
   HELPER_FILE = 'Jakefile'
@@ -30,6 +30,13 @@ module Jake
     Build.delete_observers
   end
   
+  # Returns a path made by joining the given pieces and removing unnecessary
+  # /. sections using expand_path.
+  def self.path(*parts)
+    parts = parts.compact.map { |p| p.to_s }
+    File.expand_path(File.join(*parts))
+  end
+  
   # Returns the contents of the given path, which may be missing a .js extension.
   def self.read(path)
     path = File.expand_path(path)</diff>
      <filename>lib/jake.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,12 +18,12 @@ module Jake
       @helper = Helper.new(options)
       force! if options[:force]
       
-      path    = &quot;#{dir}/#{CONFIG_FILE}&quot;
+      path    = Jake.path(dir, CONFIG_FILE)
       yaml    = File.read(path)
       
       @config = Jake.symbolize_hash( YAML.load(Jake.erb(yaml).result(@helper.scope)) )
       
-      helpers = &quot;#{dir}/#{HELPER_FILE}&quot;
+      helpers = Jake.path(dir, HELPER_FILE)
       load helpers if File.file?(helpers)
       
       @builds = @config[:builds] || {:src =&gt; false, :min =&gt; @config[:packer]}
@@ -78,13 +78,13 @@ module Jake
     
     # Returns the path to the build directory, where generated files appear.
     def build_directory
-      &quot;#{ @dir }/#{ @config[:build_directory] || '.' }&quot;
+      Jake.path(@dir, @config[:build_directory] || '.')
     end
     alias :build_dir :build_directory
     
     # Returns the path to the source directory, where source code is read from.
     def source_directory
-      &quot;#{ @dir }/#{ @config[:source_directory] || '.' }&quot;
+      Jake.path(@dir, @config[:source_directory] || '.')
     end
     alias :source_dir :source_directory
     
@@ -92,7 +92,7 @@ module Jake
     # header file has been set.
     def header
       @config[:header] ?
-          Jake.read(&quot;#{ source_directory }/#{ @config[:header] }&quot;) :
+          Jake.read(Jake.path(source_directory, @config[:header])) :
           &quot;&quot;
     end
     </diff>
      <filename>lib/jake/build.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,15 +31,15 @@ module Jake
     def directory
       dir = @config[:directory]
       return parent.directory if parent &amp;&amp; !dir
-      &quot;#{ @build.source_directory }/#{ @config[:directory] }&quot;
+      Jake.path(@build.source_directory, @config[:directory])
     end
     
     # Returns the path to the output file from this package for the given build name.
     def build_path(build_name)
       suffix = @build.use_suffix?(build_name) ? &quot;-#{ build_name }&quot; : &quot;&quot;
       @build.layout == 'together' ?
-          &quot;#{ @build.build_directory }/#{ @name }#{ suffix }.js&quot; :
-          &quot;#{ @build.build_directory }/#{ build_name }/#{ @name }.js&quot;
+          Jake.path(@build.build_directory, &quot;#{ @name }#{ suffix }.js&quot;) :
+          Jake.path(@build.build_directory, build_name, &quot;#{ @name }.js&quot;)
     end
     
     # Returns +true+ if the build file for the given build name is out of date and
@@ -55,7 +55,7 @@ module Jake
     # Returns the header string being used for this package.
     def header
       content = @config[:header] ?
-          Jake.read(&quot;#{ directory }/#{ @config[:header] }&quot;) :
+          Jake.read(Jake.path( directory, @config[:header])) :
           (parent ? parent.header : @build.header)
       Jake.erb(content).result(@build.helper.scope).strip
     end</diff>
      <filename>lib/jake/buildable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ module Jake
     def files
       base = parent ? parent.files : []
       base + @config[:files].map do |path|
-        path = &quot;#{ directory }/#{ path }&quot;
+        path = Jake.path( directory, path)
         File.file?(path) ? path : &quot;#{ path }.js&quot;
       end
     end</diff>
      <filename>lib/jake/package.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>60a455002ced4cec5a9882b64118f168ff8f9729</id>
    </parent>
  </parents>
  <author>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </author>
  <url>http://github.com/jcoglan/jake/commit/4d647dbc635cbc71397c2dc3a2e9a1efa5b965a7</url>
  <id>4d647dbc635cbc71397c2dc3a2e9a1efa5b965a7</id>
  <committed-date>2009-09-21T03:55:49-07:00</committed-date>
  <authored-date>2009-09-21T03:19:50-07:00</authored-date>
  <message>Use File #join and #expand_path to build file paths throughout so no badly-formed paths are sent to event hooks.</message>
  <tree>cd15591b722e052151dad445005d5bfd0855a3ca</tree>
  <committer>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </committer>
</commit>
