dbf 3.1.2 → 3.1.3
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/Gemfile.lock +33 -32
- data/README.md +1 -1
- data/lib/dbf/column_type.rb +2 -0
- data/lib/dbf/table.rb +11 -13
- data/lib/dbf/version.rb +1 -1
- data/spec/dbf/column_spec.rb +1 -1
- data/spec/dbf/table_spec.rb +12 -5
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05f4c5675dae61be9046beaf3dab5cf09d16752bdfa5b3841f7811fe4e08b981
|
|
4
|
+
data.tar.gz: 7dd76a7c629a0965557d2c4fae8043ac7e5811834e3e011ea55ab669678a238c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eeb040f9f564e605a0fb107c43558d060c55ff868cadccfdfdd5b452040cc0ec30261ed0db0eb31ff8891efb6f1e57305743b6176f90ed3a7508186166e80752
|
|
7
|
+
data.tar.gz: 303215437b2339e83436e8999c9b2465ac69ee48a2be591c63e77a1c53968accfcb1c84a5160174d47665dd6af561721dcb255777db9861a442452a399342015
|
data/Gemfile.lock
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
dbf (3.1.
|
|
4
|
+
dbf (3.1.3)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
ast (2.
|
|
9
|
+
ast (2.4.0)
|
|
10
10
|
awesome_print (1.8.0)
|
|
11
|
-
byebug (
|
|
11
|
+
byebug (10.0.2)
|
|
12
12
|
coderay (1.1.2)
|
|
13
13
|
diff-lcs (1.3)
|
|
14
|
-
ffi (1.9.
|
|
14
|
+
ffi (1.9.25)
|
|
15
15
|
formatador (0.2.5)
|
|
16
|
-
guard (2.14.
|
|
16
|
+
guard (2.14.2)
|
|
17
17
|
formatador (>= 0.2.4)
|
|
18
18
|
listen (>= 2.7, < 4.0)
|
|
19
|
-
lumberjack (
|
|
19
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
20
20
|
nenv (~> 0.1)
|
|
21
21
|
notiffany (~> 0.0)
|
|
22
22
|
pry (>= 0.9.12)
|
|
@@ -27,54 +27,55 @@ GEM
|
|
|
27
27
|
guard (~> 2.1)
|
|
28
28
|
guard-compat (~> 1.1)
|
|
29
29
|
rspec (>= 2.99.0, < 4.0)
|
|
30
|
+
jaro_winkler (1.5.1)
|
|
30
31
|
listen (3.1.5)
|
|
31
32
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
32
33
|
rb-inotify (~> 0.9, >= 0.9.7)
|
|
33
34
|
ruby_dep (~> 1.2)
|
|
34
|
-
lumberjack (1.0.
|
|
35
|
+
lumberjack (1.0.13)
|
|
35
36
|
method_source (0.9.0)
|
|
36
37
|
nenv (0.3.0)
|
|
37
38
|
notiffany (0.1.1)
|
|
38
39
|
nenv (~> 0.1)
|
|
39
40
|
shellany (~> 0.0)
|
|
40
|
-
parallel (1.12.
|
|
41
|
-
parser (2.
|
|
42
|
-
ast (~> 2.
|
|
43
|
-
powerpack (0.1.
|
|
41
|
+
parallel (1.12.1)
|
|
42
|
+
parser (2.5.1.2)
|
|
43
|
+
ast (~> 2.4.0)
|
|
44
|
+
powerpack (0.1.2)
|
|
44
45
|
pry (0.11.3)
|
|
45
46
|
coderay (~> 1.1.0)
|
|
46
47
|
method_source (~> 0.9.0)
|
|
47
|
-
rainbow (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
rb-fsevent (0.10.2)
|
|
48
|
+
rainbow (3.0.0)
|
|
49
|
+
rake (12.3.1)
|
|
50
|
+
rb-fsevent (0.10.3)
|
|
51
51
|
rb-inotify (0.9.10)
|
|
52
52
|
ffi (>= 0.5.0, < 2)
|
|
53
|
-
rspec (3.
|
|
54
|
-
rspec-core (~> 3.
|
|
55
|
-
rspec-expectations (~> 3.
|
|
56
|
-
rspec-mocks (~> 3.
|
|
57
|
-
rspec-core (3.
|
|
58
|
-
rspec-support (~> 3.
|
|
59
|
-
rspec-expectations (3.
|
|
53
|
+
rspec (3.8.0)
|
|
54
|
+
rspec-core (~> 3.8.0)
|
|
55
|
+
rspec-expectations (~> 3.8.0)
|
|
56
|
+
rspec-mocks (~> 3.8.0)
|
|
57
|
+
rspec-core (3.8.0)
|
|
58
|
+
rspec-support (~> 3.8.0)
|
|
59
|
+
rspec-expectations (3.8.1)
|
|
60
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
61
|
-
rspec-support (~> 3.
|
|
62
|
-
rspec-mocks (3.
|
|
61
|
+
rspec-support (~> 3.8.0)
|
|
62
|
+
rspec-mocks (3.8.0)
|
|
63
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
64
|
-
rspec-support (~> 3.
|
|
65
|
-
rspec-support (3.
|
|
66
|
-
rubocop (0.
|
|
64
|
+
rspec-support (~> 3.8.0)
|
|
65
|
+
rspec-support (3.8.0)
|
|
66
|
+
rubocop (0.59.2)
|
|
67
|
+
jaro_winkler (~> 1.5.1)
|
|
67
68
|
parallel (~> 1.10)
|
|
68
|
-
parser (>= 2.
|
|
69
|
+
parser (>= 2.5, != 2.5.1.1)
|
|
69
70
|
powerpack (~> 0.1)
|
|
70
|
-
rainbow (>= 2.2.2, <
|
|
71
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
71
72
|
ruby-progressbar (~> 1.7)
|
|
72
73
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
73
|
-
ruby-progressbar (1.
|
|
74
|
+
ruby-progressbar (1.10.0)
|
|
74
75
|
ruby_dep (1.5.0)
|
|
75
76
|
shellany (0.0.1)
|
|
76
77
|
thor (0.20.0)
|
|
77
|
-
unicode-display_width (1.
|
|
78
|
+
unicode-display_width (1.4.0)
|
|
78
79
|
|
|
79
80
|
PLATFORMS
|
|
80
81
|
ruby
|
|
@@ -90,4 +91,4 @@ DEPENDENCIES
|
|
|
90
91
|
rubocop
|
|
91
92
|
|
|
92
93
|
BUNDLED WITH
|
|
93
|
-
1.16.
|
|
94
|
+
1.16.5
|
data/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
[](http://travis-ci.org/infused/dbf)
|
|
4
4
|
[](https://codeclimate.com/github/infused/dbf)
|
|
5
5
|
[](https://codeclimate.com/github/infused/dbf)
|
|
6
|
-
[](https://gemnasium.com/infused/dbf)
|
|
7
6
|
[](https://rubygems.org/gems/dbf/)
|
|
7
|
+
[](https://github.com/infused/dbf)
|
|
8
8
|
|
|
9
9
|
DBF is a small fast library for reading dBase, xBase, Clipper and FoxPro
|
|
10
10
|
database files
|
data/lib/dbf/column_type.rb
CHANGED
data/lib/dbf/table.rb
CHANGED
|
@@ -211,13 +211,12 @@ module DBF
|
|
|
211
211
|
def build_columns # :nodoc:
|
|
212
212
|
safe_seek do
|
|
213
213
|
@data.seek(DBF_HEADER_SIZE)
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
[].tap do |columns|
|
|
215
|
+
until end_of_record?
|
|
216
|
+
column_data = @data.read(DBF_HEADER_SIZE)
|
|
217
|
+
columns << Column.new(self, *column_data.unpack('a10 x a x4 C2'))
|
|
218
|
+
end
|
|
219
219
|
end
|
|
220
|
-
columns
|
|
221
220
|
end
|
|
222
221
|
end
|
|
223
222
|
|
|
@@ -231,12 +230,11 @@ module DBF
|
|
|
231
230
|
end
|
|
232
231
|
|
|
233
232
|
def find_all(options) # :nodoc:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
end.compact
|
|
233
|
+
select do |record|
|
|
234
|
+
next unless record && record.match?(options)
|
|
235
|
+
yield record if block_given?
|
|
236
|
+
record
|
|
237
|
+
end
|
|
240
238
|
end
|
|
241
239
|
|
|
242
240
|
def find_first(options) # :nodoc:
|
|
@@ -250,7 +248,7 @@ module DBF
|
|
|
250
248
|
def header # :nodoc:
|
|
251
249
|
@header ||= safe_seek do
|
|
252
250
|
@data.seek(0)
|
|
253
|
-
Header.new(@data.read
|
|
251
|
+
Header.new(@data.read(DBF_HEADER_SIZE))
|
|
254
252
|
end
|
|
255
253
|
end
|
|
256
254
|
|
data/lib/dbf/version.rb
CHANGED
data/spec/dbf/column_spec.rb
CHANGED
data/spec/dbf/table_spec.rb
CHANGED
|
@@ -177,13 +177,20 @@ RSpec.describe DBF::Table do
|
|
|
177
177
|
|
|
178
178
|
describe 'with :all' do
|
|
179
179
|
let(:records) do
|
|
180
|
-
table.find(:all, weight: 0.0)
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
table.find(:all, weight: 0.0)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
it 'retrieves only matching records' do
|
|
184
|
+
expect(records.size).to eq 66
|
|
183
185
|
end
|
|
184
186
|
|
|
185
|
-
it '
|
|
186
|
-
|
|
187
|
+
it 'yields to a block if given' do
|
|
188
|
+
record_count = 0
|
|
189
|
+
table.find(:all, weight: 0.0) do |record|
|
|
190
|
+
record_count += 1
|
|
191
|
+
expect(record).to be_a DBF::Record
|
|
192
|
+
end
|
|
193
|
+
expect(record_count).to eq 66
|
|
187
194
|
end
|
|
188
195
|
|
|
189
196
|
it 'returns all records if options are empty' do
|
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: 3.1.
|
|
4
|
+
version: 3.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Keith Morrison
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A small fast library for reading dBase, xBase, Clipper and FoxPro database
|
|
14
14
|
files.
|
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
112
112
|
version: 1.3.0
|
|
113
113
|
requirements: []
|
|
114
114
|
rubyforge_project:
|
|
115
|
-
rubygems_version: 2.7.
|
|
115
|
+
rubygems_version: 2.7.6
|
|
116
116
|
signing_key:
|
|
117
117
|
specification_version: 4
|
|
118
118
|
summary: Read xBase files
|