fnando / cpf_cnpj Goto Github PK
View Code? Open in Web Editor NEW🇧🇷 Validate, generate and format CPF/CNPJ numbers. Include command-line tools.
License: MIT License
🇧🇷 Validate, generate and format CPF/CNPJ numbers. Include command-line tools.
License: MIT License
Example, CPF: 062.446.680-90
Loading development environment (Rails 5.2.1)
2.5.3 :001 > require "cpf_cnpj"
=> false
2.5.3 :002 > CPF.valid?(06244668090)
Traceback (most recent call last):
SyntaxError ((irb):2: Invalid octal digit)
CPF.valid?(06244668090)
^~~~~~~~
Tryed to install your gem using bundle install cpf_cnpj
and received the following message: cpf_cnpj's executable "cnpj" conflicts with cpf_faker
, anny glue to solve it without overriding cpf_faker?
Let me know if is still working, I couldn't use it with ActiveRecord (using validators).
I've been using CPF only for a while, and copied into a AMD wrapper in order to use with my requirejs project.
I was wondering why are both provided together. Since most of the times I was using CPF into my projects, It would be CPF only.
CPF.valid? 'Luisa Maria', strict: true
#=> true
This code above returns "true", but the correct return value is "false". This because any CPF with letters is not a valid CPF.
Olá,
Instalei a gem no meu projeto ruby de versão 1.8.7, mas a validação de CPF parece não estar funcionando, pois sempre retorna FALSE, independente do CPF ser válido ou não.
Devido a versão do ruby (1.8.7), eu tive que refatorar a classe CPF substituindo o symbol :strict por uma variável strict, caso contrário dava erro na gem.
Não sei se foi por essa causa, a validação sempre retorna erro. Sabe de alguma versão da gem compatível com o ruby 1.8.7 que eu poderia instalar?
Obrigado,
Guilherme
I'm using version 0.4.1 and method .valid? is always return nil
Rails 3.2.21 and ruby 2.1.5p273
In my model, I create unique index for CPF/CNPJ, and when I use CPF/CNPJ.generate in RSpec, not generate unique CPF/CPNJ and give validation error in Factory.
CPF 012.345.678-90
should be on the blacklist, right?
More details: #18
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.