<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,7 +5,6 @@ Rakefile
 bin/jake
 lib/jake.rb
 lib/jake/helper.rb
-lib/jake/observer.rb
 lib/jake/build.rb
 lib/jake/buildable.rb
 lib/jake/package.rb</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -231,10 +231,12 @@ name. When built, the output would contain the following:
 
 The +Jakefile+ may also define event hooks that are fired during a build when
 interesting things happen. This allows you to extend your build process using
-configuration data from Jake. We currently have two events:
+configuration data from Jake. All event callbacks are passed a +Build+ object
+as the first argument, and may receive additional arguments depending on the
+event type. We currently have two events:
 
 +file_created+ is fired whenever a new build file is created. The callback is
-passed the +Buildable+ package object, the current build name (+src+ or +min+
+passed the +Buildable+ package object, the current build type (+src+ or +min+
 using the above examples), and the full path to the newly created file.
 The package object may contain metadata (set using the +meta+ option, see
 above) which you can use for further code generation.
@@ -246,7 +248,7 @@ directory, etc.
 
   $register = {}
   
-  jake_hook :file_created do |pkg, build_name, path|
+  jake_hook :file_created do |build, pkg, build_type, path|
     $register[path] = pkg.meta
   end
   </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ require './lib/jake.rb'
 Hoe.spec('jake') do |p|
   # p.rubyforge_name = 'jakex' # if different than lowercase project name
   p.developer('James Coglan', 'jcoglan@googlemail.com')
-  p.extra_deps = %w(oyster packr)
+  p.extra_deps = %w(eventful packr oyster)
 end
 
 # vim: syntax=Ruby</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ require 'observer'
 require 'yaml'
 require 'rubygems'
 require 'packr'
+require 'eventful'
 
 begin
   require 'erubis'
@@ -54,7 +55,7 @@ module Jake
   
 end
 
-%w(helper observer build buildable package bundle).each do |file|
+%w(helper build buildable package bundle).each do |file|
   require File.dirname(__FILE__) + '/jake/' + file
 end
 
@@ -68,6 +69,6 @@ alias :jake :jake_helper
 
 # Registers an event listener that will fire whenever a build is run.
 def jake_hook(type, &amp;block)
-  Jake::Observer.new(type, &amp;block)
+  Jake::Build.on(type, &amp;block)
 end
 </diff>
      <filename>lib/jake.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,14 +3,7 @@ module Jake
   # is responsible for running the build and provides access to any configuration
   # data used to set up the build.
   class Build
-    extend Observable
-    
-    # Calls all registered +Observer+ instances with any arguments passed in. Note
-    # that it is the +Build+ class that is +Observable+, not its instances.
-    def self.notify_observers(*args)
-      self.changed(true)
-      super
-    end
+    include Eventful
     
     DEFAULT_LAYOUT = 'together'
     
@@ -71,7 +64,7 @@ module Jake
       FileUtils.cd(@dir) do
         @packages.each { |name, pkg| pkg.write! }
         @bundles.each  { |name, pkg| pkg.write! }
-        self.class.notify_observers(:build_complete, self)
+        fire(:build_complete)
       end
     end
     </diff>
      <filename>lib/jake/build.rb</filename>
    </modified>
    <modified>
      <diff>@@ -79,8 +79,6 @@ module Jake
     # options. Files are only generated if they are out of date or the build has
     # been forced.
     def write!
-      puts &quot;Package #{@name}...&quot;
-      
       @build.each do |name, settings|
         next unless build_needed?(name)
         
@@ -89,11 +87,10 @@ module Jake
         FileUtils.mkdir_p(File.dirname(path))
         File.open(path, 'wb') { |f| f.write( (header + &quot;\n\n&quot; + code(name)).strip ) }
         
-        @build.class.notify_observers(:file_created, self, name, path)
+        @build.fire(:file_created, self, name, path)
         
         size = (File.size(path)/1024.0).ceil
         path = path.sub(@build.build_directory, '')
-        puts &quot;  -- build '#{ name }' created #{ path }, #{ size } kb&quot;
       end
     end
     </diff>
      <filename>lib/jake/buildable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,9 +5,9 @@ end
 FILES = []
 DEPS  = {}
 
-jake_hook :file_created do |package, build, path|
+jake_hook :file_created do |build, package, build_type, path|
   FILES &lt;&lt; File.basename(path)
-  DEPS[path] = package.meta if build == :min
+  DEPS[path] = package.meta if build_type == :min
 end
 
 jake_hook :build_complete do |build|</diff>
      <filename>test/Jakefile</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/jake/observer.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>2959171ef7b6a5e9aaa05e3d6c4058af2a6a7a38</id>
    </parent>
  </parents>
  <author>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </author>
  <url>http://github.com/jcoglan/jake/commit/ef1c8dac5cb2108d031cdb7f898e402bfc61ed6a</url>
  <id>ef1c8dac5cb2108d031cdb7f898e402bfc61ed6a</id>
  <committed-date>2009-06-18T09:02:02-07:00</committed-date>
  <authored-date>2009-06-18T09:02:02-07:00</authored-date>
  <message>Use Eventful to improve event publishing during a build. Also removing logging code, which should be done using event handlers.</message>
  <tree>ca9a8113ab4f55ac2836c3ed3edda9a1d00c25ee</tree>
  <committer>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </committer>
</commit>
