dbf 4.1.3 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +166 -104
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +63 -52
  5. data/LICENSE +1 -1
  6. data/README.md +110 -16
  7. data/bin/dbf +2 -0
  8. data/docs/CNAME +1 -0
  9. data/docs/DBF.html +200 -0
  10. data/docs/DBF/Column.html +947 -0
  11. data/docs/DBF/Column/LengthError.html +124 -0
  12. data/docs/DBF/Column/NameError.html +124 -0
  13. data/docs/DBF/ColumnType.html +115 -0
  14. data/docs/DBF/ColumnType/Base.html +389 -0
  15. data/docs/DBF/ColumnType/Boolean.html +238 -0
  16. data/docs/DBF/ColumnType/Currency.html +238 -0
  17. data/docs/DBF/ColumnType/Date.html +242 -0
  18. data/docs/DBF/ColumnType/DateTime.html +246 -0
  19. data/docs/DBF/ColumnType/Double.html +238 -0
  20. data/docs/DBF/ColumnType/Float.html +238 -0
  21. data/docs/DBF/ColumnType/General.html +238 -0
  22. data/docs/DBF/ColumnType/Memo.html +246 -0
  23. data/docs/DBF/ColumnType/Nil.html +238 -0
  24. data/docs/DBF/ColumnType/Number.html +242 -0
  25. data/docs/DBF/ColumnType/SignedLong.html +238 -0
  26. data/docs/DBF/ColumnType/String.html +240 -0
  27. data/docs/DBF/Database.html +126 -0
  28. data/docs/DBF/Database/Foxpro.html +653 -0
  29. data/docs/DBF/Database/Table.html +346 -0
  30. data/docs/DBF/FileNotFoundError.html +124 -0
  31. data/docs/DBF/Header.html +723 -0
  32. data/docs/DBF/Memo.html +117 -0
  33. data/docs/DBF/Memo/Base.html +485 -0
  34. data/docs/DBF/Memo/Dbase3.html +242 -0
  35. data/docs/DBF/Memo/Dbase4.html +230 -0
  36. data/docs/DBF/Memo/Foxpro.html +268 -0
  37. data/docs/DBF/NoColumnsDefined.html +124 -0
  38. data/docs/DBF/Record.html +773 -0
  39. data/docs/DBF/Schema.html +980 -0
  40. data/docs/DBF/Table.html +1571 -0
  41. data/docs/_index.html +415 -0
  42. data/docs/class_list.html +51 -0
  43. data/docs/css/common.css +1 -0
  44. data/docs/css/full_list.css +58 -0
  45. data/docs/css/style.css +497 -0
  46. data/docs/file.README.html +359 -0
  47. data/docs/file_list.html +56 -0
  48. data/docs/frames.html +17 -0
  49. data/docs/index.html +359 -0
  50. data/docs/js/app.js +314 -0
  51. data/docs/js/full_list.js +216 -0
  52. data/docs/js/jquery.js +4 -0
  53. data/docs/method_list.html +675 -0
  54. data/docs/top-level-namespace.html +110 -0
  55. data/lib/dbf/column.rb +8 -7
  56. data/lib/dbf/column_type.rb +23 -0
  57. data/lib/dbf/database/foxpro.rb +7 -2
  58. data/lib/dbf/header.rb +11 -3
  59. data/lib/dbf/record.rb +5 -5
  60. data/lib/dbf/schema.rb +4 -3
  61. data/lib/dbf/table.rb +34 -11
  62. data/lib/dbf/version.rb +1 -1
  63. data/spec/dbf/column_spec.rb +3 -3
  64. data/spec/dbf/file_formats_spec.rb +54 -0
  65. data/spec/fixtures/dbase_02.dbf +0 -0
  66. data/spec/fixtures/dbase_02_summary.txt +23 -0
  67. data/spec/fixtures/dbase_32.dbf +0 -0
  68. data/spec/fixtures/dbase_32_summary.txt +11 -0
  69. data/spec/fixtures/dbase_8c.dbf +0 -0
  70. metadata +56 -6
  71. data/docs/supported_encodings.csv +0 -60
  72. data/docs/supported_types.markdown +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c2ff24f150ee6567de0532c773695f8b47c0db811660e0f5f3be3d53a7cc053
4
- data.tar.gz: 7006275aff71326833452546657bb07520d53024b6846b0c982121a488cd8235
3
+ metadata.gz: 825e580742ca7cb994908e488763e40ac36f4570b23d8fe75e6ba389ac9de769
4
+ data.tar.gz: 461dae904d53d1c26558b671d4a0ea2101538e2673bf7b307e39d37470909ce7
5
5
  SHA512:
6
- metadata.gz: b2d4bffa8201a8fa07abf642e721523e7ed59bb2b3e9a0fae31fe5ce6a4a3078f1520eb09e350d979dd88a68801c7c52d3236c402f83a41da1e5e6c4bca39911
7
- data.tar.gz: fddf6622338b52b4bb6006513a92d9fd44c8f1e864738fd597d7e9f3fc21bcd86707f5e68e76216bd4c6d3be7dad9a48e5e19d55a6728691f6d90d86ec6db25e
6
+ metadata.gz: 4f4c2824d0eb7a5f822515b8093f51a3e7f8892b0e4987f3b537ce007667e6232e80b4af8f87c449a4be061d39607772a5082e09ea67c73f1a1156dd86889e40
7
+ data.tar.gz: 711155242a0c16f765b327005157e4097489a348a2653bfbbf5f017304c0534f30abb8282075e2e4c6b63c236a94fb8b426e3303917c8882971a9c0f9068a73e
data/CHANGELOG.md CHANGED
@@ -1,153 +1,215 @@
1
- # 4.1.3
2
- - Raise DBF::NoColumnsDefined error when attempting to read records if no columns are defined
1
+ # Changelog
3
2
 
4
- # 4.1.1
5
- - Add required_ruby_version to gemspec
3
+ ## 4.2.0
6
4
 
7
- # 4.1.0
8
- - Return Time instead of DateTime
5
+ - Initial support for dBase 7 files
9
6
 
10
- # 4.0.0
11
- - Drop support for ruby-2.2 and earlier
7
+ ## 4.1.6
12
8
 
13
- # 3.1.3
14
- - Ensure malformed dates return nil
9
+ - Add support for file type 32
15
10
 
16
- # 3.1.2
17
- - Fix incorrect columns list when StringIO and encoding set
11
+ ## 4.1.5
18
12
 
19
- # 3.1.1
20
- - Use Date.strptime to parse date fields
13
+ - Better handling for PIPE errors when using command line utility
21
14
 
22
- # 3.1.0
23
- - Use :binary for binary fields in ActiveRecord schemas
15
+ ## 4.1.4
24
16
 
25
- # 3.0.8
26
- - Fix uninitialized constant error under Rails 5
17
+ - Add full support for FoxBase files
27
18
 
28
- # 3.0.7
29
- - Ignore non-existent records if header record count is incorrect
19
+ ## 4.1.3
30
20
 
31
- # 3.0.6
32
- - This version has been yanked from rubygems due to errors
21
+ - Raise DBF::NoColumnsDefined error when attempting to read records if no columns are defined
33
22
 
34
- # 3.0.5
35
- - Override table name for schema output
23
+ ## 4.1.1
36
24
 
37
- # 3.0.4
38
- - Adds -v command-line option to print version
39
- - Adds -r command-line option to create Sequel migration
25
+ - Add required_ruby_version to gemspec
40
26
 
41
- # 3.0.3
42
- - Uninitialized (N)umbers should return nil
27
+ ## 4.1.0
43
28
 
44
- # 3.0.2
45
- - Performance improvements for large files
29
+ - Return Time instead of DateTime
46
30
 
47
- # 3.0.1
48
- - Support FoxPro (G) general field type
49
- - Fix ruby warnings
31
+ ## 4.0.0
50
32
 
51
- # 3.0.0
52
- - Requires Ruby version 2.0 and above
53
- - Support the (G) General Foxpro field type
33
+ - Drop support for ruby-2.2 and earlier
54
34
 
55
- # 2.0.13
56
- - Support 64-bit currency signed currency values
57
- (see https://github.com/infused/dbf/pull/71)
35
+ ## 3.1.3
58
36
 
59
- # 2.0.12
60
- - Parse (I) values as signed
61
- (see https://github.com/infused/dbf/pull/70)
37
+ - Ensure malformed dates return nil
62
38
 
63
- # 2.0.11
64
- - Foxpro doubles should always return the full stored precision
65
- (see https://github.com/infused/dbf/pull/69)
39
+ ## 3.1.2
66
40
 
67
- # 2.0.10
68
- - allow 0 length fields, but always return nil as value
41
+ - Fix incorrect columns list when StringIO and encoding set
69
42
 
70
- # 2.0.9
71
- - fix dBase IV attributes when memo file is missing
43
+ ## 3.1.1
72
44
 
73
- # 2.0.8
74
- - fix FoxPro currency fields on some builds of Ruby 1.9.3 and 2.0.0
45
+ - Use Date.strptime to parse date fields
75
46
 
76
- # 2.0.7
77
- - fix the dbf binary on some linux systems
47
+ ## 3.1.0
78
48
 
79
- # 2.0.6
80
- - build_memo returns nil on errors
49
+ - Use :binary for binary fields in ActiveRecord schemas
81
50
 
82
- # 2.0.5
83
- - use correct FoxPro memo block size
51
+ ## 3.0.8
84
52
 
85
- # 2.0.4
86
- - memo fields return nil if memo file is missing
53
+ - Fix uninitialized constant error under Rails 5
87
54
 
88
- # 2.0.3
89
- - set encoding if table encoding is nil
55
+ ## 3.0.7
90
56
 
91
- # 2.0.2
92
- - Allow overriding the character encoding specified in the file
57
+ - Ignore non-existent records if header record count is incorrect
93
58
 
94
- # 2.0.1
95
- - Add experimental support for character encodings under Ruby 1.8
59
+ ## 3.0.6
96
60
 
97
- # 2.0.0
98
- - #44 Require FasterCSV gem on all platforms
99
- - Remove rdoc development dependency
100
- - #42 Fixes encoding of memos
101
- - #43 Improve handling of record attributes
61
+ - This version has been yanked from rubygems due to errors
102
62
 
103
- # 1.7.5
104
- - fixes FoxPro currency (Y) fields
63
+ ## 3.0.5
105
64
 
106
- # 1.7.4
107
- - Replace Memo Type with Memo File boolean in command-line utility summary output
65
+ - Override table name for schema output
108
66
 
109
- # 1.7.3
110
- - find_all/find_first should ignore deleted records
67
+ ## 3.0.4
111
68
 
112
- # 1.7.2
113
- - Fix integer division under Ruby 1.8 when requiring mathn
114
- standard library (see http://bugs.ruby-lang.org/issues/2121)
69
+ - Adds -v command-line option to print version
70
+ - Adds -r command-line option to create Sequel migration
115
71
 
116
- # 1.7.1
117
- - Fix Table.FOXPRO_VERSIONS breakage on Ruby 1.8
72
+ ## 3.0.3
118
73
 
119
- # 1.7.0
120
- - allow DBF::Table to work with dbf data in memory
121
- - allow DBF::Table#to_csv to write to STDOUT
74
+ - Uninitialized (N)umbers should return nil
122
75
 
123
- # 1.6.7
124
- - memo columns return nil when no memo file found
76
+ ## 3.0.2
77
+
78
+ - Performance improvements for large files
125
79
 
126
- # 1.6.6
127
- - add binary data type support to ActiveRecord schema output
80
+ ## 3.0.1
128
81
 
129
- # 1.6.5
130
- - support for visual foxpro double (b) data type
82
+ - Support FoxPro (G) general field type
83
+ - Fix ruby warnings
131
84
 
132
- # 1.6.3
133
- - Replace invalid chars with 'unicode replacement character' (U+FFFD)
85
+ ## 3.0.0
86
+
87
+ - Requires Ruby version 2.0 and above
88
+ - Support the (G) General Foxpro field type
89
+
90
+ ## 2.0.13
91
+
92
+ - Support 64-bit currency signed currency values
93
+ (see https://github.com/infused/dbf/pull/71)
94
+
95
+ ## 2.0.12
96
+
97
+ - Parse (I) values as signed
98
+ (see https://github.com/infused/dbf/pull/70)
99
+
100
+ ## 2.0.11
101
+
102
+ - Foxpro doubles should always return the full stored precision
103
+ (see https://github.com/infused/dbf/pull/69)
104
+
105
+ ## 2.0.10
106
+
107
+ - allow 0 length fields, but always return nil as value
108
+
109
+ ## 2.0.9
110
+
111
+ - fix dBase IV attributes when memo file is missing
112
+
113
+ ## 2.0.8
114
+
115
+ - fix FoxPro currency fields on some builds of Ruby 1.9.3 and 2.0.0
116
+
117
+ ## 2.0.7
118
+
119
+ - fix the dbf binary on some linux systems
120
+
121
+ ## 2.0.6
122
+
123
+ - build_memo returns nil on errors
124
+
125
+ ## 2.0.5
126
+
127
+ - use correct FoxPro memo block size
128
+
129
+ ## 2.0.4
130
+
131
+ - memo fields return nil if memo file is missing
132
+
133
+ ## 2.0.3
134
+
135
+ - set encoding if table encoding is nil
136
+
137
+ ## 2.0.2
138
+
139
+ - Allow overriding the character encoding specified in the file
140
+
141
+ ## 2.0.1
142
+
143
+ - Add experimental support for character encodings under Ruby 1.8
144
+
145
+ ## 2.0.0
146
+
147
+ - #44 Require FasterCSV gem on all platforms
148
+ - Remove rdoc development dependency
149
+ - #42 Fixes encoding of memos
150
+ - #43 Improve handling of record attributes
151
+
152
+ ## 1.7.5
153
+
154
+ - fixes FoxPro currency (Y) fields
155
+
156
+ ## 1.7.4
157
+
158
+ - Replace Memo Type with Memo File boolean in command-line utility summary output
159
+
160
+ ## 1.7.3
161
+
162
+ - find_all/find_first should ignore deleted records
163
+
164
+ ## 1.7.2
165
+
166
+ - Fix integer division under Ruby 1.8 when requiring mathn
167
+ standard library (see http://bugs.ruby-lang.org/issues/2121)
168
+
169
+ ## 1.7.1
170
+
171
+ - Fix Table.FOXPRO_VERSIONS breakage on Ruby 1.8
172
+
173
+ ## 1.7.0
174
+
175
+ - allow DBF::Table to work with dbf data in memory
176
+ - allow DBF::Table#to_csv to write to STDOUT
177
+
178
+ ## 1.6.7
179
+
180
+ - memo columns return nil when no memo file found
181
+
182
+ ## 1.6.6
183
+
184
+ - add binary data type support to ActiveRecord schema output
185
+
186
+ ## 1.6.5
187
+
188
+ - support for visual foxpro double (b) data type
189
+
190
+ ## 1.6.3
191
+
192
+ - Replace invalid chars with 'unicode replacement character' (U+FFFD)
134
193
 
135
194
  ## 1.6.2
136
- - add Table#filename method
137
- - Rakefile now loads gems with bundler
138
- - add Table#supports_encoding?
139
- - simplify encodings.yml loader
140
- - add rake and rdoc as development dependencies
141
- - simplify open_memo file search logic
142
- - remove unnecessary requires in spec helper
143
- - fix cli summary
195
+
196
+ - add Table#filename method
197
+ - Rakefile now loads gems with bundler
198
+ - add Table#supports_encoding?
199
+ - simplify encodings.yml loader
200
+ - add rake and rdoc as development dependencies
201
+ - simplify open_memo file search logic
202
+ - remove unnecessary requires in spec helper
203
+ - fix cli summary
144
204
 
145
205
  ## 1.6.1
146
- - fix YAML issue when using MRI version > 1.9.1
147
- - remove Table#seek_to_index and Table#current_record private methods
206
+
207
+ - fix YAML issue when using MRI version > 1.9.1
208
+ - remove Table#seek_to_index and Table#current_record private methods
148
209
 
149
210
  ## 1.6.0
150
- - remove activesupport gem dependency
211
+
212
+ - remove activesupport gem dependency
151
213
 
152
214
  ## 1.5.0
153
215
 
data/Gemfile CHANGED
@@ -13,4 +13,5 @@ group :development, :test do
13
13
  gem 'rubocop'
14
14
  gem 'rubocop-performance'
15
15
  gem 'rubocop-rspec'
16
+ gem 'yard'
16
17
  end
data/Gemfile.lock CHANGED
@@ -1,26 +1,26 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dbf (4.1.3)
4
+ dbf (4.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.0)
10
- awesome_print (1.8.0)
11
- byebug (11.0.1)
12
- coderay (1.1.2)
13
- diff-lcs (1.3)
9
+ ast (2.4.2)
10
+ awesome_print (1.9.2)
11
+ byebug (11.1.3)
12
+ coderay (1.1.3)
13
+ diff-lcs (1.4.4)
14
14
  e2mmap (0.1.0)
15
- ffi (1.11.1)
16
- formatador (0.2.5)
17
- guard (2.15.0)
15
+ ffi (1.15.3)
16
+ formatador (0.3.0)
17
+ guard (2.18.0)
18
18
  formatador (>= 0.2.4)
19
19
  listen (>= 2.7, < 4.0)
20
20
  lumberjack (>= 1.0.12, < 2.0)
21
21
  nenv (~> 0.1)
22
22
  notiffany (~> 0.0)
23
- pry (>= 0.9.12)
23
+ pry (>= 0.13.0)
24
24
  shellany (~> 0.0)
25
25
  thor (>= 0.18.1)
26
26
  guard-compat (1.2.1)
@@ -28,58 +28,68 @@ GEM
28
28
  guard (~> 2.1)
29
29
  guard-compat (~> 1.1)
30
30
  rspec (>= 2.99.0, < 4.0)
31
- irb (1.0.0)
32
- jaro_winkler (1.5.3)
33
- listen (3.1.5)
34
- rb-fsevent (~> 0.9, >= 0.9.4)
35
- rb-inotify (~> 0.9, >= 0.9.7)
36
- ruby_dep (~> 1.2)
37
- lumberjack (1.0.13)
38
- method_source (0.9.2)
31
+ io-console (0.5.9)
32
+ irb (1.3.6)
33
+ reline (>= 0.2.5)
34
+ listen (3.6.0)
35
+ rb-fsevent (~> 0.10, >= 0.10.3)
36
+ rb-inotify (~> 0.9, >= 0.9.10)
37
+ lumberjack (1.2.8)
38
+ method_source (1.0.0)
39
39
  nenv (0.3.0)
40
- notiffany (0.1.1)
40
+ notiffany (0.1.3)
41
41
  nenv (~> 0.1)
42
42
  shellany (~> 0.0)
43
- parallel (1.17.0)
44
- parser (2.6.3.0)
45
- ast (~> 2.4.0)
46
- pry (0.12.2)
47
- coderay (~> 1.1.0)
48
- method_source (~> 0.9.0)
43
+ parallel (1.20.1)
44
+ parser (3.0.2.0)
45
+ ast (~> 2.4.1)
46
+ pry (0.14.1)
47
+ coderay (~> 1.1)
48
+ method_source (~> 1.0)
49
49
  rainbow (3.0.0)
50
- rake (12.3.2)
51
- rb-fsevent (0.10.3)
52
- rb-inotify (0.10.0)
50
+ rake (13.0.6)
51
+ rb-fsevent (0.11.0)
52
+ rb-inotify (0.10.1)
53
53
  ffi (~> 1.0)
54
- rspec (3.8.0)
55
- rspec-core (~> 3.8.0)
56
- rspec-expectations (~> 3.8.0)
57
- rspec-mocks (~> 3.8.0)
58
- rspec-core (3.8.2)
59
- rspec-support (~> 3.8.0)
60
- rspec-expectations (3.8.4)
54
+ regexp_parser (2.1.1)
55
+ reline (0.2.6)
56
+ io-console (~> 0.5)
57
+ rexml (3.2.5)
58
+ rspec (3.10.0)
59
+ rspec-core (~> 3.10.0)
60
+ rspec-expectations (~> 3.10.0)
61
+ rspec-mocks (~> 3.10.0)
62
+ rspec-core (3.10.1)
63
+ rspec-support (~> 3.10.0)
64
+ rspec-expectations (3.10.1)
61
65
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.8.0)
63
- rspec-mocks (3.8.1)
66
+ rspec-support (~> 3.10.0)
67
+ rspec-mocks (3.10.2)
64
68
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.8.0)
66
- rspec-support (3.8.2)
67
- rubocop (0.73.0)
68
- jaro_winkler (~> 1.5.1)
69
+ rspec-support (~> 3.10.0)
70
+ rspec-support (3.10.2)
71
+ rubocop (1.18.4)
69
72
  parallel (~> 1.10)
70
- parser (>= 2.6)
73
+ parser (>= 3.0.0.0)
71
74
  rainbow (>= 2.2.2, < 4.0)
75
+ regexp_parser (>= 1.8, < 3.0)
76
+ rexml
77
+ rubocop-ast (>= 1.8.0, < 2.0)
72
78
  ruby-progressbar (~> 1.7)
73
- unicode-display_width (>= 1.4.0, < 1.7)
74
- rubocop-performance (1.4.0)
75
- rubocop (>= 0.71.0)
76
- rubocop-rspec (1.33.0)
77
- rubocop (>= 0.60.0)
78
- ruby-progressbar (1.10.1)
79
- ruby_dep (1.5.0)
79
+ unicode-display_width (>= 1.4.0, < 3.0)
80
+ rubocop-ast (1.9.0)
81
+ parser (>= 3.0.1.1)
82
+ rubocop-performance (1.11.4)
83
+ rubocop (>= 1.7.0, < 2.0)
84
+ rubocop-ast (>= 0.4.0)
85
+ rubocop-rspec (2.4.0)
86
+ rubocop (~> 1.0)
87
+ rubocop-ast (>= 1.1.0)
88
+ ruby-progressbar (1.11.0)
80
89
  shellany (0.0.1)
81
- thor (0.20.3)
82
- unicode-display_width (1.6.0)
90
+ thor (1.1.0)
91
+ unicode-display_width (2.0.0)
92
+ yard (0.9.26)
83
93
 
84
94
  PLATFORMS
85
95
  ruby
@@ -97,6 +107,7 @@ DEPENDENCIES
97
107
  rubocop
98
108
  rubocop-performance
99
109
  rubocop-rspec
110
+ yard
100
111
 
101
112
  BUNDLED WITH
102
- 2.1.4
113
+ 2.2.15