dbf 3.0.8 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +6 -13
- data/Gemfile.travis +2 -1
- data/README.md +8 -8
- data/lib/dbf/column.rb +2 -6
- data/lib/dbf/table.rb +1 -1
- data/lib/dbf/version.rb +1 -1
- data/spec/dbf/column_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aecf544df6670b726e4edfbf08511819e9eb67d3
|
4
|
+
data.tar.gz: 7b5e97b5e6102e13648ed1542066f47d78cebba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd35b97f6f334523543f0885a893c37eb7edfba91ffe529c769bc38f51a7ffed55edc4eb50b6d74e587a56d5c35055d1188ac97e024ceb8b24e14527cb21e29
|
7
|
+
data.tar.gz: a4faecdc9176581351003c30ef8651d8a7fbe6031b8cc85989f20677a3eb95f6d76e919eb7d4f017d129abff23670472ac71c0371763ae3555936225f5344196
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dbf (3.0.
|
4
|
+
dbf (3.0.8)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
byebug (9.0.5)
|
9
10
|
coderay (1.1.0)
|
10
11
|
diff-lcs (1.2.5)
|
11
12
|
ffi (1.9.10)
|
12
|
-
ffi (1.9.10-java)
|
13
13
|
formatador (0.2.5)
|
14
14
|
guard (2.13.0)
|
15
15
|
formatador (>= 0.2.4)
|
@@ -25,7 +25,7 @@ GEM
|
|
25
25
|
guard (~> 2.1)
|
26
26
|
guard-compat (~> 1.1)
|
27
27
|
rspec (>= 2.99.0, < 4.0)
|
28
|
-
listen (3.0.
|
28
|
+
listen (3.0.3)
|
29
29
|
rb-fsevent (>= 0.9.3)
|
30
30
|
rb-inotify (>= 0.9)
|
31
31
|
lumberjack (1.0.9)
|
@@ -34,16 +34,11 @@ GEM
|
|
34
34
|
notiffany (0.0.8)
|
35
35
|
nenv (~> 0.1)
|
36
36
|
shellany (~> 0.0)
|
37
|
-
pry (0.10.
|
37
|
+
pry (0.10.2)
|
38
38
|
coderay (~> 1.1.0)
|
39
39
|
method_source (~> 0.8.1)
|
40
40
|
slop (~> 3.4)
|
41
|
-
|
42
|
-
coderay (~> 1.1.0)
|
43
|
-
method_source (~> 0.8.1)
|
44
|
-
slop (~> 3.4)
|
45
|
-
spoon (~> 0.0)
|
46
|
-
rake (11.2.2)
|
41
|
+
rake (10.4.2)
|
47
42
|
rb-fsevent (0.9.6)
|
48
43
|
rb-inotify (0.9.5)
|
49
44
|
ffi (>= 0.5.0)
|
@@ -62,15 +57,13 @@ GEM
|
|
62
57
|
rspec-support (3.4.0)
|
63
58
|
shellany (0.0.1)
|
64
59
|
slop (3.6.0)
|
65
|
-
spoon (0.0.4)
|
66
|
-
ffi
|
67
60
|
thor (0.19.1)
|
68
61
|
|
69
62
|
PLATFORMS
|
70
|
-
java
|
71
63
|
ruby
|
72
64
|
|
73
65
|
DEPENDENCIES
|
66
|
+
byebug
|
74
67
|
dbf!
|
75
68
|
guard
|
76
69
|
guard-rspec
|
data/Gemfile.travis
CHANGED
data/README.md
CHANGED
@@ -55,7 +55,7 @@ data = File.open('widgets.dbf')
|
|
55
55
|
widgets = DBF::Table.new(data)
|
56
56
|
```
|
57
57
|
|
58
|
-
Open a DBF by passing in raw data (wrap the raw data with
|
58
|
+
Open a DBF by passing in raw data (wrap the raw data with StringIO):
|
59
59
|
|
60
60
|
```ruby
|
61
61
|
widgets = DBF::Table.new(StringIO.new('raw binary data'))
|
@@ -180,7 +180,7 @@ end
|
|
180
180
|
```
|
181
181
|
|
182
182
|
If you have initalized the DBF::Table with raw data, you will need to set the
|
183
|
-
table name manually
|
183
|
+
exported table name manually:
|
184
184
|
|
185
185
|
```ruby
|
186
186
|
table.name = 'my_table_name'
|
@@ -213,7 +213,7 @@ end
|
|
213
213
|
```
|
214
214
|
|
215
215
|
If you have initalized the DBF::Table with raw data, you will need to set the
|
216
|
-
table name manually
|
216
|
+
exported table name manually:
|
217
217
|
|
218
218
|
```ruby
|
219
219
|
table.name = 'my_table_name'
|
@@ -230,7 +230,7 @@ A small command-line utility called dbf is installed along with the gem.
|
|
230
230
|
-s = print summary information
|
231
231
|
-a = create an ActiveRecord::Schema
|
232
232
|
-r = create a Sequel Migration
|
233
|
-
-c =
|
233
|
+
-c = dump data in CSV format
|
234
234
|
|
235
235
|
Create an executable ActiveRecord schema:
|
236
236
|
|
@@ -246,17 +246,17 @@ Dump all records to a CSV file:
|
|
246
246
|
|
247
247
|
## Reading a Visual Foxpro database (v8, v9)
|
248
248
|
|
249
|
-
A special Database::Foxpro class is available to read Visual Foxpro container
|
250
|
-
|
249
|
+
A special Database::Foxpro class is available to read Visual Foxpro container
|
250
|
+
files (file with .dbc extension). When using this class long field names are
|
251
|
+
supported and tables can be referenced without using names.
|
251
252
|
|
252
253
|
```ruby
|
253
254
|
require 'dbf'
|
254
255
|
|
255
|
-
contacts = DBF::Database::Foxpro.new('
|
256
|
+
contacts = DBF::Database::Foxpro.new('contact_database.dbc').contacts
|
256
257
|
my_contact = contacts.record(1).spouses_interests
|
257
258
|
```
|
258
259
|
|
259
|
-
|
260
260
|
## dBase version compatibility
|
261
261
|
|
262
262
|
The basic dBase data types are generally supported well. Support for the
|
data/lib/dbf/column.rb
CHANGED
@@ -108,7 +108,7 @@ module DBF
|
|
108
108
|
strip_output ? output.strip : output
|
109
109
|
end
|
110
110
|
|
111
|
-
def encode_string(string)
|
111
|
+
def encode_string(string) # nodoc
|
112
112
|
string.force_encoding(@encoding).encode(*encoding_args)
|
113
113
|
end
|
114
114
|
|
@@ -136,11 +136,7 @@ module DBF
|
|
136
136
|
when 'M'
|
137
137
|
':text'
|
138
138
|
when 'B'
|
139
|
-
|
140
|
-
':float'
|
141
|
-
else
|
142
|
-
':text'
|
143
|
-
end
|
139
|
+
':binary'
|
144
140
|
else
|
145
141
|
if format == :sequel
|
146
142
|
":varchar, :size => #{length}"
|
data/lib/dbf/table.rb
CHANGED
@@ -253,7 +253,7 @@ module DBF
|
|
253
253
|
if memo
|
254
254
|
meth = memo.is_a?(StringIO) ? :new : :open
|
255
255
|
memo_class.send(meth, memo, version)
|
256
|
-
elsif !data.is_a?
|
256
|
+
elsif !data.is_a?(StringIO)
|
257
257
|
files = Dir.glob(memo_search_path data)
|
258
258
|
files.any? ? memo_class.open(files.first, version) : nil
|
259
259
|
end
|
data/lib/dbf/version.rb
CHANGED
data/spec/dbf/column_spec.rb
CHANGED
@@ -296,7 +296,7 @@ RSpec.describe DBF::Column do
|
|
296
296
|
context 'with Foxpro dbf' do
|
297
297
|
it 'outputs a float column' do
|
298
298
|
column = DBF::Column.new table, 'ColumnName', 'B', 1, 2
|
299
|
-
expect(column.schema_definition).to eq "\"column_name\", :
|
299
|
+
expect(column.schema_definition).to eq "\"column_name\", :binary\n"
|
300
300
|
end
|
301
301
|
end
|
302
302
|
end
|
data/spec/spec_helper.rb
CHANGED
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.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-30 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.
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: 1.3.0
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.5.1
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Read xBase files
|