dbf 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/README.txt +7 -1
- data/Rakefile +1 -1
- data/bin/dbf +2 -2
- data/lib/dbf/record.rb +4 -2
- data/spec/unit/table_spec.rb +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 1.0.1
|
2
|
+
|
3
|
+
* Fixes error when using the command-line interface [#11984]
|
4
|
+
|
5
|
+
== 1.0.0
|
6
|
+
|
7
|
+
* Renamed classes and refactored code in preparation for adding the
|
8
|
+
ability to save records and create/compact databases.
|
9
|
+
|
1
10
|
== 0.5.4
|
2
11
|
|
3
12
|
* Ignore deleted records in both memory modes
|
data/README.txt
CHANGED
@@ -35,7 +35,7 @@ Copyright (c) 2006-2007 Keith Morrison <keithm@infused.org, www.infused.org>
|
|
35
35
|
puts table.record(4).name
|
36
36
|
|
37
37
|
# Attributes can also be accessed using the column name as a Hash key
|
38
|
-
puts table.record(4)["name"]
|
38
|
+
puts table.record(4).attributes["name"]
|
39
39
|
|
40
40
|
# Print the 'name' and 'address' fields from each record
|
41
41
|
table.records.each do |record|
|
@@ -66,6 +66,12 @@ A small command-line utility called dbf is installed along with the gem.
|
|
66
66
|
-h = print this message
|
67
67
|
-s = print summary information
|
68
68
|
-a = create an ActiveRecord::Schema
|
69
|
+
|
70
|
+
== Changes from 0.5.x
|
71
|
+
|
72
|
+
* The Reader class has been renamed to Table
|
73
|
+
* Attributes are no longer accessed directly from the record. Use record.attribute['column_name']
|
74
|
+
instead, or use the new attribute accessors detailed under Basic Usage.
|
69
75
|
|
70
76
|
== Limitations and known bugs
|
71
77
|
|
data/Rakefile
CHANGED
data/bin/dbf
CHANGED
@@ -18,12 +18,12 @@ else
|
|
18
18
|
|
19
19
|
# create an ActiveRecord::Schema
|
20
20
|
if $a
|
21
|
-
reader = DBF::
|
21
|
+
reader = DBF::Table.new filename
|
22
22
|
puts reader.schema
|
23
23
|
end
|
24
24
|
|
25
25
|
if $s
|
26
|
-
reader = DBF::
|
26
|
+
reader = DBF::Table.new filename
|
27
27
|
puts
|
28
28
|
puts "Database: #{filename}"
|
29
29
|
puts "Type: (#{reader.version}) #{reader.version_description}"
|
data/lib/dbf/record.rb
CHANGED
@@ -36,9 +36,11 @@ module DBF
|
|
36
36
|
raw = unpack_string(column).strip
|
37
37
|
unless raw.empty?
|
38
38
|
begin
|
39
|
-
|
39
|
+
parts = raw.match(DATE_REGEXP).to_a.slice(1,3).map {|n| n.to_i}
|
40
|
+
@attributes[column.name] = Time.gm(*parts)
|
40
41
|
rescue
|
41
|
-
|
42
|
+
parts = raw.match(DATE_REGEXP).to_a.slice(1,3).map {|n| n.to_i}
|
43
|
+
@attributes[column.name] = Date.new(*parts)
|
42
44
|
end
|
43
45
|
end
|
44
46
|
when 'M' # memo
|
data/spec/unit/table_spec.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: dbf
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2007-
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2007-07-23 00:00:00 -07:00
|
8
8
|
summary: A small fast library for reading dBase, xBase, Clipper and FoxPro database files.
|
9
9
|
require_paths:
|
10
10
|
- lib
|