Filter a hash to use for digest
 @return [Hash] to use for digest
193181
def digestable_hash
      @item.slice(CLASS_KEY, QUEUE_KEY, UNIQUE_ARGS_KEY).tap do |hash|
        hash.delete(QUEUE_KEY) if unique_across_queues?
        hash.delete(CLASS_KEY) if unique_across_workers?
      end
    end
640996
function(hash) {
	return function(row) {
		var testValue = function(value, rowValue) {
			if (value === '*' || value === '' || !value) {
				return true;
			}
			if (_.isString(rowValue)) {
				return (rowValue.toLowerCase() === value.toLowerCase());
			}
			if (_.isArray(rowValue)) {
				return (_.contains(_.map(rowValue, function(tag) {
					return _.isString(tag) && tag.toLowerCase();
				}), value.toLowerCase()) && true);
			}
			return false;				
		};
		
		// _.all makes sure all members of the hash pass
		return _.all(hash, function(value, key) {
			var rowValue = row.getAlias(key);
			
			if (rowValue) {
				
				// if the filter value is an array, then the rowValue must also be an array
				if (_.isArray(value) && _.isArray(rowValue)) {
					
					// expression is true if rowValue intersects completely with requested value.
					return _.intersection(value, rowValue).length === value.length;
				}

				// if the value is an array, but not the rowValue, only test the first index;
				return testValue(_.isArray(value) ? value[0] : value, rowValue)
			}
			return false;
		});
	};
}
1351122
def where(hash)
      res = hash.inject(squares) do |memo, (attribute, value)|
        memo.select { |square| square.attribute_match?(attribute, value) }
      end
      self.class.new(squares: res)
    end
1169913
def hash_block
      hash_string = [index,timestamp,data,prev_hash].join
      sha = Digest::SHA256.new
      sha.update(hash_string)
      sha.hexdigest
    end
509546
def normalize_hash(hash)
      new_hash = {}

      hash.each do |key,value|
        new_hash[key.to_sym] = normalize(value)
      end

      return new_hash
    end
847320
def hash_of?(key_clause, value_clause)
      all_keys   = many_with_map?(key_clause, "all keys")     { |kv| kv[0] }
      all_values = many_with_map?(value_clause, "all values") { |kv| kv[1] }
      all? Hash, all_keys, all_values
    end
15635
def update_digest

    path = self.bundle_dir
    sha = Digest::SHA2.new
    bundle_sha = Digest::SHA2.new

    digests = []
    Dir.glob("#{path}/**/*").sort.each do |f|
      next if File.directory?(f) || File.basename(f) == "digest" || f =~ /^#{path}\/test/
      bundle_sha.file(f)
      sha.reset()
      digests << { :file => f.gsub(/#{path}\//, ''), :digest => sha.file(f).hexdigest() }
    end

    @digest = { :digest => bundle_sha.hexdigest(), :files => digests }
    File.open(path+"/digest", 'w'){ |f|
      f.write(MultiJson.dump(@digest, :pretty => true, :adapter => :json_gem) + "\n")
    }

  end
310793
def each_filter
            filters = self.Filter

            return enum_for(__method__) do
                case filters
                when NilClass then 0
                when Array then filters.length
                else
                    1
                end
            end unless block_given?

            return if filters.nil?

            if filters.is_a?(Array)
                filters.each do |filter| yield(filter) end
            else
                yield(filters)
            end

            self
        end
1270927
def markdown(*args, &block)
      filter(Rake::Pipeline::Web::Filters::MarkdownFilter, *args, &block)
    end
1080912
def filter_results(hash)
      return [] if hash.blank?
      h = []
      hash.each do |k,v|
        h << k if k.post_type != 'autosave'
      end
      h
    end
970765
def set_hash(self, algo, digest):
        """"""
        self.algo = algo
        self.digest = digest
962713
def recurse_where(where_arr)
      result_arr = []
      where_arr.each do |val|
        if val.is_a? Hash
          result_arr << filters_from_key_value_pair(val)
        elsif val.is_a? Array
          result_arr << "(#{recurse_where(val)})"
        elsif val.is_a? String
          result_arr << val
        else
          raise "Recursive where undefined error."
        end
      end
      result_arr.join(" ")
    end
72406
def index_signature
      require 'digest'

      Digest::SHA256.new.hexdigest(@gems.keys.sort.join(',')).to_s
    end
102006
def to_hash
      {
        :repository   => repository.name,
        :model        => model.name,
        :fields       => fields,
        :links        => links,
        :conditions   => conditions,
        :offset       => offset,
        :limit        => limit,
        :order        => order,
        :unique       => unique?,
        :add_reversed => add_reversed?,
        :reload       => reload?,
      }
    end
34539
def api_hash(replace = nil)
      self.replace = replace unless replace.nil?
      {
        url:          href,
        description:  description,
        extended:     extended,
        tags:         tag.join(" "),
        replace:      replace,
        shared:       shared,
        toread:       toread
      }.select { |key, value| ! value.nil? }
    end
674254
def digest_io(io)
      digester = Digest::SHA1.new

      while buffer = io.read(1024)
        digester.update(buffer)
      end

      io.rewind

      Base64.encode64(digester.digest)
    end
677879
def filter(predicate=nil, &block)
      pred = Yargi::Predicate.to_predicate(predicate, &block)
      extend_result(self.select{|e| pred===e})
    end