dbf 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 250d5b1253dc56182318a846f9002e61d87b45bb
4
+ data.tar.gz: c434e084787b3ff199e87c759b52783b8cffad4b
5
+ SHA512:
6
+ metadata.gz: 7b04b5bd719c803750d1d65d558c125f40b1f4480360a41f05dadeea2eb96f36fe995d7e6a15388de56c7880e660270f1b2f4be79471299396d38fa4919f68c2
7
+ data.tar.gz: 92fbdda6187c229b040bf1a830072b0f40652e1c5612ee4f31f164c481ab5486b13747107555d4433d7b9f2611999fc21150fe09e16de17b83ef7f386824ebf3
@@ -1,3 +1,6 @@
1
+ # 2.0.5
2
+ - use correct FoxPro memo block size
3
+
1
4
  # 2.0.4
2
5
  - memo fields return nil if memo file is missing
3
6
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dbf (2.0.3)
4
+ dbf (2.0.4)
5
5
  fastercsv (~> 1.5.4)
6
6
 
7
7
  GEM
@@ -9,7 +9,7 @@ GEM
9
9
  specs:
10
10
  diff-lcs (1.2.4)
11
11
  fastercsv (1.5.5)
12
- rake (0.9.2.2)
12
+ rake (10.0.4)
13
13
  rspec (2.13.0)
14
14
  rspec-core (~> 2.13.0)
15
15
  rspec-expectations (~> 2.13.0)
@@ -20,6 +20,7 @@ GEM
20
20
  rspec-mocks (2.13.1)
21
21
 
22
22
  PLATFORMS
23
+ java
23
24
  ruby
24
25
 
25
26
  DEPENDENCIES
@@ -29,7 +29,7 @@ module DBF
29
29
  private
30
30
 
31
31
  def offset(start_block) #nodoc
32
- start_block * BLOCK_SIZE
32
+ start_block * block_size
33
33
  end
34
34
 
35
35
  def content_size(memo_size) #nodoc
@@ -39,6 +39,10 @@ module DBF
39
39
  def block_content_size #nodoc
40
40
  @block_content_size ||= block_size - BLOCK_HEADER_SIZE
41
41
  end
42
+
43
+ def block_size
44
+ BLOCK_SIZE
45
+ end
42
46
  end
43
47
  end
44
48
  end
@@ -2,13 +2,13 @@ module DBF
2
2
  module Memo
3
3
  class Foxpro < Base
4
4
  FPT_HEADER_SIZE = 512
5
-
5
+
6
6
  def build_memo(start_block) #nodoc
7
7
  @data.seek offset(start_block)
8
-
8
+
9
9
  memo_type, memo_size, memo_string = @data.read(block_size).unpack("NNa*")
10
10
  return nil unless memo_type == 1 && memo_size > 0
11
-
11
+
12
12
  if memo_size > block_content_size
13
13
  memo_string << @data.read(content_size(memo_size))
14
14
  else
@@ -16,9 +16,9 @@ module DBF
16
16
  end
17
17
  memo_string
18
18
  end
19
-
19
+
20
20
  private
21
-
21
+
22
22
  def block_size #nodoc
23
23
  @block_size ||= begin
24
24
  @data.rewind
@@ -51,8 +51,11 @@ module DBF
51
51
  end
52
52
 
53
53
  def respond_to?(method, *args)
54
- return true if column_names.include?(method.to_s)
55
- super
54
+ if column_names.include?(method.to_s)
55
+ true
56
+ else
57
+ super
58
+ end
56
59
  end
57
60
 
58
61
  def method_missing(method, *args)
@@ -1,3 +1,3 @@
1
1
  module DBF
2
- VERSION = '2.0.4'
2
+ VERSION = '2.0.5'
3
3
  end
@@ -151,4 +151,8 @@ describe DBF, "of type f5 (FoxPro with memo file)" do
151
151
  it "should determine the number of records" do
152
152
  expect(table.record_count).to eq 975
153
153
  end
154
+
155
+ it "reads memo data" do
156
+ expect(table.record(3).obse).to match(/\Ajos.*pare\.\Z/m)
157
+ end
154
158
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
5
- prerelease:
4
+ version: 2.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Keith Morrison
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-07-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: fastercsv
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,17 +41,15 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: 0.9.2
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: 0.9.2
62
55
  description: A small fast library for reading dBase, xBase, Clipper and FoxPro database
@@ -112,28 +105,27 @@ files:
112
105
  - dbf.gemspec
113
106
  homepage: http://github.com/infused/dbf
114
107
  licenses: []
108
+ metadata: {}
115
109
  post_install_message:
116
110
  rdoc_options:
117
111
  - --charset=UTF-8
118
112
  require_paths:
119
113
  - lib
120
114
  required_ruby_version: !ruby/object:Gem::Requirement
121
- none: false
122
115
  requirements:
123
- - - ! '>='
116
+ - - '>='
124
117
  - !ruby/object:Gem::Version
125
118
  version: '0'
126
119
  required_rubygems_version: !ruby/object:Gem::Requirement
127
- none: false
128
120
  requirements:
129
- - - ! '>='
121
+ - - '>='
130
122
  - !ruby/object:Gem::Version
131
123
  version: 1.3.0
132
124
  requirements: []
133
125
  rubyforge_project:
134
- rubygems_version: 1.8.25
126
+ rubygems_version: 2.0.3
135
127
  signing_key:
136
- specification_version: 3
128
+ specification_version: 4
137
129
  summary: Read xBase files
138
130
  test_files:
139
131
  - spec/dbf/column_spec.rb