<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -20,4 +20,8 @@ stats = dep_resolver.stats
 WarningShot::Growl.say stats.to_a.join('/') if config[:growl]
 
 #Return an exit status based on number of unresolved dependencies
-exit(stats[:unresolved])
\ No newline at end of file
+if config[:resolve]
+  exit(stats[:unresolved])
+else
+  exit(stats[:failed])
+end
\ No newline at end of file</diff>
      <filename>bin/warningshot</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ class WarningShot::DirectoryResolver
   typecast Hash do |yaml|
     DirectoryResource.new File.expand_path(yaml[:target])
   end
-  
+
   register :test do |dep|
     dir_found = File.directory? dep.target
     if dir_found</diff>
      <filename>lib/resolvers/directory_resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ class WarningShot::FileResolver
 
   branch :file
   description 'Validates presence of files'
-  
+
   # Define FileResource struct
   FileResource = Struct.new(:source,:target) do
     def exists?;File.exists?(File.expand_path(target.path));end;
@@ -73,7 +73,7 @@ class WarningShot::FileResolver
     end
     file.exists?
   end
-  
+
   register(:resolution, { :name =&gt; :https_protocol_resolver,
     :desc =&gt; &quot;Resolves files via HTTPS&quot;,
     :if =&gt; lambda { |file| !!(file.source.to_s =~ /https/i)}</diff>
      <filename>lib/resolvers/file_resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ class WarningShot::GemResolver
   add_dependency :core, 'rubygems/dependency_installer'
   add_dependency :core, 'rubygems/uninstaller'
   add_dependency :core, 'rubygems/dependency'
-  
+
   order  100
   branch :gem
   description 'Installs ruby gems and their dependencies'
@@ -34,7 +34,7 @@ class WarningShot::GemResolver
 
       installer = Gem::DependencyInstaller.new({
         :user_install =&gt; false,
-        :install_dir =&gt; Gem.path.first
+        :install_dir =&gt; Gem.dir
       })
 
       begin
@@ -54,7 +54,7 @@ class WarningShot::GemResolver
     def uninstall!
       opts = {
         :user_install =&gt; false,
-        :install_dir =&gt; Gem.path.first,
+        :install_dir =&gt; Gem.dir,
         :version  =&gt; self.version
       }
       WarningShot::GemResolver.update_source_index(opts[:install_dir])
@@ -103,12 +103,15 @@ class WarningShot::GemResolver
     Gem.configuration.update_sources = !!(self.config[:update_sources])
     
     if self.config.key?(:gem_path) &amp;&amp; !self.config[:gem_path].nil?
-      gem_dirs = self.config[:gem_path].split(':')
-      gem_dirs.reverse.each do |path|
-        Gem.path.unshift File.expand_path(path)
-      end
- 
-      WarningShot::GemResolver.update_source_index *gem_dirs
+      #make sure user paths are expanded
+      tmp_paths = self.config[:gem_path].split(&quot;:&quot;).collect! do |gp|
+        File.expand_path(gp)
+      end.join(&quot;:&quot;)
+
+      Gem.send :set_paths, tmp_paths + &quot;:&quot; + Gem.path.join(&quot;:&quot;)
+      Gem.send :set_home, Gem.path.first
+
+      WarningShot::GemResolver.update_source_index *Gem.path
     end
   end
     </diff>
      <filename>lib/resolvers/gem_resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -47,7 +47,7 @@ class WarningShot::IntegrityResolver
   end
   
   register(:test,{:name=&gt;:md5_digest_test,
-    :if =&gt; lambda{|dep| dep.digest_method == :md5}  
+    :if =&gt; lambda{|dep| dep.digest_method == :md5}
   })do |dep|
     dep_ok = (dep.exists? ? Digest::MD5.hexdigest(File.read(File.expand_path(dep.target.path))) == dep.digest : false)
 </diff>
      <filename>lib/resolvers/integrity_resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -71,11 +71,10 @@ class WarningShot::PermissionResolver
       chown_params = [nil, tgt_gid, self.target]
 
       if(File.symlink?(self.target) &amp;&amp; (self.no_follow == 'both' || self.no_follow == 'chown'))
-        #DOcumenation for FileUtils.chown_R is wrong (at least for Ubuntu 8.1, takes ID as String.)
-        chown_params[1] = chown_params[1].to_s
         File.lchown *chown_params
       elsif(self.stat(:ftype) == 'directory' &amp;&amp; (self.recursive == 'both' || self.recursive == 'chown'))
-        c
+        #DOcumenation for FileUtils.chown_R is wrong (at least for Ubuntu 8.1, takes ID as String.)
+        chown_params[1] = chown_params[1].to_s
         FileUtils.chown_R *chown_params
       else
         File.chown *chown_params</diff>
      <filename>lib/resolvers/permission_resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,18 +16,18 @@ module WarningShot
       self.init_logger
       WarningShot.load_app(self[:application])
       WarningShot.load_addl_resolvers(self[:resolvers])
-            
+
       # Parsed yml files
       self.load_configs
       @dependency_tree.symbolize_keys!
     end
-        
+
     def [](k)
-      @config[k]  
+      @config[k]
     end
-        
+
     # gets stats of all resolvers
-    # @return [Hash] 
+    # @return [Hash]
     #   :passed, :failed, :resolved, :unresolved
     #
     # @api public
@@ -35,23 +35,23 @@ module WarningShot
       _stats = {
         :passed =&gt; 0, :failed =&gt; 0, :resolved =&gt; 0, :unresolved =&gt; 0
       }
-      
+
       resolvers.each do |resolver|
         _stats[:passed]     += resolver.passed.size
         _stats[:failed]     += resolver.failed.size
         _stats[:resolved]   += resolver.resolved.size
         _stats[:unresolved] += resolver.unresolved.size
       end
-      
+
       _stats
     end
-    
+
     # initializes the logger
-    # 
+    #
     # @api private
     def init_logger
       FileUtils.mkdir_p(File.dirname(File.expand_path(self[:log_path]))) unless self[:verbose]
-      
+
       @logger = Logger.new(
         self[:verbose] ? STDOUT : self[:log_path], 10, 1024000
       )
@@ -63,7 +63,7 @@ module WarningShot
       @logger.formatter = _formatter
       @logger.level     = Object.class_eval(&quot;Logger::#{_log_level}&quot;)
     end
-    
+
     # runs all loaded resolvers
     #
     # @api private
@@ -71,52 +71,53 @@ module WarningShot
       @logger.info &quot;WarningShot v. #{WarningShot::VERSION}&quot;
       @logger.info &quot;Environment: #{self.environment}; Application: #{WarningShot.application_type}&quot;
       @logger.info &quot;On host: #{WarningShot.hostname}&quot;
-      
+
       WarningShot::Resolver.descendants.each do |klass|
         next if klass.disabled?
-        
+
         klass.logger = @logger
         klass.logger.info &quot;\n#{'-'*60}&quot;
-        klass.logger.info &quot;#{klass.name}; branch: #{klass.branch.join(',')} [TESTING]&quot;
 
         #Process each branch for the Resolver Class (klass)
         klass.branch.each do |branch_name|
           branch = @dependency_tree[branch_name.to_sym]
 
           if branch.nil?
-            klass.logger.info &quot;[SKIPPING] #{klass}, #{branch_name}; No machine recipes were registered&quot;
+            klass.logger.info &quot;[SKIPPING] #{klass}, #{branch_name}; No recipes were registered&quot;
             next
           elsif branch.empty?
-            klass.logger.info &quot;[SKIPPING] #{klass}, #{branch_name}; No dependencies in machine recipe&quot;
+            klass.logger.info &quot;[SKIPPING] #{klass}, #{branch_name}; No dependencies in recipe&quot;
             next
           end
-        
-          resolver = klass.new(@config,branch_name.to_sym,*branch)          
+
+          resolver = klass.new(@config,branch_name.to_sym,*branch)
           @resolvers &lt;&lt; resolver
-        
+
+
+          klass.logger.info &quot;#{klass.name}; branch: #{resolver.current_branch} [TESTING]&quot;
           # Start test
           klass.before_filters(:test).each{|p| p.call}
           resolver.test!
           klass.after_filters(:test).each{|p| p.call}
-        
+
           klass.logger.info &quot;Passed: #{resolver.passed.size} / Failed: #{resolver.failed.size}&quot;
 
           if self[:resolve] &amp;&amp; !klass.resolutions.empty?
             klass.logger.info &quot;#{resolver.class}; branch: #{resolver.current_branch} [RESOLVING]&quot;
 
-            klass.before_filters(:resolution).each{|p| p.call}        
-            resolver.resolve! 
+            klass.before_filters(:resolution).each{|p| p.call}
+            resolver.resolve!
             klass.after_filters(:resolution).each{|p| p.call}
-          
+
             klass.logger.info &quot;Resolved: #{resolver.resolved.size} / Unresolved: #{resolver.unresolved.size}&quot;
           end
         end #Branch Loop
       end #Resolver Class Loop
-      
+
       @logger.info &quot;\nResults:&quot;
       stats.each {|k,v| @logger.info(&quot; ~ #{k}: \t#{v}&quot;)}
     end
-    
+
     protected
     # Loads configuration files
     #
@@ -134,14 +135,15 @@ module WarningShot
         end
       end
     end
-    
+
+
     # parses dependencies info from a yaml file
     #
     # @param file [String]
     #   File path to parse
     #
     # @notes
-    #   yaml file should contain an array of configs, 
+    #   yaml file should contain an array of configs,
     #     get name of each config set, find global and current environment
     #     from set, merge into dependency_tree
     #
@@ -149,13 +151,15 @@ module WarningShot
     def parse_yml(file)
       #if only on branch is specified in a yaml file it may not come back as an array
       branches  = YAML::load(File.open(file,'r'))
-      
+
       if branches === false
         @logger.error &quot;Skipping malformed Yaml file: #{file}&quot;
         return
       end
-      
+
+      #Support for multiple dep branches in one file
       branches = [branches] unless branches.is_a? Array
+
       branches.each do |branch|
         branch_name = branch[:branch]
         dependency_tree[branch_name] ||= []
@@ -163,15 +167,15 @@ module WarningShot
         #Add current environment's configs to branch
         current_env = branch[:environments][@environment]
         @dependency_tree[branch_name].concat(current_env) unless current_env.nil?
-        
+
         #Add global environment's configs to branch
         global = branch[:environments][:global]
         @dependency_tree[branch_name].concat(global) unless global.nil?
-        
+
         #remove nil's if they made it into branch somehow (bad yaml probably)
         @dependency_tree[branch_name].delete(nil)
       end
     end
-      
+
   end
 end
\ No newline at end of file</diff>
      <filename>lib/warningshot/dependency_resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,8 @@ module WarningShot
       #   The missing GEMS can be installed with: warningshot --build-deps
       #   All resolvers' dependencies can be viewed with: warningshot --list-deps
       #
+      #   Note: add_dependency is essentially a replacement for 'require' when writing Resolvers
+      #
       # @param type [Symbol[:core|:gem]]
       #   the type of library it depends on, core lib or gem
       #</diff>
      <filename>lib/warningshot/resolver.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ module WarningShot
     :images     =&gt; 'images',
     :resolvers  =&gt; 'lib' / 'resolvers'
   }
-  
+
   RecipeExt = &quot;*.{yml,yaml}&quot;.freeze
   
   class &lt;&lt; self
@@ -28,7 +28,7 @@ module WarningShot
     def hostname
       `hostname`.strip
     end
-    
+
     # Gets the absolute path for a resource.
     # if it is not listed in PATHS then the string is appended to
     # WarningShot.root
@@ -47,9 +47,9 @@ module WarningShot
     
     def platform
       case ::Config::CONFIG['host_os']
+      when /linux/i: :linux
       when /darwin/i: :mac
       when /mswin|windows/i: :windows
-      when /linux/i: :linux
       when /sunos|solaris/i: :solaris
       else
         :unknown
@@ -172,7 +172,7 @@ module WarningShot
     def load_app(app)
       Dir.chdir app
     end
-    
+
     # Loads any additional resolvers specified by --resolvers= or self[:resolvers]
     def load_addl_resolvers(resolver_paths)
       resolver_paths.each do |resolver_path|</diff>
      <filename>lib/warningshot/warning_shot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,10 @@
 #      - { target: &quot;./public/this.txt&quot;, source: &quot;http://example.com/index.html&quot;}
 #      - { target: &quot;file:///tmp/somefile.txt&quot;, source: &quot;~/.secret/file.txt&quot;}
 
+# The IntegrityResolver piggybacks on the FileResolver.  And MD5 or SHA1 hash can be specified
+# - {target: &quot;/path/to/file.txt&quot;, md5: &quot;MY_MD5&quot;}
+# - {target: &quot;/path/to/file.txt&quot;, sha1: &quot;MY_SHA1&quot;}
+
 # The PermissionResolver piggybacks on the FileResolver, SymlinkResolver and DirectoryResolver.
 #  Each of the config files associated with those resolvers can include the following
 #  options in their hash to be parsed by the permission resolver.  So you will not generally have a 'permission.yml' file.
@@ -33,7 +37,8 @@
 ---
 - :branch: file
   :environments: 
-    :development: []
+    :development:
+      - { target: &quot;http://example.com/tmp/somefile.txt&quot;, source: &quot;~/.secret/file.txt&quot;, mode: &quot;777&quot;, user: &quot;www-data&quot;, group: &quot;www-data&quot;, sha1: &quot;picklepastaarmymassacre&quot;}
     :global: []
     :test: []
     :qa: []</diff>
      <filename>templates/files.yml</filename>
    </modified>
    <modified>
      <diff>@@ -87,7 +87,7 @@ describe WarningShot::GemResolver do
     resolver.resolved.first.version.to_s.should == dummy_gem[:version]
   end
 
-  it 'should be able to determine if a gem is installed in the default gem path' do
+  it 'should be able to determine if a gem is installed in the default gem path (probably needs SUDO)' do
     Gem.clear_paths
     config = WarningShot::Config.create
     dummy_gem = {:name =&gt; &quot;ws-dummy&quot;, :version=&gt;&quot;= 0.2.0&quot;}</diff>
      <filename>test/spec/unit/resolvers/gem_resolver_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e70878623ead269f1bb0301b3f70a03411fc83c1</id>
    </parent>
  </parents>
  <author>
    <name>Cory ODaniel</name>
    <email>contact@coryodaniel.com</email>
  </author>
  <url>http://github.com/coryodaniel/warningshot/commit/3ee7a37939e215bd2157e444a8b3cff632397701</url>
  <id>3ee7a37939e215bd2157e444a8b3cff632397701</id>
  <committed-date>2009-02-02T19:52:45-08:00</committed-date>
  <authored-date>2009-02-02T19:52:45-08:00</authored-date>
  <message>gem updates whitespace removal</message>
  <tree>363857899e8e921a8ae5b573993e478785156506</tree>
  <committer>
    <name>Cory ODaniel</name>
    <email>contact@coryodaniel.com</email>
  </committer>
</commit>
