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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08d6418f40c542f1578ea41fbc1fc8aa5715ed2b
4
- data.tar.gz: 6d20853aa0254eb08179fb5dc8441960c51f264d
3
+ metadata.gz: aecf544df6670b726e4edfbf08511819e9eb67d3
4
+ data.tar.gz: 7b5e97b5e6102e13648ed1542066f47d78cebba3
5
5
  SHA512:
6
- metadata.gz: e36af450c002735e628b512d23e86627f31922f45d3943506c17566594e1ed2d5f95be0b4dc2672a33441bc5dc89b2a1a56379c7f85dced38bb03e50a49f61fd
7
- data.tar.gz: d4b459e1ca43427975b2c83d0469fccaed2b4476fe91b4c76c2ba01124d859ed21f89a61ac15d09c645f7f24f1e88aeaaefad350934ec284e0ee5ea0c274a541
6
+ metadata.gz: 5dd35b97f6f334523543f0885a893c37eb7edfba91ffe529c769bc38f51a7ffed55edc4eb50b6d74e587a56d5c35055d1188ac97e024ceb8b24e14527cb21e29
7
+ data.tar.gz: a4faecdc9176581351003c30ef8651d8a7fbe6031b8cc85989f20677a3eb95f6d76e919eb7d4f017d129abff23670472ac71c0371763ae3555936225f5344196
@@ -1,3 +1,6 @@
1
+ # 3.1.0
2
+ - Use :binary for binary fields in ActiveRecord schemas
3
+
1
4
  # 3.0.8
2
5
  - Fix uninitialized constant error under Rails 5
3
6
 
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ gemspec
2
2
  source 'https://rubygems.org'
3
3
 
4
4
  group :development, :test do
5
+ gem 'byebug'
5
6
  gem 'rake'
6
7
  gem 'rspec'
7
8
  gem 'guard'
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dbf (3.0.7)
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.5)
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.3)
37
+ pry (0.10.2)
38
38
  coderay (~> 1.1.0)
39
39
  method_source (~> 0.8.1)
40
40
  slop (~> 3.4)
41
- pry (0.10.3-java)
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
@@ -3,5 +3,6 @@ source 'https://rubygems.org'
3
3
 
4
4
  group :test do
5
5
  gem 'rspec'
6
- gem 'codeclimate-test-reporter', require: false, platform: :ruby
6
+ gem 'simplecov', platform: :ruby
7
+ gem 'codeclimate-test-reporter'
7
8
  end
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 a StringIO):
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 with:
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 with:
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 = create a csv file
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 files (.dbc-files). When using this class,
250
- long field names are supported and tables can be referenced without using names.
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('contactdatabase.dbc').contacts
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
@@ -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
- if DBF::Table::FOXPRO_VERSIONS.keys.include?(@version)
140
- ':float'
141
- else
142
- ':text'
143
- end
139
+ ':binary'
144
140
  else
145
141
  if format == :sequel
146
142
  ":varchar, :size => #{length}"
@@ -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? StringIO
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
@@ -1,3 +1,3 @@
1
1
  module DBF
2
- VERSION = '3.0.8'
2
+ VERSION = '3.1.0'
3
3
  end
@@ -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\", :float\n"
299
+ expect(column.schema_definition).to eq "\"column_name\", :binary\n"
300
300
  end
301
301
  end
302
302
  end
@@ -1,6 +1,6 @@
1
1
  begin
2
- require 'codeclimate-test-reporter'
3
- CodeClimate::TestReporter.start
2
+ require 'simplecov'
3
+ SimpleCov.start
4
4
  rescue LoadError
5
5
  end
6
6
 
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.8
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-10-10 00:00:00.000000000 Z
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.4.5.1
113
+ rubygems_version: 2.5.1
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Read xBase files