0.0
No commit activity in last 3 years
No release in over 3 years
Parses and extracts useful information from Diamond Comic Distributor's invoice files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.7
 Project Readme

DiamondInvoice

Does some trivial parsing of the email invoice format used by Diamond Comic Distributors.

Dedication

Adapted from some really old PHP code I wrote really early in my career for Comic Town in Columbus, OH. If you're ever in Columbus and need comics, give them a visit.

Installation

gem install diamond_invoice

Usage

First, create a new DiamondInvoice and give it your emailed invoice, as a string.

@invoice = DiamondInvoice.new(File.read('path_to_invoice.txt'))

Fetch a list of incoming items as an all-lowercase array.

@invoice.new_titles

# => ["amazing spider-man #62", "animal man #2", ... ]

Got some books you don't want to see in the list? Ignore them like so:

# Ignore any title that contains "adult supplement."
# Case insensitive, matches if the keyword apepars anywhere in the title.
@invoice.excluded_titles << "adult supplement" 

Feature Request

At the moment, it won't do anything magical: no expanding abbreviations or cleaning up shoddy titles, nor will it pull anything else out of the invoice line.

Have a suggestion for a feature? Add it to the list

Testing

$ rake 

Requires rspec ~> 2.7

Contributing

  1. Fork it
  2. Create a branch (git checkout -b my_feature_or_bugfix)
  3. Commit your changes (git commit -am "Description of my change.")
  4. Push to your branch (git push origin my_feature_or_bugfix)
  5. Send a pull request

License

See the LICENSE file.