Sha256: 1ddceaddfe211ecc894d99b093f3226a91878959569495d092ed88e8782541dd

Contents?: true

Size: 396 Bytes

Versions: 2

Compression:

Stored size: 396 Bytes

Contents

class Hybag::BulkIngester
  include Enumerable
  def initialize(directory)
    @bags = Dir.glob(File.join(directory,"*")).select{|f| File.directory? f}.map{|x| BagIt::Bag.new(x) unless !File.exists?(File.join(x, "bagit.txt"))}.compact
  end

  def each
    return enum_for(:each) unless block_given?
    @bags.each do |bag|
      yield Hybag::Ingester.new(bag) if bag.complete?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hybag-0.2.0 lib/hybag/bulk_ingester.rb
hybag-0.1.1 lib/hybag/bulk_ingester.rb