<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>features/data/cookbooks/packages/recipes/gem_package.rb</filename>
    </added>
    <added>
      <filename>features/data/cookbooks/packages/recipes/install_gem_package_twice.rb</filename>
    </added>
    <added>
      <filename>features/data/cookbooks/packages/recipes/manually_upgrade_gem_package.rb</filename>
    </added>
    <added>
      <filename>features/data/cookbooks/packages/recipes/upgrade_gem_package.rb</filename>
    </added>
    <added>
      <filename>features/data/gems/Marshal.4.8</filename>
    </added>
    <added>
      <filename>features/data/gems/Marshal.4.8.Z</filename>
    </added>
    <added>
      <filename>features/data/gems/gems/chef-integration-test-0.1.0.gem</filename>
    </added>
    <added>
      <filename>features/data/gems/gems/chef-integration-test-0.1.1.gem</filename>
    </added>
    <added>
      <filename>features/data/gems/latest_specs.4.8</filename>
    </added>
    <added>
      <filename>features/data/gems/latest_specs.4.8.gz</filename>
    </added>
    <added>
      <filename>features/data/gems/prerelease_specs.4.8</filename>
    </added>
    <added>
      <filename>features/data/gems/prerelease_specs.4.8.gz</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/Marshal.4.8/chef-integration-test-0.1.0.gemspec.rz</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/Marshal.4.8/chef-integration-test-0.1.1.gemspec.rz</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/chef-integration-test-0.1.0.gemspec.rz</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/chef-integration-test-0.1.1.gemspec.rz</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/index</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/index.rz</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/latest_index</filename>
    </added>
    <added>
      <filename>features/data/gems/quick/latest_index.rz</filename>
    </added>
    <added>
      <filename>features/data/gems/specs.4.8</filename>
    </added>
    <added>
      <filename>features/data/gems/specs.4.8.gz</filename>
    </added>
    <added>
      <filename>features/data/gems/yaml</filename>
    </added>
    <added>
      <filename>features/data/gems/yaml.Z</filename>
    </added>
    <added>
      <filename>features/provider/package/gem_package.feature</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -154,6 +154,10 @@ namespace :features do
     Cucumber::Rake::Task.new(:roles) do |t|
       t.profile = &quot;client_roles&quot;
     end
+
+    Cucumber::Rake::Task.new(:run_interval) do |t|
+      t.profile = &quot;client_run_interval&quot;
+    end
   end
 
   Cucumber::Rake::Task.new(:search) do |t|
@@ -191,6 +195,10 @@ namespace :features do
       Cucumber::Rake::Task.new(:macports) do |t|
         t.profile = &quot;provider_package_macports&quot;
       end
+      
+      Cucumber::Rake::Task.new(:gems) do |g|
+        g.profile = &quot;provider_package_rubygems&quot;
+      end
     end
   end
 end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ rescue LoadError
 end
 
 GEM_NAME = &quot;chef-server-slice&quot;
-CHEF_SERVER_VERSION=&quot;0.7.12&quot;
+CHEF_SERVER_VERSION=&quot;0.7.15&quot;
 AUTHOR = &quot;Opscode&quot;
 EMAIL = &quot;chef@opscode.com&quot;
 HOMEPAGE = &quot;http://wiki.opscode.com/display/chef&quot;</diff>
      <filename>chef-server-slice/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ require 'chef' unless defined?(Chef)
 include FileUtils
 
 GEM = &quot;chef-server&quot;
-CHEF_SERVER_VERSION = &quot;0.7.12&quot;
+CHEF_SERVER_VERSION = &quot;0.7.15&quot;
 AUTHOR = &quot;Opscode&quot;
 EMAIL = &quot;chef@opscode.com&quot;
 HOMEPAGE = &quot;http://wiki.opscode.com/display/chef&quot;</diff>
      <filename>chef-server/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'rake/rdoctask'
 require './tasks/rspec.rb'
 
 GEM = &quot;chef&quot;
-CHEF_VERSION = &quot;0.7.12&quot;
+CHEF_VERSION = &quot;0.7.15&quot;
 AUTHOR = &quot;Adam Jacob&quot;
 EMAIL = &quot;adam@opscode.com&quot;
 HOMEPAGE = &quot;http://wiki.opscode.com/display/chef&quot;
@@ -23,7 +23,7 @@ spec = Gem::Specification.new do |s|
   s.homepage = HOMEPAGE
   
   s.add_dependency &quot;mixlib-config&quot;, &quot;&gt;= 1.0.12&quot;
-  s.add_dependency &quot;ohai&quot;, &quot;&gt;= 0.3.4&quot;
+  s.add_dependency &quot;ohai&quot;, &quot;&gt;= 0.3.6&quot;
   %w{mixlib-cli mixlib-log ruby-openid
     json erubis extlib
     stomp}.each { |gem| s.add_dependency gem }</diff>
      <filename>chef/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ require 'chef/config'
 Dir[File.join(File.dirname(__FILE__), 'chef/mixin/**/*.rb')].sort.each { |lib| require lib }
 
 class Chef
-  VERSION = '0.7.12'
+  VERSION = '0.7.15'
 end
 
 # Adds a Dir.glob to Ruby 1.8.5, for compat</diff>
      <filename>chef/lib/chef.rb</filename>
    </modified>
    <modified>
      <diff>@@ -74,6 +74,8 @@ class Chef
         ]
         
         file_list_str = file_list.keys.join(&quot;\n&quot;)
+        Chef::Log.debug(&quot;Searching for preferred file in\n#{file_list_str}&quot;)
+        
         preferences.each do |pref|
           Chef::Log.debug(&quot;Looking for #{pref}&quot;)
           matcher = /^(.+#{pref})$/</diff>
      <filename>chef/lib/chef/mixin/find_preferred_file.rb</filename>
    </modified>
    <modified>
      <diff>@@ -129,7 +129,7 @@ class Chef
 
           status = popen4(&quot;crontab -u #{@new_resource.user} -&quot;, :waitlast =&gt; true) do |pid, stdin, stdout, stderr|
             crontab.each { |line| stdin.puts &quot;#{line}&quot; }
-            stdin.close
+            stdin.close rescue nil
           end
           Chef::Log.info(&quot;Updated cron '#{@new_resource.name}'&quot;)
           @new_resource.updated = true
@@ -144,7 +144,7 @@ class Chef
 
           status = popen4(&quot;crontab -u #{@new_resource.user} -&quot;, :waitlast =&gt; true) do |pid, stdin, stdout, stderr|
             crontab.each { |line| stdin.puts &quot;#{line}&quot; }
-            stdin.close
+            stdin.close rescue nil
           end
           Chef::Log.info(&quot;Added cron '#{@new_resource.name}'&quot;)
           @new_resource.updated = true
@@ -175,7 +175,7 @@ class Chef
 
           status = popen4(&quot;crontab -u #{@new_resource.user} -&quot;, :waitlast =&gt; true) do |pid, stdin, stdout, stderr|
             crontab.each { |line| stdin.puts &quot;#{line}&quot; }
-            stdin.close
+            stdin.close rescue nil
           end
           Chef::Log.debug(&quot;Deleted cron '#{@new_resource.name}'&quot;)
           @new_resource.updated = true</diff>
      <filename>chef/lib/chef/provider/cron.rb</filename>
    </modified>
    <modified>
      <diff>@@ -167,7 +167,7 @@ class Chef
       end
       
       def all_releases
-        Dir.glob(@new_resource.deploy_to + &quot;/releases/*&quot;)
+        Dir.glob(@new_resource.deploy_to + &quot;/releases/*&quot;).sort
       end
       
       def update_cached_repo</diff>
      <filename>chef/lib/chef/provider/deploy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -39,11 +39,13 @@ class Chef
         clone
         checkout
         enable_submodules
+        @new_resource.updated = true
       end
       
       def action_export
         action_checkout
         FileUtils.rm_rf(::File.join(@new_resource.destination,&quot;.git&quot;))
+        @new_resource.updated = true
       end
       
       def action_sync
@@ -53,6 +55,8 @@ class Chef
           sync
           enable_submodules
         end
+
+        @new_resource.updated = true
       end
       
       def find_current_revision
@@ -191,4 +195,4 @@ class Chef
       
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>chef/lib/chef/provider/git.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@ class Chef
 
           if( ::File.exists?(catdir) )
             Dir.entries(catdir).each do |entry|
-              if(entry =~ /^#{Regexp.escape(pkg)}\-(.+)/)
+              if(entry =~ /^#{Regexp.escape(pkg)}\-(\d[\.\d]*((_(alpha|beta|pre|rc|p)\d*)*)?)/)
                 @current_resource.version($1)
                 Chef::Log.debug(&quot;Got current version #{$1}&quot;)
                 break</diff>
      <filename>chef/lib/chef/provider/package/portage.rb</filename>
    </modified>
    <modified>
      <diff>@@ -100,7 +100,7 @@ class Chef
             src = &quot;  --source=#{@new_resource.source} --source=http://gems.rubyforge.org&quot;
           end  
           run_command_with_systems_locale(
-            :command =&gt; &quot;#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \&quot;#{version}\&quot;#{src}&quot;
+            :command =&gt; &quot;#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \&quot;#{version}\&quot;#{src}#{opts}&quot;
           )
         end
       
@@ -123,6 +123,12 @@ class Chef
         def purge_package(name, version)
           remove_package(name, version)
         end
+        
+        private
+        
+        def opts
+          expand_options(@new_resource.options)
+        end
       
       end
     end</diff>
      <filename>chef/lib/chef/provider/package/rubygems.rb</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,8 @@ import yum
 
 from yum import Errors
 
+PIDFILE='/var/run/yum.pid'
+
 # Seconds to wait for exclusive access to yum
 lock_timeout = 10
 
@@ -54,7 +56,7 @@ try:
     countdown = lock_timeout
     while True:
       try:
-        y.doLock()
+        y.doLock(PIDFILE)
       except Errors.LockError, e:
         time.sleep(1)
         countdown -= 1 
@@ -80,7 +82,7 @@ try:
 # Ensure we clear the lock.
 finally:
   try:
-    y.doUnlock()
+    y.doUnlock(PIDFILE)
   # Keep Unlock from raising a second exception as it does with a yum.conf 
   # config error.
   except Errors.YumBaseError:</diff>
      <filename>chef/lib/chef/provider/package/yum-dump.py</filename>
    </modified>
    <modified>
      <diff>@@ -70,7 +70,7 @@ class Chef
             end
 
             status = popen4(@node[:command][:ps]) do |pid, stdin, stdout, stderr|
-              stdin.close
+              stdin.close rescue nil
               r = Regexp.new(@new_resource.pattern)
               Chef::Log.debug(&quot;#{@new_resource}: attempting to match #{@new_resource.pattern} (#{r}) against process table&quot;)
               stdout.each_line do |line|</diff>
      <filename>chef/lib/chef/provider/service/freebsd.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,17 +49,15 @@ class Chef
               @current_resource.running false
               nil
             end
-
-          else
-            Chef::Log.debug(&quot;#{@new_resource} does not support status and you have not specified a status command, falling back to process table inspection&quot;)
+          elsif
+            Chef::Log.warn &quot;#{@new_resource}: falling back to process table inspection&quot;
             if @node[:command][:ps].nil? or @node[:command][:ps].empty?
-              raise Chef::Exceptions::Service, &quot;#{@new_resource}: could not determine how to inspect the process table, please set this nodes 'ps' attribute&quot;
+              raise Chef::Exceptions::Service, &quot;#{@new_resource}: could not determine how to inspect the process table, please set this nodes 'command.ps' attribute&quot;
             end
-
             status = popen4(@node[:command][:ps]) do |pid, stdin, stdout, stderr|
-              stdin.close
+              stdin.close rescue nil
               r = Regexp.new(@new_resource.pattern)
-              Chef::Log.debug(&quot;#{@new_resource}: attempting to match #{@new_resource.pattern} (#{r}) against process table&quot;)
+              Chef::Log.warn &quot;#{@new_resource}: attempting to match '#{@new_resource.pattern}' (#{r}) against process list&quot;
               stdout.each_line do |line|
                 if r.match(line)
                   @current_resource.running true
@@ -71,7 +69,7 @@ class Chef
             unless status.exitstatus == 0
               raise Chef::Exceptions::Service, &quot;Command #{@node[:command][:ps]} failed&quot;
             else
-              Chef::Log.debug(&quot;#{@new_resource}: #{@node[:command][:ps]} exited and parsed successfully, process running: #{@current_resource.running}&quot;)
+              Chef::Log.debug &quot;#{@new_resource}: running: #{@current_resource.running}&quot;
             end
           end
 </diff>
      <filename>chef/lib/chef/provider/service/simple.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,10 +37,12 @@ class Chef
       
       def action_checkout
         run_command(run_options(:command =&gt; checkout_command))
+        @new_resource.updated = true
       end
       
       def action_export
         run_command(run_options(:command =&gt; export_command))
+        @new_resource.updated = true
       end
       
       def action_sync
@@ -49,6 +51,7 @@ class Chef
         else
           run_command(run_options(:command =&gt; sync_command))
         end
+        @new_resource.updated = true
       end
       
       def sync_command</diff>
      <filename>chef/lib/chef/provider/subversion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -256,7 +256,18 @@ class Chef
       include Chef::Mixin::ConvertToClassName
       
       def attribute(attr_name, validation_opts={})
-        define_method(attr_name.to_sym) do |arg|
+        # This atrocity is the only way to support 1.8 and 1.9 at the same time
+        # When you're ready to drop 1.8 support, do this:
+        # define_method attr_name.to_sym do |arg=nil|
+        # etc.
+        shim_method=&lt;&lt;-SHIM
+        def #{attr_name}(arg=nil)
+          _set_or_return_#{attr_name}(arg)
+        end
+        SHIM
+        class_eval(shim_method)
+        
+        define_method(&quot;_set_or_return_#{attr_name.to_s}&quot;.to_sym) do |arg|
           set_or_return(attr_name.to_sym, arg, validation_opts)
         end
       end</diff>
      <filename>chef/lib/chef/resource.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,10 +69,9 @@ class Chef
         @remote = &quot;origin&quot;
         @enable_submodules = false
         @shallow_clone = false
-        @force_deploy = false
         @scm_provider = Chef::Provider::Git
         @provider = Chef::Provider::Deploy::Timestamped
-        @allowed_actions.push(:deploy, :rollback)
+        @allowed_actions.push(:force_deploy, :deploy, :rollback)
       end
       
       # where the checked out/cloned code goes
@@ -244,15 +243,6 @@ class Chef
         )
       end
       
-      # Shall we run the deploy even if the code has not changed?
-      def force_deploy(arg=nil)
-        set_or_return(
-          :force_deploy,
-          arg,
-          :kind_of =&gt; [ TrueClass, FalseClass ]
-        )
-      end
-      
       def scm_provider(arg=nil)
         set_or_return(
           :scm_provider,
@@ -357,4 +347,4 @@ class Chef
       
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>chef/lib/chef/resource/deploy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -185,6 +185,8 @@ def create_cookbook(dir)
   sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;recipes&quot;)}&quot; 
   sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;definitions&quot;)}&quot; 
   sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;libraries&quot;)}&quot; 
+  sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;resources&quot;)}&quot; 
+  sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;providers&quot;)}&quot; 
   sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;files&quot;, &quot;default&quot;)}&quot; 
   sh &quot;mkdir -p #{File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;templates&quot;, &quot;default&quot;)}&quot; 
   unless File.exists?(File.join(dir, ENV[&quot;COOKBOOK&quot;], &quot;recipes&quot;, &quot;default.rb&quot;))</diff>
      <filename>chef/lib/chef/tasks/chef_repo.rake</filename>
    </modified>
    <modified>
      <diff>@@ -79,18 +79,37 @@ describe Chef::Provider::Deploy do
     @provider.should_receive(:deploy)
     @provider.action_force_deploy
   end
-  
-  it &quot;sets the release path to the penultimate release, symlinks, and rm's the last release on rollback&quot; do
-    @provider.unstub!(:release_path)
-    all_releases = [&quot;/my/deploy/dir/releases/20040815162342&quot;, &quot;/my/deploy/dir/releases/20040700000000&quot;,
-                    &quot;/my/deploy/dir/releases/20040600000000&quot;, &quot;/my/deploy/dir/releases/20040500000000&quot;].sort!
-    Dir.stub!(:glob).with(&quot;/my/deploy/dir/releases/*&quot;).and_return(all_releases)
-    @provider.should_receive(:symlink)
-    FileUtils.should_receive(:rm_rf).with(&quot;/my/deploy/dir/releases/20040815162342&quot;)
-    @provider.action_rollback
-    @provider.release_path.should eql(&quot;/my/deploy/dir/releases/20040700000000&quot;)
+ 
+  describe &quot;on systems without broken Dir.glob results&quot; do
+    it &quot;sets the release path to the penultimate release, symlinks, and rm's the last release on rollback&quot; do
+      @provider.unstub!(:release_path)
+      all_releases = [ &quot;/my/deploy/dir/releases/20040815162342&quot;,
+                       &quot;/my/deploy/dir/releases/20040700000000&quot;,
+                       &quot;/my/deploy/dir/releases/20040600000000&quot;,
+                       &quot;/my/deploy/dir/releases/20040500000000&quot;]
+      Dir.stub!(:glob).with(&quot;/my/deploy/dir/releases/*&quot;).and_return(all_releases)
+      @provider.should_receive(:symlink)
+      FileUtils.should_receive(:rm_rf).with(&quot;/my/deploy/dir/releases/20040815162342&quot;)
+      @provider.action_rollback
+      @provider.release_path.should eql(&quot;/my/deploy/dir/releases/20040700000000&quot;)
+    end
   end
-  
+
+  describe &quot;CHEF-628: on systems with broken Dir.glob results&quot; do
+    it &quot;sets the release path to the penultimate release, symlinks, and rm's the last release on rollback&quot; do
+      @provider.unstub!(:release_path)
+      all_releases = [ &quot;/my/deploy/dir/releases/20040500000000&quot;,
+                       &quot;/my/deploy/dir/releases/20040600000000&quot;,
+                       &quot;/my/deploy/dir/releases/20040700000000&quot;,
+                       &quot;/my/deploy/dir/releases/20040815162342&quot; ]
+      Dir.stub!(:glob).with(&quot;/my/deploy/dir/releases/*&quot;).and_return(all_releases)
+      @provider.should_receive(:symlink)
+      FileUtils.should_receive(:rm_rf).with(&quot;/my/deploy/dir/releases/20040815162342&quot;)
+      @provider.action_rollback
+      @provider.release_path.should eql(&quot;/my/deploy/dir/releases/20040700000000&quot;)
+    end
+  end
+
   it &quot;raises a runtime error when there's no release to rollback to&quot; do
     all_releases = []
     Dir.stub!(:glob).with(&quot;/my/deploy/dir/releases/*&quot;).and_return(all_releases)</diff>
      <filename>chef/spec/unit/provider/deploy_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -199,13 +199,15 @@ describe Chef::Provider::Git do
     @provider.should_receive(:clone)
     @provider.should_receive(:checkout)
     @provider.should_receive(:enable_submodules)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_checkout
   end
-  
+
   it &quot;does a sync by running the sync command&quot; do
     ::File.stub!(:exist?).with(&quot;/my/deploy/dir&quot;).and_return(true)
     ::Dir.stub!(:entries).and_return(['.','..',&quot;lib&quot;, &quot;spec&quot;])
     @provider.should_receive(:sync)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_sync
   end
   
@@ -213,6 +215,7 @@ describe Chef::Provider::Git do
     ::File.stub!(:exist?).with(&quot;/my/deploy/dir&quot;).and_return(false)
     @provider.should_receive(:action_checkout)
     @provider.should_not_receive(:run_command)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_sync
   end
   
@@ -222,13 +225,15 @@ describe Chef::Provider::Git do
     @provider.stub!(:sync_command).and_return(&quot;huzzah!&quot;)
     @provider.should_receive(:action_checkout)
     @provider.should_not_receive(:run_command).with(:command =&gt; &quot;huzzah!&quot;, :cwd =&gt; &quot;/my/deploy/dir&quot;)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_sync
   end
   
   it &quot;does an export by cloning the repo then removing the .git directory&quot; do
     @provider.should_receive(:action_checkout)
     FileUtils.should_receive(:rm_rf).with(@resource.destination + &quot;/.git&quot;)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_export
   end
   
-end
\ No newline at end of file
+end</diff>
      <filename>chef/spec/unit/provider/git_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,13 +54,13 @@ describe Chef::Provider::Package::Portage, &quot;load_current_resource&quot; do
     @provider.load_current_resource
   end
   
-  it &quot;should return a current resource with a nil version if the package is not found&quot; do
-    ::Dir.stub!(:entries).and_return(&quot;git-1.0.0&quot;)
+  it &quot;should return a current resource with the correct version if the package is found&quot; do
+    ::Dir.stub!(:entries).and_return([&quot;git-foobar-0.9&quot;, &quot;git-1.0.0&quot;])
     @current_resource.should_receive(:version).with(&quot;1.0.0&quot;)
     @provider.load_current_resource
   end
-
-  it &quot;should return a current resource with the correct version if the package is found&quot; do
+  
+  it &quot;should return a current resource with a nil version if the package is not found&quot; do
     ::Dir.stub!(:entries).and_return(&quot;notgit-1.0.0&quot;)
     @current_resource.should_receive(:version).with(nil)
     @provider.load_current_resource</diff>
      <filename>chef/spec/unit/provider/package/portage_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,15 +46,8 @@ end
 describe Chef::Provider::Package::Rubygems, &quot;install_package&quot; do
   before(:each) do
     @node = mock(&quot;Chef::Node&quot;, :null_object =&gt; true)
-    @new_resource = mock(&quot;Chef::Resource::Package&quot;,
-      :null_object =&gt; true,
-      :name =&gt; &quot;rspec&quot;,
-      :version =&gt; &quot;1.2.2&quot;,
-      :package_name =&gt; &quot;rspec&quot;,
-      :updated =&gt; nil,
-      :gem_binary =&gt; nil,
-      :source =&gt; nil
-    )
+    @new_resource = Chef::Resource::GemPackage.new(&quot;rspec&quot;)
+    @new_resource.version &quot;1.2.2&quot;
     @provider = Chef::Provider::Package::Rubygems.new(@node, @new_resource)
   end
 
@@ -67,4 +60,11 @@ describe Chef::Provider::Package::Rubygems, &quot;install_package&quot; do
     })
     @provider.install_package(&quot;rspec&quot;, &quot;1.2.2&quot;)
   end
+  
+  it &quot;installs gems with arbitrary options set by resource's options&quot; do
+    @new_resource.options &quot;-i /arbitrary/install/dir&quot;
+    @provider.should_receive(:run_command_with_systems_locale).
+      with(:command =&gt; &quot;gem install rspec -q --no-rdoc --no-ri -v \&quot;1.2.2\&quot; -i /arbitrary/install/dir&quot;)
+    @provider.install_package(&quot;rspec&quot;, &quot;1.2.2&quot;)
+  end
 end</diff>
      <filename>chef/spec/unit/provider/package/rubygems_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -159,12 +159,14 @@ describe Chef::Provider::Subversion do
   it &quot;runs the checkout command for action_checkout&quot; do
     expected_cmd = &quot;svn checkout -q  -r12345 http://svn.example.org/trunk/ /my/deploy/dir&quot;
     @provider.should_receive(:run_command).with(:command =&gt; expected_cmd)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_checkout
   end
   
   it &quot;does a checkout for action_sync if there's no deploy dir&quot; do
     ::File.should_receive(:exist?).with(&quot;/my/deploy/dir/.svn&quot;).and_return(false)
     @provider.should_receive(:action_checkout)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_sync
   end
   
@@ -172,6 +174,7 @@ describe Chef::Provider::Subversion do
     ::File.should_receive(:exist?).with(&quot;/my/deploy/dir/.svn&quot;).and_return(true)
     ::Dir.should_receive(:entries).with(&quot;/my/deploy/dir&quot;).and_return(['.','..'])
     @provider.should_receive(:action_checkout)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_sync
   end
   
@@ -180,12 +183,14 @@ describe Chef::Provider::Subversion do
     ::Dir.should_receive(:entries).with(&quot;/my/deploy/dir&quot;).and_return(['.','..','the','app','exists'])
     expected_cmd = &quot;svn update -q  -r12345 /my/deploy/dir&quot;
     @provider.should_receive(:run_command).with(:command =&gt; expected_cmd)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_sync
   end
   
   it &quot;runs the export_command on action_export&quot; do
     expected_cmd = &quot;svn export -q  -r12345 http://svn.example.org/trunk/ /my/deploy/dir&quot;
     @provider.should_receive(:run_command).with(:command =&gt; expected_cmd)
+    @resource.should_receive(:updated=).at_least(1).times.with(true)
     @provider.action_export
   end
   </diff>
      <filename>chef/spec/unit/provider/subversion_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -73,7 +73,6 @@ describe Chef::Resource::Deploy do
   resource_has_a_boolean_attribute(:migrate, :defaults_to=&gt;false)
   resource_has_a_boolean_attribute(:enable_submodules, :defaults_to=&gt;false)
   resource_has_a_boolean_attribute(:shallow_clone, :defaults_to=&gt;false)
-  resource_has_a_boolean_attribute(:force_deploy, :defaults_to=&gt;false)
   
   it &quot;uses the first argument as the deploy directory&quot; do
     @resource.deploy_to.should eql(&quot;/my/deploy/dir&quot;)</diff>
      <filename>chef/spec/unit/resource/deploy_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,7 @@ api_nodes_show: --tags nodes_show --format pretty -r features/steps -r features/
 api_nodes_update: --tags nodes_update --format pretty -r features/steps -r features/support features
 client: --tags client --format pretty -r features/steps -r features/support features 
 client_roles: --tags client_roles --format pretty -r features/steps -r features/support features 
+client_run_interval: --tags client_run_interval --format pretty -r features/steps -r features/support features
 search: --tags search --format pretty -r features/steps -r features/support features 
 language: --tags language --format pretty -r features/steps -r features/support features 
 recipe_inclusion: --tags recipe_inclusion --format pretty -r features/steps -r features/support features 
@@ -21,5 +22,6 @@ provider_remote_file: --tags provider,remote_file --format pretty -r features/st
 provider_git: --tags provider,git --format pretty -r features/steps -r features/support features 
 provider_template: --tags template --format pretty -r features/steps -r features/support features
 provider_package_macports: --tags macports --format pretty -r features/steps -r features/support features 
+provider_package_rubygems: --tags rubygems --format pretty -r features/steps -r features/support features 
 lwrp: --tags lwrp --format pretty -r features/steps -r features/support features 
 </diff>
      <filename>cucumber.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-@client
+@client @client_run_interval
 Feature: Run chef-client at periodic intervals 
   In order to ensure a system is always correctly configured 
   As an Administrator</diff>
      <filename>features/chef-client/run_interval.feature</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,14 @@
+Given /^the gems server is running$/ do
+  self.gemserver_thread = Thread.new do
+    trap(&quot;INT&quot;) do 
+      gemserver.shutdown
+      gemserver_thread.join
+    end
+    
+    gemserver.start
+  end
+end
+
 Given /^that I have the (.+) package system installed$/ do |package_system|
   unless package_system_available?(package_system)
     pending &quot;This Cucumber feature will not execute, as it is missing the #{package_system} packaging system.&quot;
@@ -18,3 +29,7 @@ Then /^there should not be a binary on the path called '(.+)'$/ do |binary_name|
     result.should =~ /not found/
   end
 end
+
+Then /^the gem '(.+)' version '(.+)' should be installed$/ do |gem_name, version|
+  Then &quot;a file named 'installed-gems/gems/#{gem_name}-#{version}' should exist&quot;
+end
\ No newline at end of file</diff>
      <filename>features/steps/packages.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,13 +46,13 @@ When /^I run the chef\-client with '(.+)' for '(.+)' seconds$/ do |args, run_for
 end
 
 When /^I run the chef\-client for '(.+)' seconds$/ do |run_for|
-  cid = fork { 
+  cid = Process.fork { 
     sleep run_for.to_i
-    client_pid = `ps ax | grep chef-client | grep -v grep | grep -v rake | grep -v cucumber | awk '{ print $1 }'`
-    Process.kill(&quot;INT&quot;, client_pid.to_i)
+    Process.kill(&quot;INT&quot;, /^(.+chef\-client.+\-i.*)$/.match(`ps -ef`).to_s.split[1].to_i)
+    exit
   } 
   When 'I run the chef-client'
-  Process.waitpid2(cid)
+  Process.wait2(cid)
 end
 
 When /^I run the chef\-client at log level '(.+)'$/ do |log_level|</diff>
      <filename>features/steps/run_client_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,7 @@ require 'chef/client'
 require 'tmpdir'
 require 'merb-core'
 require 'merb_cucumber/world/webrat'
+require 'webrick'
 
 def Spec.run? ; true; end
 
@@ -57,7 +58,9 @@ end
 
 module ChefWorld
 
-  attr_accessor :recipe, :cookbook, :response, :inflated_response, :log_level, :chef_args, :config_file, :stdout, :stderr, :status, :exception
+  attr_accessor :recipe, :cookbook, :response, :inflated_response, :log_level,
+                :chef_args, :config_file, :stdout, :stderr, :status, :exception,
+                :gemserver_thread
 
   def client
     @client ||= Chef::Client.new
@@ -87,11 +90,24 @@ module ChefWorld
     @stash ||= Hash.new
   end
   
+  def gemserver
+    @gemserver ||= WEBrick::HTTPServer.new(
+      :Port         =&gt; 8000,
+      :DocumentRoot =&gt; datadir + &quot;/gems/&quot;,
+      # Make WEBrick STFU
+      :Logger       =&gt; Logger.new(StringIO.new),
+      :AccessLog    =&gt; [ StringIO.new, WEBrick::AccessLog::COMMON_LOG_FORMAT ]
+    )
+  end
+  
 end
 
 World(ChefWorld)
 
 After do
+  gemserver.shutdown
+  gemserver_thread &amp;&amp; gemserver_thread.join
+  
   cleanup_files.each do |file|
     system(&quot;rm #{file}&quot;)
   end</diff>
      <filename>features/support/env.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>47070d66a24905428167cdd67985175f03a38d5b</id>
    </parent>
    <parent>
      <id>cff229140288370dc349ec43a535cd83304ccb1c</id>
    </parent>
  </parents>
  <author>
    <name>Adam Jacob</name>
    <email>adam@opscode.com</email>
  </author>
  <url>http://github.com/opscode/chef/commit/6ced5f1d985d47d49f39b7af10e01c295eefc2a9</url>
  <id>6ced5f1d985d47d49f39b7af10e01c295eefc2a9</id>
  <committed-date>2009-10-29T08:17:48-07:00</committed-date>
  <authored-date>2009-10-29T08:17:48-07:00</authored-date>
  <message>Merge branch 'master' into 0.8-alpha

All tests pass.

Conflicts:

	chef-server-slice/Rakefile
	chef-server/Rakefile
	chef/Rakefile
	chef/lib/chef.rb
	chef/lib/chef/provider/cron.rb
	chef/lib/chef/provider/service/freebsd.rb
	chef/lib/chef/provider/service/simple.rb
	chef/spec/unit/provider/deploy_spec.rb
	cucumber.yml
	features/support/env.rb</message>
  <tree>4d126fd1d30aa1feb9308f03e3ed61aa0cbd44ae</tree>
  <committer>
    <name>Adam Jacob</name>
    <email>adam@opscode.com</email>
  </committer>
</commit>
