dbf 2.0.5 → 2.0.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -0
- data/dbf.gemspec +1 -0
- data/docs/encodings.csv +60 -0
- data/lib/dbf.rb +2 -1
- data/lib/dbf/column/base.rb +4 -1
- data/lib/dbf/encodings.rb +63 -0
- data/lib/dbf/header.rb +17 -0
- data/lib/dbf/memo/foxpro.rb +3 -0
- data/lib/dbf/table.rb +26 -23
- data/lib/dbf/version.rb +1 -1
- data/spec/dbf/dir_alumnos.csv +3118 -0
- data/spec/dbf/file_formats_spec.rb +27 -1
- data/spec/dbf/test.csv +3118 -0
- data/spec/fixtures/dir_alumnos.dbf +0 -0
- data/spec/fixtures/dir_alumnos.fpt +0 -0
- data/spec/fixtures/test.rb +48 -0
- data/spec/fixtures/test/dir_alumnos.dbf +0 -0
- data/spec/fixtures/test/dir_alumnos.fpt +0 -0
- metadata +14 -4
- data/lib/dbf/table/encodings.rb +0 -66
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'dbf'
|
|
2
|
+
|
|
3
|
+
module Estudiante
|
|
4
|
+
|
|
5
|
+
DATA_FOLDER = "./"
|
|
6
|
+
|
|
7
|
+
HEADERS = %w{
|
|
8
|
+
id
|
|
9
|
+
nombres
|
|
10
|
+
apellidos
|
|
11
|
+
cedula
|
|
12
|
+
sexo
|
|
13
|
+
fecha_nacimiento
|
|
14
|
+
condicion
|
|
15
|
+
observacion
|
|
16
|
+
becado
|
|
17
|
+
foto
|
|
18
|
+
cedula_escolar
|
|
19
|
+
email
|
|
20
|
+
direccion
|
|
21
|
+
peso
|
|
22
|
+
estatura
|
|
23
|
+
fecha_ingreso
|
|
24
|
+
representante_id
|
|
25
|
+
ciudad_id
|
|
26
|
+
seccion_id
|
|
27
|
+
matricula_id
|
|
28
|
+
telefono_id
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def self.checkPhone(home = nil, mobile = nil)
|
|
32
|
+
puts "home: #{home} - mobile: #{mobile}"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.getStudents
|
|
36
|
+
|
|
37
|
+
table = DBF::Table.new(DATA_FOLDER + "dir_alumnos.dbf")
|
|
38
|
+
|
|
39
|
+
students = Array.new
|
|
40
|
+
|
|
41
|
+
table.each do |estudiante|
|
|
42
|
+
checkPhone(estudiante.telf, estudiante.celular)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
Estudiante.getStudents
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dbf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Keith Morrison
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-07-
|
|
11
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fastercsv
|
|
@@ -70,23 +70,27 @@ files:
|
|
|
70
70
|
- Rakefile
|
|
71
71
|
- README.md
|
|
72
72
|
- bin/dbf
|
|
73
|
+
- docs/encodings.csv
|
|
73
74
|
- docs/supported_types.markdown
|
|
74
75
|
- lib/dbf/column/base.rb
|
|
75
76
|
- lib/dbf/column/dbase.rb
|
|
76
77
|
- lib/dbf/column/foxpro.rb
|
|
78
|
+
- lib/dbf/encodings.rb
|
|
79
|
+
- lib/dbf/header.rb
|
|
77
80
|
- lib/dbf/memo/base.rb
|
|
78
81
|
- lib/dbf/memo/dbase3.rb
|
|
79
82
|
- lib/dbf/memo/dbase4.rb
|
|
80
83
|
- lib/dbf/memo/foxpro.rb
|
|
81
84
|
- lib/dbf/record.rb
|
|
82
|
-
- lib/dbf/table/encodings.rb
|
|
83
85
|
- lib/dbf/table.rb
|
|
84
86
|
- lib/dbf/version.rb
|
|
85
87
|
- lib/dbf.rb
|
|
86
88
|
- spec/dbf/column_spec.rb
|
|
89
|
+
- spec/dbf/dir_alumnos.csv
|
|
87
90
|
- spec/dbf/file_formats_spec.rb
|
|
88
91
|
- spec/dbf/record_spec.rb
|
|
89
92
|
- spec/dbf/table_spec.rb
|
|
93
|
+
- spec/dbf/test.csv
|
|
90
94
|
- spec/fixtures/cp1251.dbf
|
|
91
95
|
- spec/fixtures/dbase_03.dbf
|
|
92
96
|
- spec/fixtures/dbase_30.dbf
|
|
@@ -100,11 +104,17 @@ files:
|
|
|
100
104
|
- spec/fixtures/dbase_8b.dbt
|
|
101
105
|
- spec/fixtures/dbase_f5.dbf
|
|
102
106
|
- spec/fixtures/dbase_f5.fpt
|
|
107
|
+
- spec/fixtures/dir_alumnos.dbf
|
|
108
|
+
- spec/fixtures/dir_alumnos.fpt
|
|
109
|
+
- spec/fixtures/test/dir_alumnos.dbf
|
|
110
|
+
- spec/fixtures/test/dir_alumnos.fpt
|
|
111
|
+
- spec/fixtures/test.rb
|
|
103
112
|
- spec/rvm_ruby_runner.rb
|
|
104
113
|
- spec/spec_helper.rb
|
|
105
114
|
- dbf.gemspec
|
|
106
115
|
homepage: http://github.com/infused/dbf
|
|
107
|
-
licenses:
|
|
116
|
+
licenses:
|
|
117
|
+
- MIT
|
|
108
118
|
metadata: {}
|
|
109
119
|
post_install_message:
|
|
110
120
|
rdoc_options:
|
data/lib/dbf/table/encodings.rb
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
module DBF
|
|
2
|
-
class Table
|
|
3
|
-
# inspired by http://trac.osgeo.org/gdal/ticket/2864
|
|
4
|
-
ENCODINGS = {
|
|
5
|
-
"01" => "cp437", # U.S. MS–DOS
|
|
6
|
-
"02" => "cp850", # International MS–DOS
|
|
7
|
-
"03" => "cp1252", # Windows ANSI
|
|
8
|
-
"08" => "cp865", # Danish OEM
|
|
9
|
-
"09" => "cp437", # Dutch OEM
|
|
10
|
-
"0a" => "cp850", # Dutch OEM*
|
|
11
|
-
"0b" => "cp437", # Finnish OEM
|
|
12
|
-
"0d" => "cp437", # French OEM
|
|
13
|
-
"0e" => "cp850", # French OEM*
|
|
14
|
-
"0f" => "cp437", # German OEM
|
|
15
|
-
"10" => "cp850", # German OEM*
|
|
16
|
-
"11" => "cp437", # Italian OEM
|
|
17
|
-
"12" => "cp850", # Italian OEM*
|
|
18
|
-
"13" => "cp932", # Japanese Shift-JIS
|
|
19
|
-
"14" => "cp850", # Spanish OEM*
|
|
20
|
-
"15" => "cp437", # Swedish OEM
|
|
21
|
-
"16" => "cp850", # Swedish OEM*
|
|
22
|
-
"17" => "cp865", # Norwegian OEM
|
|
23
|
-
"18" => "cp437", # Spanish OEM
|
|
24
|
-
"19" => "cp437", # English OEM (Britain)
|
|
25
|
-
"1a" => "cp850", # English OEM (Britain)*
|
|
26
|
-
"1b" => "cp437", # English OEM (U.S.)
|
|
27
|
-
"1c" => "cp863", # French OEM (Canada)
|
|
28
|
-
"1d" => "cp850", # French OEM*
|
|
29
|
-
"1f" => "cp852", # Czech OEM
|
|
30
|
-
"22" => "cp852", # Hungarian OEM
|
|
31
|
-
"23" => "cp852", # Polish OEM
|
|
32
|
-
"24" => "cp860", # Portuguese OEM
|
|
33
|
-
"25" => "cp850", # Portuguese OEM*
|
|
34
|
-
"26" => "cp866", # Russian OEM
|
|
35
|
-
"37" => "cp850", # English OEM (U.S.)*
|
|
36
|
-
"40" => "cp852", # Romanian OEM
|
|
37
|
-
"4d" => "cp936", # Chinese GBK (PRC)
|
|
38
|
-
"4e" => "cp949", # Korean (ANSI/OEM)
|
|
39
|
-
"4f" => "cp950", # Chinese Big5 (Taiwan)
|
|
40
|
-
"50" => "cp874", # Thai (ANSI/OEM)
|
|
41
|
-
"57" => "cp1252", # ANSI
|
|
42
|
-
"58" => "cp1252", # Western European ANSI
|
|
43
|
-
"59" => "cp1252", # Spanish ANSI
|
|
44
|
-
"64" => "cp852", # Eastern European MS–DOS
|
|
45
|
-
"65" => "cp866", # Russian MS–DOS
|
|
46
|
-
"66" => "cp865", # Nordic MS–DOS
|
|
47
|
-
"67" => "cp861", # Icelandic MS–DOS
|
|
48
|
-
"6a" => "cp737", # Greek MS–DOS (437G)
|
|
49
|
-
"6b" => "cp857", # Turkish MS–DOS
|
|
50
|
-
"6c" => "cp863", # French–Canadian MS–DOS
|
|
51
|
-
"78" => "cp950", # Taiwan Big 5
|
|
52
|
-
"79" => "cp949", # Hangul (Wansung)
|
|
53
|
-
"7a" => "cp936", # PRC GBK
|
|
54
|
-
"7b" => "cp932", # Japanese Shift-JIS
|
|
55
|
-
"7c" => "cp874", # Thai Windows/MS–DOS
|
|
56
|
-
"86" => "cp737", # Greek OEM
|
|
57
|
-
"87" => "cp852", # Slovenian OEM
|
|
58
|
-
"88" => "cp857", # Turkish OEM
|
|
59
|
-
"c8" => "cp1250", # Eastern European Windows
|
|
60
|
-
"c9" => "cp1251", # Russian Windows
|
|
61
|
-
"ca" => "cp1254", # Turkish Windows
|
|
62
|
-
"cb" => "cp1253", # Greek Windows
|
|
63
|
-
"cc" => "cp1257", # Baltic Windows
|
|
64
|
-
}
|
|
65
|
-
end
|
|
66
|
-
end
|