package

github.com/nodanaonlyzuul/bagit-cr

master / published Dec 7, 2016 / repository

A proof-of-concept to write a bagit validation tool in crystal.

bagit-cr

This is a bagit validator.

It's not ready for production but I am using this project to get acquainted with the crystal programming language.

Building

  • Install the crystal compiler.

  • clone this repository and build with crystal build --release src/bagit_validator.cr from the project's root. This will output the executable bagit_validator.

Usage

$ ./bagit_validator ~/Desktop/good_bag
This bag is valid

$ ./bagit_validator ~/Desktop/bag-with-bad-checksum
This bag is not valid:malformed checksum for: picard.jpeg

$ ./bagit_validator ~Desktop/bag-with-stranger-in-manifest
This bag is not valid:manifest lists file not contained in bag: imnothere.jpg

Contributing (please)

  1. Fork it (https://github.com/nodanaonlyzuul/bagit-cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Please write tests to backup your work.

Contributors

Acknowledgements

This is based on the Ruby gem tipr/bagit. I am just trying to see how fast a crystal implementation will validate compared to Ruby's.

API