dbf 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -2,7 +2,7 @@ require 'hoe'
2
2
  require 'spec/rake/spectask'
3
3
 
4
4
  PKG_NAME = "dbf"
5
- PKG_VERSION = "1.0.0"
5
+ PKG_VERSION = "1.0.1"
6
6
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
7
7
 
8
8
  Hoe.new PKG_NAME, PKG_VERSION do |p|
data/bin/dbf CHANGED
@@ -18,12 +18,12 @@ else
18
18
 
19
19
  # create an ActiveRecord::Schema
20
20
  if $a
21
- reader = DBF::Reader.new filename
21
+ reader = DBF::Table.new filename
22
22
  puts reader.schema
23
23
  end
24
24
 
25
25
  if $s
26
- reader = DBF::Reader.new filename
26
+ reader = DBF::Table.new filename
27
27
  puts
28
28
  puts "Database: #{filename}"
29
29
  puts "Type: (#{reader.version}) #{reader.version_description}"
@@ -36,9 +36,11 @@ module DBF
36
36
  raw = unpack_string(column).strip
37
37
  unless raw.empty?
38
38
  begin
39
- @attributes[column.name] = Time.gm(*raw.match(DATE_REGEXP).to_a.slice(1,3).map {|n| n.to_i})
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
- @attributes[column.name] = Date.new(*raw.match(DATE_REGEXP).to_a.slice(1,3).map {|n| n.to_i})
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
@@ -19,7 +19,7 @@ describe DBF::Table, "when initialized" do
19
19
  @table.memo_file_format.should == :dbt
20
20
  end
21
21
 
22
- it "should determine the memo block size" do
22
+ it "should determine the correct memo block size" do
23
23
  @table.memo_block_size.should == 512
24
24
  end
25
25
 
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.0
7
- date: 2007-06-27 00:00:00 -07:00
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