Git Product home page Git Product logo

lisbn's People

Contributors

ataber avatar jbutton avatar ragalie avatar slimdave avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lisbn's Issues

Compatibility with Ruby 3.1.0 and Rails 7

Getting the following error related to this gem when starting the app..

/Users/sambit/.gem/ruby/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:63:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'lisbn'. (Bundler::GemRequireError)
19:27:42 rails.1 | Gem Load Error is: Tried to load unspecified class: Range

Question about .valid? method

Hello.
I think the ".valid?" method is not accurate.
as I can see it's only checking simple regexp isbn.match(/^[0-9]{13}$/) and checksum

It doesn't work well for many ISBNs, for example 8830114722800 - it is mark as valid but it is not:

https://isbnsearch.org/search?s=8830114722800

For now I can use workaround:
if lisbn.parts.nil? && lisbn.parts(4).nil?
then it is invalid.

I would like to look around for proper ISBN validation rules, and use it in ".valid?" method. I will do the research.

lisbn.rb:137:in `parse': undefined method `convert_tags?' for Nori:Class

When used with nori 2.0.3, lisbn produces the following error:

/Users/john/Development/collect/lisbn/lib/lisbn/lisbn.rb:137:in `parse': undefined method `convert_tags?' for Nori:Class (NoMethodError)
    from /Users/john/Development/collect/lisbn/lib/lisbn/lisbn.rb:120:in `ranges'
    from /Users/john/Development/collect/lisbn/lib/lisbn/lisbn.rb:144:in `<class:Lisbn>'
    from /Users/john/Development/collect/lisbn/lib/lisbn/lisbn.rb:1:in `<top (required)>'

Two options:

  • specify nori ~> 1.1.4 in the gemspec, or
  • figure out the issue and update lisbn to work with 2.0.3

isbn10_parts method - nice to have

Currently "parts" method is splitting ISBN in ISBN13 format.
I need all ISBN display variations - also hyphenated ISBN10 .

Example output:
isbn = "832100928X"
lisbn = Lisbn.new(isbn)
lisbn.parts.join('-') => 978-83-210-0928-5

lsbn.isbn10_parts.join('-') => 83-210-0928-X

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.