dbf 1.1.0 → 1.1.1

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/History.txt CHANGED
@@ -1,14 +1,19 @@
1
+ == 1.1.1
2
+
3
+ * Return invalid DateTime columns as nil
4
+
5
+ == 1.1.0
6
+
7
+ * Add support for large table that will not fit into memory
8
+
1
9
  == 1.0.13
10
+
2
11
  * Allow passing an array of ids to find
3
12
 
4
13
  == 1.0.11
5
14
 
6
15
  * Attributes are now accessible by original or underscored name
7
16
 
8
- == 1.1.0
9
-
10
- * Add support for large table that will not fit into memory
11
-
12
17
  == 1.0.9
13
18
 
14
19
  * Fix incorrect integer column values (only affecting some dbf files)
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 1
4
- :patch: 0
4
+ :patch: 1
5
5
 
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.0"
8
+ s.version = "1.1.1"
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{2009-12-14}
12
+ s.date = %q{2009-12-29}
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/column.rb CHANGED
@@ -48,7 +48,7 @@ module DBF
48
48
  def decode_datetime(value)
49
49
  days, milliseconds = value.unpack('l2')
50
50
  seconds = milliseconds / 1000
51
- DateTime.jd(days, seconds/3600, seconds/60 % 60, seconds % 60)
51
+ DateTime.jd(days, seconds/3600, seconds/60 % 60, seconds % 60) rescue nil
52
52
  end
53
53
 
54
54
  # Decode a number value
@@ -64,13 +64,19 @@ describe DBF::Column do
64
64
  column.type_cast(value).should == false
65
65
  end
66
66
 
67
- it "should cast :datetime columns to DateTime" do
67
+ it "should cast datetime columns to DateTime" do
68
68
  value = "Nl%\000\300Z\252\003"
69
69
  column = DBF::Column.new "ColumnName", "T", 16, 0
70
70
  column.type_cast(value).should == "2002-10-10T17:04:56+00:00"
71
71
  end
72
72
 
73
- it "should cast :date columns to Date" do
73
+ it "should cast invalid datetime columns to nil" do
74
+ value = "Nl%\000\000A\000\999"
75
+ column = DBF::Column.new "ColumnName", "T", 16, 0
76
+ column.type_cast(value).should be_nil
77
+ end
78
+
79
+ it "should cast date columns to Date" do
74
80
  value = "20050712"
75
81
  column = DBF::Column.new "ColumnName", "D", 8, 0
76
82
  column.type_cast(value).should == Date.new(2005,7,12)
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.0
4
+ version: 1.1.1
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: 2009-12-14 00:00:00 +01:00
12
+ date: 2009-12-29 00:00:00 -06:00
13
13
  default_executable: dbf
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency