Sha256: 46bab71e58d6f161d610f9e9ee6b00978fc5a3c1a2f3ad61a903074b487bd367

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

# Petrarca

This library Petrarca provides some utility functions to manipulate ISBN numbers:

- Validation
- Calculate check digit
- Mutual conversion of ISBN-13 and ISBN-10
- Hyphenation

All functions support both ISBN-13 and ISBN-10.

Note: Only registrant ranges for Japan are currently supported.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'petrarca'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install petrarca

## Usage

    irb(main):001:0> require 'petrarca'
    => true
    irb(main):002:0> Petrarca.valid?("978-4-8156-0644-2")
    => true
    irb(main):003:0> Petrarca.calc_check_digit("978-4-8156-0644-2")
    => "2"
    irb(main):004:0> Petrarca.to_10("978-4-8156-0644-2")
    => "4-8156-0644-7"
    irb(main):005:0> Petrarca.to_13("4-8156-0644-7")
    => "978-4-8156-0644-2"
    irb(main):006:0> Petrarca.hyphenate("9784815606442")
    => "978-4-8156-0644-2"

## License

MIT License

## Contributing

Bug reports and pull requests are welcome on GitHub at
https://github.com/takatoh/Petrarca.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
petrarca-0.3.0 README.md
petrarca-0.2.0 README.md