Skip to content

Commit f80c5ff

Browse files
authored
Merge pull request #453 from sparklemotion/flavorjones-remove-version-proxy
remove `VersionProxy`, clean up version branching, and drop Ruby 2.7 support
2 parents 870eecc + c2e7e4c commit f80c5ff

16 files changed

+54
-127
lines changed

.github/workflows/sqlite3-ruby.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
os: [ubuntu-latest, macos-latest, windows-latest]
28-
ruby: ["3.3", "3.2", "3.1", "3.0", "2.7"]
28+
ruby: ["3.3", "3.2", "3.1", "3.0"]
2929
lib: [system, packaged]
3030
include:
3131
- { os: ubuntu-latest, ruby: truffleruby, lib: packaged }
@@ -65,16 +65,6 @@ jobs:
6565

6666
- run: bundle exec rake test
6767

68-
old_sqlite3:
69-
runs-on: ubuntu-latest
70-
container:
71-
image: ruby:2.7.5-buster # old enough to not support SQLITE_DBCONFIG_DQS_DDL
72-
steps:
73-
- uses: actions/checkout@v4
74-
- run: bundle install
75-
- run: bundle exec rake compile -- --enable-system-libraries
76-
- run: bundle exec rake test
77-
7868
# reported at https://github.com/sparklemotion/sqlite3-ruby/issues/354
7969
# TODO remove once https://github.com/flavorjones/mini_portile/issues/118 is fixed
8070
fedora:
@@ -95,7 +85,7 @@ jobs:
9585
fail-fast: false
9686
matrix:
9787
os: [ubuntu-latest, macos-latest, windows-latest]
98-
ruby: ["3.3", "2.7"] # oldest and newest
88+
ruby: ["3.3", "3.0"] # oldest and newest
9989
include:
10090
- { os: windows-latest, ruby: mingw }
10191
- { os: windows-latest, ruby: mswin }

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# sqlite3-ruby Changelog
22

3+
## next / unreleased
4+
5+
(will be 2.0.0)
6+
7+
### Ruby
8+
9+
This release drops support for Ruby 2.7.
10+
11+
12+
### Removed
13+
14+
- Remove `SQLite3::VersionProxy` which has been deprecated since v1.3.2.
15+
16+
317
## 1.7.0 / 2023-12-27
418

519
### Ruby

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Update `/dependencies.yml` to reflect:
2626
A quick checklist:
2727

2828
- [ ] make sure CI is green!
29-
- [ ] update `CHANGELOG.md` and `lib/sqlite3/version.rb` including `VersionProxy::{MINOR,TINY}`
29+
- [ ] update `CHANGELOG.md` and `lib/sqlite3/version.rb`
3030
- [ ] run `bin/build-gems` and make sure it completes and all the tests pass
3131
- [ ] create a git tag using a format that matches the pattern `v\d+\.\d+\.\d+`, e.g. `v1.3.13`
3232
- [ ] `git push && git push --tags`

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test_script:
2929

3030
environment:
3131
matrix:
32+
- ruby_version: "33"
3233
- ruby_version: "32"
3334
- ruby_version: "31"
3435
- ruby_version: "30"
35-
- ruby_version: "27"

bin/test-gem-file-contents

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Minitest::Reporters.use!([Minitest::Reporters::SpecReporter.new])
6666
puts "Testing '#{gemfile}' (#{gemspec.platform})"
6767
describe File.basename(gemfile) do
6868
let(:all_supported_ruby_versions) {
69-
["2.7", "3.0", "3.1", "3.2", "3.3"]
69+
["3.0", "3.1", "3.2", "3.3"]
7070
}
7171
let(:native_supported_ruby_versions) { ["3.0", "3.1", "3.2", "3.3"] }
7272
let(:ucrt_supported_ruby_versions) { ["3.1", "3.2", "3.3"] }
@@ -119,8 +119,7 @@ describe File.basename(gemfile) do
119119
end
120120

121121
it "contains the port files" do
122-
# TODO: once Ruby 2.7 is no longer supported, use symbolize_names: true
123-
dependencies = YAML.load_file(File.join(__dir__, "..", "dependencies.yml"))
122+
dependencies = YAML.load_file(File.join(__dir__, "..", "dependencies.yml"), symbolize_names: true)
124123
sqlite_tarball = File.basename(dependencies[:sqlite3][:files].first[:url])
125124
actual_ports = gemfile_contents.grep(%r{^ports/})
126125

dependencies.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# TODO: stop using symbols here once we no longer support Ruby 2.7 and can rely on symbolize_names
2-
:sqlite3:
1+
sqlite3:
32
# checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
43
# 6c427f0547e2f7babe636b748dd5d5a1f2f31601adadef7e2805e7d1f7171861
54
#
@@ -8,7 +7,7 @@
87
#
98
# $ sha256sum ports/archives/sqlite-autoconf-3440200.tar.gz
109
# 1c6719a148bc41cf0f2bbbe3926d7ce3f5ca09d878f1246fcc20767b175bb407 ports/archives/sqlite-autoconf-3440200.tar.gz
11-
:version: "3.44.2"
12-
:files:
13-
- :url: "https://sqlite.org/2023/sqlite-autoconf-3440200.tar.gz"
14-
:sha256: "1c6719a148bc41cf0f2bbbe3926d7ce3f5ca09d878f1246fcc20767b175bb407"
10+
version: "3.44.2"
11+
files:
12+
- url: "https://sqlite.org/2023/sqlite-autoconf-3440200.tar.gz"
13+
sha256: "1c6719a148bc41cf0f2bbbe3926d7ce3f5ca09d878f1246fcc20767b175bb407"

ext/sqlite3/extconf.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ def configure_packaged_libraries
9797
end
9898

9999
def configure_extension
100-
if Gem::Requirement.new("< 2.7").satisfied_by?(Gem::Version.new(RUBY_VERSION))
101-
append_cppflags("-DTAINTING_SUPPORT")
102-
end
103-
104100
append_cflags("-fvisibility=hidden") # see https://github.com/rake-compiler/rake-compiler-dock/issues/87
105101

106102
if find_header("sqlite3.h")
@@ -158,8 +154,7 @@ def sqlite3_config
158154
end
159155

160156
def mini_portile_config
161-
# TODO: once Ruby 2.7 is no longer supported, use symbolize_names: true
162-
YAML.load_file(File.join(package_root_dir, "dependencies.yml"))
157+
YAML.load_file(File.join(package_root_dir, "dependencies.yml"), symbolize_names: true)
163158
end
164159

165160
def abort_could_not_find(missing)

lib/sqlite3/version.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
module SQLite3
2-
32
VERSION = "2.0.0.dev"
4-
5-
module VersionProxy
6-
MAJOR = 2
7-
MINOR = 0
8-
TINY = 0
9-
BUILD = "dev"
10-
11-
STRING = [ MAJOR, MINOR, TINY, BUILD ].compact.join( "." )
12-
13-
VERSION = ::SQLite3::VERSION
14-
end
15-
16-
def self.const_missing(name)
17-
return super unless name == :Version
18-
warn(<<-eowarn) if $VERBOSE
19-
#{caller[0]}: `SQLite::Version` will be removed in sqlite3-ruby version 2.0.0
20-
eowarn
21-
VersionProxy
22-
end
233
end

rakelib/native.rake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def add_file_to_gem(relative_source_path)
4242
end
4343

4444
task gem_build_path do
45-
# TODO: once Ruby 2.7 is no longer supported, use symbolize_names: true
46-
dependencies = YAML.load_file(File.join(__dir__, "..", "dependencies.yml"))
45+
dependencies = YAML.load_file(File.join(__dir__, "..", "dependencies.yml"), symbolize_names: true)
4746
sqlite_tarball = File.basename(dependencies[:sqlite3][:files].first[:url])
4847
archive = Dir.glob(File.join("ports", "archives", sqlite_tarball)).first
4948
add_file_to_gem(archive)

sqlite3.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
2020

2121
s.licenses = ["BSD-3-Clause"]
2222

23-
s.required_ruby_version = Gem::Requirement.new(">= 2.7")
23+
s.required_ruby_version = Gem::Requirement.new(">= 3.0")
2424

2525
s.homepage = "https://github.com/sparklemotion/sqlite3-ruby"
2626
s.metadata = {

test/helper.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
$VERBOSE = nil
66
end
77

8-
puts "info: sqlite3-ruby version: #{SQLite3::VERSION}/#{SQLite3::VersionProxy::STRING}"
9-
puts "info: sqlite3 version: #{SQLite3::SQLITE_VERSION}/#{SQLite3::SQLITE_LOADED_VERSION}"
8+
puts "info: gem version: #{SQLite3::VERSION}"
9+
puts "info: sqlite version: #{SQLite3::SQLITE_VERSION}/#{SQLite3::SQLITE_LOADED_VERSION}"
1010
puts "info: sqlcipher?: #{SQLite3.sqlcipher?}"
1111
puts "info: threadsafe?: #{SQLite3.threadsafe?}"
1212

13-
unless RUBY_VERSION >= "1.9"
14-
require 'iconv'
15-
end
16-
1713
module SQLite3
1814
class TestCase < Minitest::Test
1915
alias :assert_not_equal :refute_equal

test/test_collation.rb

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,34 @@ def test_remove_collation
4747
end
4848
end
4949

50-
if RUBY_VERSION >= '1.9.1'
51-
def test_encoding
52-
comparator = Comparator.new
53-
@db.collation 'foo', comparator
54-
@db.execute('select data from ex order by 1 collate foo')
50+
def test_encoding
51+
comparator = Comparator.new
52+
@db.collation 'foo', comparator
53+
@db.execute('select data from ex order by 1 collate foo')
5554

56-
a, b = *comparator.calls.first
55+
a, b = *comparator.calls.first
5756

58-
assert_equal Encoding.find('UTF-8'), a.encoding
59-
assert_equal Encoding.find('UTF-8'), b.encoding
60-
end
57+
assert_equal Encoding.find('UTF-8'), a.encoding
58+
assert_equal Encoding.find('UTF-8'), b.encoding
59+
end
6160

62-
def test_encoding_default_internal
63-
warn_before = $-w
64-
$-w = false
65-
before_enc = Encoding.default_internal
61+
def test_encoding_default_internal
62+
warn_before = $-w
63+
$-w = false
64+
before_enc = Encoding.default_internal
6665

67-
Encoding.default_internal = 'EUC-JP'
68-
comparator = Comparator.new
69-
@db.collation 'foo', comparator
70-
@db.execute('select data from ex order by 1 collate foo')
66+
Encoding.default_internal = 'EUC-JP'
67+
comparator = Comparator.new
68+
@db.collation 'foo', comparator
69+
@db.execute('select data from ex order by 1 collate foo')
7170

72-
a, b = *comparator.calls.first
71+
a, b = *comparator.calls.first
7372

74-
assert_equal Encoding.find('EUC-JP'), a.encoding
75-
assert_equal Encoding.find('EUC-JP'), b.encoding
76-
ensure
77-
Encoding.default_internal = before_enc
78-
$-w = warn_before
79-
end
73+
assert_equal Encoding.find('EUC-JP'), a.encoding
74+
assert_equal Encoding.find('EUC-JP'), b.encoding
75+
ensure
76+
Encoding.default_internal = before_enc
77+
$-w = warn_before
8078
end
8179
end
8280
end

test/test_database.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,7 @@ def test_new_with_options
237237
# determine if Ruby is running on Big Endian platform
238238
utf16 = ([1].pack("I") == [1].pack("N")) ? "UTF-16BE" : "UTF-16LE"
239239

240-
if RUBY_VERSION >= "1.9"
241-
db = SQLite3::Database.new(':memory:'.encode(utf16), :utf16 => true)
242-
else
243-
db = SQLite3::Database.new(Iconv.conv(utf16, 'UTF-8', ':memory:'),
244-
:utf16 => true)
245-
end
240+
db = SQLite3::Database.new(':memory:'.encode(utf16), :utf16 => true)
246241
assert_instance_of(SQLite3::Database, db)
247242
ensure
248243
db.close if db

test/test_encoding.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,5 @@ def test_euc_jp
161161
assert_equal str.encode('UTF-8'), row.first.first
162162
end
163163

164-
end if RUBY_VERSION >= '1.9.1'
164+
end
165165
end

test/test_integration_pending.rb

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,6 @@ def teardown
1919
File.delete( "test.db" )
2020
end
2121

22-
def test_busy_handler_outwait
23-
skip("not working in 1.9") if RUBY_VERSION >= '1.9'
24-
25-
busy = Mutex.new
26-
busy.lock
27-
handler_call_count = 0
28-
29-
t = Thread.new(busy) do |locker|
30-
begin
31-
db2 = SQLite3::Database.open( "test.db" )
32-
db2.transaction( :exclusive ) do
33-
locker.lock
34-
end
35-
ensure
36-
db2.close if db2
37-
end
38-
end
39-
40-
@db.busy_handler do |data,count|
41-
handler_call_count += 1
42-
busy.unlock
43-
true
44-
end
45-
46-
assert_nothing_raised do
47-
@db.execute "insert into foo (b) values ( 'from 2' )"
48-
end
49-
50-
t.join
51-
52-
assert_equal 1, handler_call_count
53-
end
54-
5522
def test_busy_handler_impatient
5623
busy = Mutex.new
5724
busy.lock

test/test_sqlite3.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ def test_threadsafe?
1818
end
1919
end
2020

21-
def test_version_strings
22-
skip if SQLite3::VERSION.include?("test") # see set-version-to-timestamp rake task
23-
assert_equal(SQLite3::VERSION, SQLite3::VersionProxy::STRING)
24-
end
25-
2621
def test_compiled_version_and_loaded_version
2722
assert_equal(SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION)
2823
end

0 commit comments

Comments
 (0)