diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4b76cd..36c20bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', 'head'] + ruby-version: ['3.0', '3.1', '3.2', '3.3', 'head'] steps: - uses: actions/checkout@v3 diff --git a/.ruby-version b/.ruby-version index be94e6f..15a2799 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.3.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6c1a2..a077a88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 4.3.0 + +- Drop support for Ruby versions older than 3.0 +- Require CSV gem + ## 4.2.4 - Exclude unnecessary files from the gem file list diff --git a/LICENSE b/LICENSE index 0bcf803..99aea3a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2006-2023 Keith Morrison +Copyright (c) 2006-2024 Keith Morrison Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index 364a2e7..a5b72a0 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ DBF is a small, fast Ruby library for reading dBase, xBase, Clipper, and FoxPro subject line * Change log: +NOTE: + NOTE: Beginning with version 4, we have dropped support for Ruby 2.0, 2.1, 2.2, and 2.3. If you need support for these older Rubies, please use 3.0.x () @@ -26,7 +28,7 @@ please use 2.0.x () DBF is tested to work with the following versions of Ruby: -* Ruby 2.4.x, 2.5.x, 2.6.x, 2.7.x, 3.0.x, 3.1.x, and 3.2.x +* Ruby 3.0.x, 3.1.x, 3.2.x, 3.3.x ## Installation @@ -362,7 +364,7 @@ Data type descriptions ## License -Copyright (c) 2006-2023 Keith Morrison <> +Copyright (c) 2006-2024 Keith Morrison <> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/dbf.gemspec b/dbf.gemspec index 885635e..0e209bd 100644 --- a/dbf.gemspec +++ b/dbf.gemspec @@ -18,6 +18,7 @@ Gem::Specification.new do |s| s.files = Dir['README.md', 'CHANGELOG.md', 'LICENSE', '{bin,lib,spec}/**/*', 'dbf.gemspec'] s.require_paths = ['lib'] s.required_rubygems_version = Gem::Requirement.new('>= 1.3.0') - s.required_ruby_version = Gem::Requirement.new('>= 2.4.0') + s.required_ruby_version = Gem::Requirement.new('>= 3.0.0') s.metadata['rubygems_mfa_required'] = 'true' + s.add_runtime_dependency 'csv' end diff --git a/doc/DBF.html b/doc/DBF.html index 4dd7da0..59264c8 100644 --- a/doc/DBF.html +++ b/doc/DBF.html @@ -6,7 +6,7 @@ Module: DBF - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -109,7 +109,7 @@

VERSION =
-
'4.2.2'.freeze
+
'4.2.4'.freeze
ENCODINGS = @@ -190,9 +190,9 @@

diff --git a/doc/DBF/Column.html b/doc/DBF/Column.html index 1bd175d..f7f7456 100644 --- a/doc/DBF/Column.html +++ b/doc/DBF/Column.html @@ -6,7 +6,7 @@ Class: DBF::Column - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -910,22 +910,14 @@

71 72 73 -74 -75 -76 -77 -78 +74
# File 'lib/dbf/column.rb', line 70
 
 def underscored_name
   @underscored_name ||= begin
-    name.gsub(/::/, '/')
-      .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
-      .gsub(/([a-z\d])([A-Z])/, '\1_\2')
-      .tr('-', '_')
-      .downcase
+    name.gsub(/([a-z\d])([A-Z])/, '\1_\2').tr('-', '_').downcase
   end
 end
@@ -938,9 +930,9 @@

diff --git a/doc/DBF/Column/LengthError.html b/doc/DBF/Column/LengthError.html index 936f8bc..236f3db 100644 --- a/doc/DBF/Column/LengthError.html +++ b/doc/DBF/Column/LengthError.html @@ -6,7 +6,7 @@ Exception: DBF::Column::LengthError - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -114,9 +114,9 @@ diff --git a/doc/DBF/Column/NameError.html b/doc/DBF/Column/NameError.html index 286d728..d1e7ce7 100644 --- a/doc/DBF/Column/NameError.html +++ b/doc/DBF/Column/NameError.html @@ -6,7 +6,7 @@ Exception: DBF::Column::NameError - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -114,9 +114,9 @@ diff --git a/doc/DBF/ColumnType.html b/doc/DBF/ColumnType.html index 3cee8af..dfade9b 100644 --- a/doc/DBF/ColumnType.html +++ b/doc/DBF/ColumnType.html @@ -6,7 +6,7 @@ Module: DBF::ColumnType - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -105,9 +105,9 @@

Defined Under Namespace

diff --git a/doc/DBF/ColumnType/Base.html b/doc/DBF/ColumnType/Base.html index eb30e72..d6f3ec6 100644 --- a/doc/DBF/ColumnType/Base.html +++ b/doc/DBF/ColumnType/Base.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Base - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -379,9 +379,9 @@

diff --git a/doc/DBF/ColumnType/Boolean.html b/doc/DBF/ColumnType/Boolean.html index 1318522..22a7ae1 100644 --- a/doc/DBF/ColumnType/Boolean.html +++ b/doc/DBF/ColumnType/Boolean.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Boolean - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/Currency.html b/doc/DBF/ColumnType/Currency.html index ef27e08..ab5f41c 100644 --- a/doc/DBF/ColumnType/Currency.html +++ b/doc/DBF/ColumnType/Currency.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Currency - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/Date.html b/doc/DBF/ColumnType/Date.html index b70ed12..41bb2ee 100644 --- a/doc/DBF/ColumnType/Date.html +++ b/doc/DBF/ColumnType/Date.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Date - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -232,9 +232,9 @@

diff --git a/doc/DBF/ColumnType/DateTime.html b/doc/DBF/ColumnType/DateTime.html index 444832c..ceb3b48 100644 --- a/doc/DBF/ColumnType/DateTime.html +++ b/doc/DBF/ColumnType/DateTime.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::DateTime - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -236,9 +236,9 @@

diff --git a/doc/DBF/ColumnType/Double.html b/doc/DBF/ColumnType/Double.html index 84719fc..74fd2b8 100644 --- a/doc/DBF/ColumnType/Double.html +++ b/doc/DBF/ColumnType/Double.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Double - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/Float.html b/doc/DBF/ColumnType/Float.html index 3151c70..7edd34f 100644 --- a/doc/DBF/ColumnType/Float.html +++ b/doc/DBF/ColumnType/Float.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Float - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/General.html b/doc/DBF/ColumnType/General.html index 1778c13..cd136d8 100644 --- a/doc/DBF/ColumnType/General.html +++ b/doc/DBF/ColumnType/General.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::General - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/Memo.html b/doc/DBF/ColumnType/Memo.html index a5627ef..274501c 100644 --- a/doc/DBF/ColumnType/Memo.html +++ b/doc/DBF/ColumnType/Memo.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Memo - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -236,9 +236,9 @@

diff --git a/doc/DBF/ColumnType/Nil.html b/doc/DBF/ColumnType/Nil.html index 44aa41e..f2f9805 100644 --- a/doc/DBF/ColumnType/Nil.html +++ b/doc/DBF/ColumnType/Nil.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Nil - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/Number.html b/doc/DBF/ColumnType/Number.html index 849efb7..e2fe6c6 100644 --- a/doc/DBF/ColumnType/Number.html +++ b/doc/DBF/ColumnType/Number.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::Number - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -232,9 +232,9 @@

diff --git a/doc/DBF/ColumnType/SignedLong.html b/doc/DBF/ColumnType/SignedLong.html index 88aa52a..bc10602 100644 --- a/doc/DBF/ColumnType/SignedLong.html +++ b/doc/DBF/ColumnType/SignedLong.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::SignedLong - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -228,9 +228,9 @@

diff --git a/doc/DBF/ColumnType/SignedLong2.html b/doc/DBF/ColumnType/SignedLong2.html index d161940..5598e91 100644 --- a/doc/DBF/ColumnType/SignedLong2.html +++ b/doc/DBF/ColumnType/SignedLong2.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::SignedLong2 - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -232,9 +232,9 @@

diff --git a/doc/DBF/ColumnType/String.html b/doc/DBF/ColumnType/String.html index 4136d74..fab67b0 100644 --- a/doc/DBF/ColumnType/String.html +++ b/doc/DBF/ColumnType/String.html @@ -6,7 +6,7 @@ Class: DBF::ColumnType::String - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -230,9 +230,9 @@

diff --git a/doc/DBF/Database.html b/doc/DBF/Database.html index 9582ebe..7e3b9fe 100644 --- a/doc/DBF/Database.html +++ b/doc/DBF/Database.html @@ -6,7 +6,7 @@ Module: DBF::Database - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -116,9 +116,9 @@

Overview

diff --git a/doc/DBF/Database/Foxpro.html b/doc/DBF/Database/Foxpro.html index 833b856..168e358 100644 --- a/doc/DBF/Database/Foxpro.html +++ b/doc/DBF/Database/Foxpro.html @@ -6,7 +6,7 @@ Class: DBF::Database::Foxpro - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -643,9 +643,9 @@

diff --git a/doc/DBF/Database/Table.html b/doc/DBF/Database/Table.html index c495b61..e5ece3c 100644 --- a/doc/DBF/Database/Table.html +++ b/doc/DBF/Database/Table.html @@ -6,7 +6,7 @@ Class: DBF::Database::Table - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -336,9 +336,9 @@

diff --git a/doc/DBF/FileNotFoundError.html b/doc/DBF/FileNotFoundError.html index d5c0e7c..552de6d 100644 --- a/doc/DBF/FileNotFoundError.html +++ b/doc/DBF/FileNotFoundError.html @@ -6,7 +6,7 @@ Exception: DBF::FileNotFoundError - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -114,9 +114,9 @@ diff --git a/doc/DBF/Header.html b/doc/DBF/Header.html index f9cfe5a..a54d086 100644 --- a/doc/DBF/Header.html +++ b/doc/DBF/Header.html @@ -6,7 +6,7 @@ Class: DBF::Header - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -713,9 +713,9 @@

diff --git a/doc/DBF/Memo.html b/doc/DBF/Memo.html index 0f06ffa..30b3a1c 100644 --- a/doc/DBF/Memo.html +++ b/doc/DBF/Memo.html @@ -6,7 +6,7 @@ Module: DBF::Memo - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -107,9 +107,9 @@

Defined Under Namespace

diff --git a/doc/DBF/Memo/Base.html b/doc/DBF/Memo/Base.html index b9a8027..f4248a6 100644 --- a/doc/DBF/Memo/Base.html +++ b/doc/DBF/Memo/Base.html @@ -6,7 +6,7 @@ Class: DBF::Memo::Base - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -475,9 +475,9 @@

diff --git a/doc/DBF/Memo/Dbase3.html b/doc/DBF/Memo/Dbase3.html index 1b9f40d..4c87122 100644 --- a/doc/DBF/Memo/Dbase3.html +++ b/doc/DBF/Memo/Dbase3.html @@ -6,7 +6,7 @@ Class: DBF::Memo::Dbase3 - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -232,9 +232,9 @@

diff --git a/doc/DBF/Memo/Dbase4.html b/doc/DBF/Memo/Dbase4.html index ce7c4de..22399e1 100644 --- a/doc/DBF/Memo/Dbase4.html +++ b/doc/DBF/Memo/Dbase4.html @@ -6,7 +6,7 @@ Class: DBF::Memo::Dbase4 - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -220,9 +220,9 @@

diff --git a/doc/DBF/Memo/Foxpro.html b/doc/DBF/Memo/Foxpro.html index 47bb251..ea62bd2 100644 --- a/doc/DBF/Memo/Foxpro.html +++ b/doc/DBF/Memo/Foxpro.html @@ -6,7 +6,7 @@ Class: DBF::Memo::Foxpro - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -258,9 +258,9 @@

diff --git a/doc/DBF/NoColumnsDefined.html b/doc/DBF/NoColumnsDefined.html index 93b8fd7..05549fc 100644 --- a/doc/DBF/NoColumnsDefined.html +++ b/doc/DBF/NoColumnsDefined.html @@ -6,7 +6,7 @@ Exception: DBF::NoColumnsDefined - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -114,9 +114,9 @@ diff --git a/doc/DBF/Record.html b/doc/DBF/Record.html index e4401a6..895633a 100644 --- a/doc/DBF/Record.html +++ b/doc/DBF/Record.html @@ -6,7 +6,7 @@ Class: DBF::Record - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -763,9 +763,9 @@

diff --git a/doc/DBF/Schema.html b/doc/DBF/Schema.html index 93bf5ab..8c97d16 100644 --- a/doc/DBF/Schema.html +++ b/doc/DBF/Schema.html @@ -6,7 +6,7 @@ Module: DBF::Schema - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -970,9 +970,9 @@

diff --git a/doc/DBF/Table.html b/doc/DBF/Table.html index 86e27e1..28e7a6d 100644 --- a/doc/DBF/Table.html +++ b/doc/DBF/Table.html @@ -6,7 +6,7 @@ Class: DBF::Table - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -1568,9 +1568,9 @@

diff --git a/doc/_index.html b/doc/_index.html index d339460..9729310 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -4,7 +4,7 @@ - Documentation by YARD 0.9.28 + Documentation by YARD 0.9.34 @@ -52,7 +52,7 @@
-

Documentation by YARD 0.9.28

+

Documentation by YARD 0.9.34

Alphabetic Index

@@ -412,9 +412,9 @@

Namespace Listing A-Z

diff --git a/doc/file.README.html b/doc/file.README.html index 4f33552..df6798a 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -6,7 +6,7 @@ File: README - — Documentation by YARD 0.9.28 + — Documentation by YARD 0.9.34 @@ -62,28 +62,30 @@

DBF

-

DBF is a small fast library for reading dBase, xBase, Clipper and FoxPro database files

+

DBF is a small, fast Ruby library for reading dBase, xBase, Clipper, and FoxPro database files.

-

NOTE: Beginning with version 4 we have dropped support for Ruby 2.0, 2.1, 2.2, and 2.3. If you need support for these older Rubies, please use 3.0.x (github.com/infused.org/dbf/tree/3_stable)

+

NOTE:

-

NOTE: Beginning with version 3 we have dropped support for Ruby 1.8 and 1.9. If you need support for older Rubies, please use 2.0.x (github.com/infused/dbf/tree/2_stable)

+

NOTE: Beginning with version 4, we have dropped support for Ruby 2.0, 2.1, 2.2, and 2.3. If you need support for these older Rubies, please use 3.0.x (github.com/infused.org/dbf/tree/3_stable)

+ +

NOTE: Beginning with version 3, we have dropped support for Ruby 1.8 and 1.9. If you need support for older Rubies, please use 2.0.x (github.com/infused/dbf/tree/2_stable)

Compatibility

DBF is tested to work with the following versions of Ruby:

  • -

    Ruby 2.4.x, 2.5.x, 2.6.x, 2.7.x, 3.0.x, TruffleRuby

    +

    Ruby 3.0.x, 3.1.x, 3.2.x, 3.3.x

Installation

@@ -147,7 +149,7 @@

Basic Usage

# => {"Name" => "Thing1 | SlotNumber" => 1} -

Search for records using a simple hash format. Multiple search criteria are ANDed. Use the block form if the resulting recordset could be large, otherwise all records will be loaded into memory.

+

Search for records using a simple hash format. Multiple search criteria are ANDed. Use the block form if the resulting record set is too big. Otherwise, all records are loaded into memory.

# find all records with slot_number equal to s42
 widgets.find(:all, slot_number: 's42') do |widget|
@@ -166,7 +168,7 @@ 

Basic Usage

Enumeration

-

DBF::Table is a Ruby Enumerable. This means you can use any Enumerable method. This means that you get a bunch of traversal, searching and sorting methods for free. For example, let’s get only records created before January 1st, 2015:

+

DBF::Table is a Ruby Enumerable, so you get several traversal, search, and sort methods for free. For example, let’s get only records created before January 1st, 2015:

widgets.select { |w| w.created_date < Date.new(2015, 1, 1) }
 
@@ -178,7 +180,7 @@

Enumeration

Encodings (Code Pages)

-

dBase supports encoding non-english characters in different formats. Unfortunately, the format used is not always set, so you may have to specify it manually. For example, you have a DBF file from Russia and you are getting bad data. Try using the ‘Russion OEM’ encoding:

+

dBase supports encoding non-english characters with different character sets. Unfortunately, the character set used may not be set explicitly. In that case, you will have to specify it manually. For example, if you know the dbf file is encoded with ‘Russian OEM’:

table = DBF::Table.new('dbf/books.dbf', nil, 'cp866')
 
@@ -515,7 +517,7 @@

Migrating to ActiveRecord

end
-

If you have initalized the DBF::Table with raw data, you will need to set the exported table name manually:

+

If you have initialized the DBF::Table with raw data, you will need to set the exported table name manually:

table.name = 'my_table_name'
 
@@ -552,7 +554,7 @@

Migrating to Sequel

Command-line utility

-

A small command-line utility called dbf is installed along with the gem.

+

A small command-line utility called dbf is installed with the gem.

$ dbf -h
 usage: dbf [-h|-s|-a] filename
@@ -581,7 +583,7 @@ 

Command-line utility

Reading a Visual Foxpro database (v8, v9)

-

A special Database::Foxpro class is available to read Visual Foxpro container files (file with .dbc extension). When using this class long field names are supported and tables can be referenced without using names.

+

A special Database::Foxpro class is available to read Visual Foxpro container files (file with .dbc extension). When using this class, long field names are supported, and tables can be referenced without using names.

require 'dbf'
 
@@ -591,7 +593,7 @@ 

Reading a Visual

dBase version compatibility

-

The basic dBase data types are generally supported well. Support for the advanced data types in dbase V and FoxPro are still experimental or not supported. If you have insight into how any of the unsupported data types are implemented, please give me a shout. FoxBase/dBase II files are not supported at this time.

+

The basic dBase data types are generally supported well. Support for the advanced data types in dBase V and FoxPro are still experimental or not supported. If you have insight into how any of the unsupported data types are implemented, please open an issue on Github. FoxBase/dBase II files are not supported at this time.

Supported data types by dBase version

@@ -985,7 +987,7 @@

Limitations

License

-

Copyright © 2006-2023 Keith Morrison <keithm@infused.org>

+

Copyright © 2006-2024 Keith Morrison <keithm@infused.org>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@@ -995,9 +997,9 @@

License

diff --git a/doc/frames.html b/doc/frames.html index a65e936..4f918f5 100644 --- a/doc/frames.html +++ b/doc/frames.html @@ -2,7 +2,7 @@ - Documentation by YARD 0.9.28 + Documentation by YARD 0.9.34