isbn

2.0.11last stable release 9 years ago
Complexity Score
Low
Open Issues
N/A
Dependent Projects
3
Weekly Downloadsglobal
183

Keywords

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

isbn

Version 2.0

Introduction

This library provides methods to manipulate isbns. As of version 2.0 there has been a near complete rewrite of this library but this time there are tests. A few methods have been removed. Here is what remains:

Prerequisites

It depends on the LibJpeg and Gocr libraries. Recommended Homebrew.

brew install libjpeg
brew install gocr

Installing ISBN

Installing via Bundler

Add to your Gemfile:

gem 'isbn'

Then run:

bundle install

Installing via RubyGems

Run:

gem install isbn

Using ISBN

  • ISBN.ten will return a 10 digit isbn if you give it a 10 or 13 digit isbn

    • it will raise a No10DigitISBNAvailable error if given an isbn starting with 979 because 979 isbns do NOT have a 10 digit counterpart.
  • ISBN.thirteen will return a 13 digit isbn if you give it 10 or thirteen digit isbn

  • ISBN.as_used will convert an isbn into the used book version for that isbn

    • for isbns starting with 978 it returns an isbn starting with 290
    • for isbns starting with 979 it returns an isbn starting with 291
  • ISBN.as_new will convert an isbn into the new book version for that isbn

    • for isbns starting with 290 it returns an isbn starting with 978
    • for isbns starting with 291 it returns an isbn starting with 979
  • ISBN.valid? will compare the check digit of the passed in isbn with that of one it computes

  • ISBN.from_image accept a jpeg of an isbn and OCR it into an isbn.

    • it depends on the LibJpeg and Gocr libraries. I recommend Homebrew.
  • ISBN.from_string fetches isbn from string

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
3.20
Test Coverage
No Data
Follows Semver
Yes
Github Stars
44
Dependenciestotal
0
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute isbn in your own private RubyGems registry

gem install isbn
Processing...
Done

13 Releases

RubyGems on Cloudsmith

Getting started with RubyGems on Cloudsmith is fast and easy.