dbf 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :minor: 1
3
2
  :build:
4
- :patch: 2
3
+ :patch: 0
5
4
  :major: 1
5
+ :minor: 2
data/dbf.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dbf}
8
- s.version = "1.1.2"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Keith Morrison"]
12
- s.date = %q{2010-01-15}
12
+ s.date = %q{2010-02-13}
13
13
  s.default_executable = %q{dbf}
14
14
  s.description = %q{A small fast library for reading dBase, xBase, Clipper and FoxPro database files.}
15
15
  s.email = %q{keithm@infused.org}
data/lib/dbf/table.rb CHANGED
@@ -120,6 +120,12 @@ module DBF
120
120
  s
121
121
  end
122
122
 
123
+ def to_a
124
+ records = []
125
+ each {|record| records << record if record}
126
+ records
127
+ end
128
+
123
129
  # Dumps all records to a CSV file. If no filename is given then CSV is
124
130
  # output to STDOUT.
125
131
  #
@@ -85,13 +85,13 @@ describe DBF::Record do
85
85
  end
86
86
  end
87
87
 
88
- # describe '#to_a' do
89
- # it 'should return an ordered array of attribute values' do
90
- # table = DBF::Table.new "#{DB_PATH}/dbase_8b.dbf"
91
- # record = table.records[9]
92
- # record.to_a.should == ["Ten records stored in this database", 10.0, nil, false, "0.100000000000000000", nil]
93
- # end
94
- # end
88
+ describe '#to_a' do
89
+ it 'should return an ordered array of attribute values' do
90
+ table = DBF::Table.new "#{DB_PATH}/dbase_8b.dbf"
91
+ record = table.record(9)
92
+ record.to_a.should == ["Ten records stored in this database", 10.0, nil, false, "0.100000000000000000", nil]
93
+ end
94
+ end
95
95
 
96
96
  describe '#==' do
97
97
  before do
@@ -88,6 +88,19 @@ describe DBF::Table do
88
88
  end
89
89
  end
90
90
 
91
+ describe '#to_a' do
92
+ before do
93
+ @table = DBF::Table.new "#{DB_PATH}/dbase_83.dbf"
94
+
95
+ @records = []
96
+ @table.each {|record| @records << record}
97
+ end
98
+
99
+ it 'should return an array of records' do
100
+ @table.to_a.should == @records
101
+ end
102
+ end
103
+
91
104
  describe '#to_csv' do
92
105
  before do
93
106
  @table = DBF::Table.new "#{DB_PATH}/dbase_83.dbf"
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.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Morrison
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-15 00:00:00 -08:00
12
+ date: 2010-02-13 00:00:00 -08:00
13
13
  default_executable: dbf
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency