beid_parser 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,22 +1,29 @@
1
1
  beid_parser
2
2
  ===========
3
- Ruby beID parser. Allowing to easily handle beID xml files
3
+ Ruby beID parser. Allowing to easily handle beID XML files
4
4
 
5
5
  Please refer to http://eid.belgium.be/en/developing_eid_applications/ for references
6
6
 
7
+ Install
8
+ -------
9
+ Install it on your system:
10
+ - gem install beid_parser
11
+
12
+ Or add it to your Gemfile:
13
+ - gem 'beid_parser'
14
+
7
15
  Usage
8
16
  -----
9
17
  **Create a new Beid from a beID xml file:**
10
18
  - beid = BeidParser::Beid.new(filepath)
11
19
 
12
- **Methods accessibles:**
20
+ **Methods available:**
13
21
  - #picture64: The picture encoded in base64
14
22
  - #picture: The decoded picture
15
23
  - #extract_picture([filename]): Write the JPG picture into a file
16
24
  - #name: The family name
17
- - #firstname The firstname (including second first name if any)
18
- - #firstnames: Array of firstnames
19
- - #middlename: The middlename
25
+ - #firstname The firstname
26
+ - #middlenames: The middlenames (if any)
20
27
  - #nationality: The nationality
21
28
  - #place_of_birth: The place of birth
22
29
  - #date_of_birth: The date of birth, *Date*
@@ -34,3 +41,11 @@ Usage
34
41
  - #certificates: A Hash of all the certificates on the card (typically :root,:citizenca,:authentication,:signing,rrn)
35
42
 
36
43
  NB: When not specified fields are stored as String.
44
+
45
+
46
+ Warning
47
+ -------
48
+
49
+ The XML format is based on the last version of the beID viewver.
50
+ On Linux please use the packages available here: http://eid.belgium.be/en/using_your_eid/installing_the_eid_software/linux/
51
+ instead of the ones in the repositories of your distribution.
@@ -1,6 +1,6 @@
1
1
  class BeidParser::Beid
2
2
  include REXML
3
- attr_reader :picture64,:name,:firstname,:middlename,
3
+ attr_reader :picture64,:name,:firstname,:middlenames,
4
4
  :nationality,:place_of_birth,:date_of_birth,:national_number, :gender,:document_type,
5
5
  :card_number,:chip_number,:validity_date_begin,:validity_date_end,
6
6
  :delivery_municipality,:street_and_number,:zip,:municipality,
@@ -13,11 +13,6 @@ class BeidParser::Beid
13
13
  parse_document
14
14
  end
15
15
 
16
- #Return an array of firstnames
17
- def firstnames
18
- firstname.split(" ")
19
- end
20
-
21
16
  # Decode the Base64 encoded picture
22
17
  def picture
23
18
  Base64.decode64(picture64)
@@ -50,7 +45,7 @@ class BeidParser::Beid
50
45
  @gender = get_info(identity, "gender", true)
51
46
  @name = get_info(identity, "name")
52
47
  @firstname = get_info(identity, "firstname")
53
- @middlename = get_info(identity, "middlename")
48
+ @middlenames = get_info(identity, "middlenames")
54
49
  @nationality = get_info(identity, "nationality")
55
50
  @place_of_birth = get_info(identity, "placeofbirth")
56
51
  @picture64 = get_info(identity, "photo")
@@ -1,3 +1,3 @@
1
1
  module BeidParser
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: beid_parser
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thibault Poncelet
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-22 00:00:00 Z
13
+ date: 2012-04-28 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -23,7 +23,7 @@ dependencies:
23
23
  version: "2.5"
24
24
  type: :development
25
25
  version_requirements: *id001
26
- description: Ruby beID parser. Allowing to easily handle beID xml files
26
+ description: Ruby beID parser. Allowing to easily handle beID XML files
27
27
  email: thibaultponcelet@gmail.com
28
28
  executables: []
29
29
 
@@ -66,7 +66,7 @@ rubyforge_project:
66
66
  rubygems_version: 1.8.17
67
67
  signing_key:
68
68
  specification_version: 3
69
- summary: Ruby beID parser. Allowing to easily handle beID xml files
69
+ summary: Ruby beID parser. Allowing to easily handle beID XML files
70
70
  test_files:
71
71
  - spec/beid_spec.rb
72
72
  - spec/spec_helper.rb