dni_nie 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/dni_nie +13 -2
- data/lib/dni_nie.rb +4 -3
- metadata +14 -10
- checksums.yaml +0 -7
data/bin/dni_nie
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# -*- coding: utf-8 -*-
|
3
|
+
# @author:L. Jacob Mariscal Fernández ; Snk Corp
|
3
4
|
require 'dni_nie'
|
4
5
|
|
5
6
|
args = ARGV.dup
|
@@ -17,7 +18,12 @@ case args[0]
|
|
17
18
|
|
18
19
|
if (/es_.*/.match(ENV["LANG"])) # detecta español en consola
|
19
20
|
puts <<EOS
|
20
|
-
DniNie versión 0.3.
|
21
|
+
DniNie versión 0.3.9 - Software GPL-3.0
|
22
|
+
Este programa no proporciona NINGUNA GARANTÍA, tenga precución;
|
23
|
+
Esto es software libre, y usted es libre de redistribuir este programa
|
24
|
+
bajo ciertas condiciones;
|
25
|
+
Ver https://www.gnu.org/licenses/gpl.html para detalles de licencia.
|
26
|
+
|
21
27
|
Una gema Ruby para la verficación de documentos DNI/NIE
|
22
28
|
|
23
29
|
Uso:
|
@@ -32,7 +38,12 @@ EOS
|
|
32
38
|
else
|
33
39
|
puts <<EOS
|
34
40
|
|
35
|
-
DniNie 0.3.
|
41
|
+
DniNie 0.3.9 version - GPL-3.0 software
|
42
|
+
This program comes with ABSOLUTELY NO WARRANTY;
|
43
|
+
This is free software, and you are welcome to redistribute it
|
44
|
+
under certain conditions;
|
45
|
+
See https://www.gnu.org/licenses/gpl.html for details.
|
46
|
+
|
36
47
|
A Ruby gem to handle Spanish Identity Documents
|
37
48
|
|
38
49
|
Usage:
|
data/lib/dni_nie.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# LETRA | LETTER N J Z S Q V H L C K E
|
16
16
|
# X → 0 ,Y → 1, Z → 2
|
17
17
|
# más información | more info DNI-NIE http://www.interior.gob.es/web/servicios-al-ciudadano/dni/calculo-del-digito-de-control-del-nif-nie (Spanish)
|
18
|
-
# @version 0.3.
|
18
|
+
# @version 0.3.9
|
19
19
|
# @author Luis Jacob Mariscal Fernández
|
20
20
|
|
21
21
|
module DniNie
|
@@ -51,7 +51,7 @@ def self.transform(doc) # da formato conveniente a la entrada
|
|
51
51
|
if doc.length > 8
|
52
52
|
raise ArgumentError, "Entrada errónea, número de identificación demasiado grande | Wrong identification number, too long"
|
53
53
|
end
|
54
|
-
doc.gsub!(/\D/, '') # expresión regular,
|
54
|
+
doc.gsub!(/\D/, '') # expresión regular, elimina lo que no sea dígitos
|
55
55
|
#DONE check if sth included not a digit
|
56
56
|
while doc[0] == '0' and (doc.length > 1) # elimina 0s superfluos
|
57
57
|
doc[0] = ''
|
@@ -123,6 +123,7 @@ end
|
|
123
123
|
alias_method :dni, :get_random_dni
|
124
124
|
alias_method :new_nie, :get_random_nie
|
125
125
|
alias_method :generar_nie, :get_random_nie
|
126
|
-
alias_method :nie, :get_random_nie
|
126
|
+
alias_method :nie, :get_random_nie
|
127
|
+
alias_method :num_id_extranjero, :get_random_nie
|
127
128
|
end
|
128
129
|
end
|
metadata
CHANGED
@@ -1,27 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dni_nie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- L. Jacob Mariscal Fernández
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: minitest
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '5.3'
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5.3'
|
27
30
|
description: Una gema para la verficación de documentos DNI/NIE | A gem to handle
|
@@ -32,31 +35,32 @@ executables:
|
|
32
35
|
extensions: []
|
33
36
|
extra_rdoc_files: []
|
34
37
|
files:
|
35
|
-
- bin/dni_nie
|
36
38
|
- lib/dni_nie.rb
|
39
|
+
- bin/dni_nie
|
37
40
|
homepage: http://rubygems.org/gems/dni_nie
|
38
41
|
licenses:
|
39
42
|
- LGPL-3.0
|
40
|
-
metadata: {}
|
41
43
|
post_install_message: Gracias por probar la gema dni_nie | Thanks for installing dni_nie
|
42
44
|
gem
|
43
45
|
rdoc_options: []
|
44
46
|
require_paths:
|
45
47
|
- lib
|
46
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
47
50
|
requirements:
|
48
|
-
- -
|
51
|
+
- - ! '>='
|
49
52
|
- !ruby/object:Gem::Version
|
50
53
|
version: '0'
|
51
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
52
56
|
requirements:
|
53
|
-
- -
|
57
|
+
- - ! '>='
|
54
58
|
- !ruby/object:Gem::Version
|
55
59
|
version: '0'
|
56
60
|
requirements: []
|
57
61
|
rubyforge_project:
|
58
|
-
rubygems_version:
|
62
|
+
rubygems_version: 1.8.23
|
59
63
|
signing_key:
|
60
|
-
specification_version:
|
64
|
+
specification_version: 3
|
61
65
|
summary: Utilidades para documentos oficiales DNI-NIE | Spanish official Id. tools
|
62
66
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 012fac41d81b54c1abab4256a126e514492011bb
|
4
|
-
data.tar.gz: b3914c3363e2a0459c140ddd8917e11ce6908870
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: dbc6f1b83c01a009f6cb7bc6155480e03594b3129c2b75675fa657ed3598f8ac6c5ea85f8e05b82eedd0f550fda4ac4d2f3c1011e6aae5e0af4fa173ea5dc725
|
7
|
-
data.tar.gz: 87293d70ae3687683e6061589bd90feb95aee75f2e8f4cfe6de7c8f63850535067a0a221c4e4a6aa79ddf502b8a402ba00c461aa44be6cfd07e3cf0f4580c875
|