dbf 1.7.4 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/dbf/column/base.rb +3 -0
- data/lib/dbf/version.rb +1 -1
- data/spec/dbf/column_spec.rb +8 -0
- metadata +7 -7
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/dbf/column/base.rb
CHANGED
@@ -28,6 +28,7 @@ module DBF
|
|
28
28
|
when 'N' then unpack_number(value)
|
29
29
|
when 'I' then unpack_unsigned_long(value)
|
30
30
|
when 'F' then value.to_f
|
31
|
+
when 'Y' then unpack_unsigned_long(value) / 10000.0
|
31
32
|
when 'D' then decode_date(value)
|
32
33
|
when 'T' then decode_datetime(value)
|
33
34
|
when 'L' then boolean(value)
|
@@ -91,6 +92,8 @@ module DBF
|
|
91
92
|
decimal > 0 ? ":float" : ":integer"
|
92
93
|
when "I"
|
93
94
|
":integer"
|
95
|
+
when "Y"
|
96
|
+
":decimal, :precision => 15, :scale => 4"
|
94
97
|
when "D"
|
95
98
|
":date"
|
96
99
|
when "T"
|
data/lib/dbf/version.rb
CHANGED
data/spec/dbf/column_spec.rb
CHANGED
@@ -137,6 +137,14 @@ describe DBF::Column::Dbase do
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
+
context 'with type Y (currency)' do
|
141
|
+
let(:column) { DBF::Column::Dbase.new "ColumnName", "Y", 8, 4, "31" }
|
142
|
+
|
143
|
+
it 'casts to float' do
|
144
|
+
column.type_cast(" \xBF\x02\x00\x00\x00\x00\x00").should == 18.0
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
140
148
|
context "#schema_definition" do
|
141
149
|
context 'with type N (number)' do
|
142
150
|
it "outputs an integer column" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-15 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70239250987360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.8.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70239250987360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70239250986900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.9.2
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70239250986900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rdoc
|
38
|
-
requirement: &
|
38
|
+
requirement: &70239250986420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '3.11'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70239250986420
|
47
47
|
description: A small fast library for reading dBase, xBase, Clipper and FoxPro database
|
48
48
|
files.
|
49
49
|
email: keithm@infused.org
|