ragalie / lisbn Goto Github PK
View Code? Open in Web Editor NEWISBN manipulation helpers
License: MIT License
ISBN manipulation helpers
License: MIT License
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
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.
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:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.