Skip to content

Ruby Library and Command Line tools for bagit

License

Notifications You must be signed in to change notification settings

ruby-microservices/bagit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BagIt (for ruby)

Based on the BagItspec v0.96.

Supported Features:

  • bag compiling
  • manifest & tagmanifest generation
  • generation of tag files bag-info.txt and bagit.txt
  • fetching remote files (fetch.txt)
  • bag validation

Installation

% gem install bagit validatable

The rubyforge gem is deprecated.

Example: making a bag

require 'bagit'

# make a new bag at base_path
bag = BagIt::Bag.new base_path

# make a new file
bag.add_file("samplefile") do |io|
  io.puts "Hello Bag!"
end

# generate the manifest and tagmanifest files
bag.manifest!

Example: validating an existing bag

bag = BagIt::Bag.new existing_base_path

if bag.valid?
  puts "#{existing_base_path} is valid"
else
  puts "#{existing_base_path} is not valid"
end

TODO

  • command line tools for common tasks
  • better holy bag (fetch.txt) generation
  • better error reporting.
  • poor mans' checksum

Copyright © 2009, Francesco Lazzarino.

Sponsored by Florida Center for Library Automation.

See LICENSE.txt for terms.

About

Ruby Library and Command Line tools for bagit

Resources

License

Stars

Watchers

Forks

Packages

No packages published