Skip to content

Commit 6a1a2fe

Browse files
authored
Merge pull request #403 from sparklemotion/flavorjones-cleanup-20230909
some general cleanup
2 parents 77e902d + 9869a5d commit 6a1a2fe

File tree

16 files changed

+57
-56
lines changed

16 files changed

+57
-56
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "bundler"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/sqlite3-ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
steps:
8787
- run: |
8888
dnf group install -y "C Development Tools and Libraries"
89-
dnf install -y ruby ruby-devel
89+
dnf install -y ruby ruby-devel libyaml-devel
9090
- uses: actions/checkout@v3
9191
- run: bundle install
9292
- run: bundle exec rake compile -- --disable-system-libraries

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ A quick checklist:
2727

2828
- [ ] make sure CI is green!
2929
- [ ] update `CHANGELOG.md` and `lib/sqlite3/version.rb` including `VersionProxy::{MINOR,TINY}`
30-
- [ ] create a git tag using a format that matches the pattern `v\d+\.\d+\.\d+`, e.g. `v1.3.13`
3130
- [ ] run `bin/build-gems` and make sure it completes and all the tests pass
31+
- [ ] create a git tag using a format that matches the pattern `v\d+\.\d+\.\d+`, e.g. `v1.3.13`
32+
- [ ] `git push && git push --tags`
3233
- [ ] `for g in gems/*.gem ; do gem push $g ; done`
3334
- [ ] create a release at https://github.com/sparklemotion/sqlite3-ruby/releases and include sha2 checksums

Gemfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ source "https://rubygems.org"
22

33
gemspec
44

5-
gem("minitest", "~> 5.15")
6-
gem("rake-compiler", "~> 1.2.0")
5+
gem("minitest", "5.20.0")
6+
gem("rake-compiler", "1.2.5")
77
gem("rake-compiler-dock", "1.3.0")
8-
gem("rdoc", ">= 4.0", "< 7")
9-
gem("psych", "~> 4.0") # psych 5 doesn't build on some CI platforms yet
8+
gem("rdoc", "6.5.0")
9+
gem("psych", "5.1.0")
1010

11-
gem("ruby_memcheck") if Gem::Platform.local.os == "linux"
11+
gem("ruby_memcheck", "2.1.2") if Gem::Platform.local.os == "linux"

bin/build-gems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bundle exec rake compile test
1919

2020
# package the gems, including precompiled native
2121
bundle exec rake clean clobber
22-
bundle exec rake gem:all
22+
bundle exec rake -m gem:all
2323
cp -v pkg/sqlite3*.gem gems
2424

2525
# test those gem files!

ext/sqlite3/database.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static VALUE total_changes(VALUE self)
127127
Data_Get_Struct(self, sqlite3Ruby, ctx);
128128
REQUIRE_OPEN_DB(ctx);
129129

130-
return INT2NUM((long)sqlite3_total_changes(ctx->db));
130+
return INT2NUM(sqlite3_total_changes(ctx->db));
131131
}
132132

133133
static void tracefunc(void * data, const char *sql)
@@ -168,7 +168,7 @@ static int rb_sqlite3_busy_handler(void * ctx, int count)
168168
{
169169
VALUE self = (VALUE)(ctx);
170170
VALUE handle = rb_iv_get(self, "@busy_handler");
171-
VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
171+
VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM(count));
172172

173173
if(Qfalse == result) return 0;
174174

@@ -413,7 +413,7 @@ static VALUE errcode_(VALUE self)
413413
Data_Get_Struct(self, sqlite3Ruby, ctx);
414414
REQUIRE_OPEN_DB(ctx);
415415

416-
return INT2NUM((long)sqlite3_errcode(ctx->db));
416+
return INT2NUM(sqlite3_errcode(ctx->db));
417417
}
418418

419419
/* call-seq: complete?(sql)

ext/sqlite3/statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static VALUE column_count(VALUE self)
348348
Data_Get_Struct(self, sqlite3StmtRuby, ctx);
349349
REQUIRE_OPEN_STMT(ctx);
350350

351-
return INT2NUM((long)sqlite3_column_count(ctx->st));
351+
return INT2NUM(sqlite3_column_count(ctx->st));
352352
}
353353

354354
/* call-seq: stmt.column_name(index)
@@ -397,7 +397,7 @@ static VALUE bind_parameter_count(VALUE self)
397397
Data_Get_Struct(self, sqlite3StmtRuby, ctx);
398398
REQUIRE_OPEN_STMT(ctx);
399399

400-
return INT2NUM((long)sqlite3_bind_parameter_count(ctx->st));
400+
return INT2NUM(sqlite3_bind_parameter_count(ctx->st));
401401
}
402402

403403
#ifdef HAVE_SQLITE3_COLUMN_DATABASE_NAME

lib/sqlite3/database.rb

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ def initialize file, options = {}, zvfs = nil
116116

117117
def type_translation= value # :nodoc:
118118
warn(<<-eowarn) if $VERBOSE
119-
#{caller[0]} is calling SQLite3::Database#type_translation=
120-
SQLite3::Database#type_translation= is deprecated and will be removed
121-
in version 2.0.0.
119+
#{caller[0]} is calling `SQLite3::Database#type_translation=` which is deprecated and will be removed in version 2.0.0.
122120
eowarn
123121
@type_translator = make_type_translator value
124122
@type_translation = value
@@ -189,9 +187,7 @@ def execute sql, bind_vars = [], *args, &block
189187
end
190188

191189
warn(<<-eowarn) if $VERBOSE
192-
#{caller[0]} is calling SQLite3::Database#execute with nil or multiple bind params
193-
without using an array. Please switch to passing bind parameters as an array.
194-
Support for bind parameters as *args will be removed in 2.0.0.
190+
#{caller[0]} is calling `SQLite3::Database#execute` with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for bind parameters as *args will be removed in 2.0.0.
195191
eowarn
196192
end
197193

@@ -248,9 +244,7 @@ def execute_batch( sql, bind_vars = [], *args )
248244
unless [Array, Hash].include?(bind_vars.class)
249245
bind_vars = [bind_vars]
250246
warn(<<-eowarn) if $VERBOSE
251-
#{caller[0]} is calling SQLite3::Database#execute_batch with bind parameters
252-
that are not a list of a hash. Please switch to passing bind parameters as an
253-
array or hash. Support for this behavior will be removed in version 2.0.0.
247+
#{caller[0]} is calling `SQLite3::Database#execute_batch` with bind parameters that are not a list of a hash. Please switch to passing bind parameters as an array or hash. Support for this behavior will be removed in version 2.0.0.
254248
eowarn
255249
end
256250

@@ -263,9 +257,7 @@ def execute_batch( sql, bind_vars = [], *args )
263257
end
264258

265259
warn(<<-eowarn) if $VERBOSE
266-
#{caller[0]} is calling SQLite3::Database#execute_batch with nil or multiple bind params
267-
without using an array. Please switch to passing bind parameters as an array.
268-
Support for this behavior will be removed in version 2.0.0.
260+
#{caller[0]} is calling `SQLite3::Database#execute_batch` with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for this behavior will be removed in version 2.0.0.
269261
eowarn
270262
end
271263

@@ -332,9 +324,7 @@ def query( sql, bind_vars = [], *args )
332324
end
333325

334326
warn(<<-eowarn) if $VERBOSE
335-
#{caller[0]} is calling SQLite3::Database#query with nil or multiple bind params
336-
without using an array. Please switch to passing bind parameters as an array.
337-
Support for this will be removed in version 2.0.0.
327+
#{caller[0]} is calling `SQLite3::Database#query` with nil or multiple bind params without using an array. Please switch to passing bind parameters as an array. Support for this will be removed in version 2.0.0.
338328
eowarn
339329
end
340330

lib/sqlite3/resultset.rb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ class ArrayWithTypesAndFields < Array # :nodoc:
2020

2121
def types
2222
warn(<<-eowarn) if $VERBOSE
23-
#{caller[0]} is calling #{self.class}#types. This method will be removed in
24-
sqlite3 version 2.0.0, please call the `types` method on the SQLite3::ResultSet
25-
object that created this object
23+
#{caller[0]} is calling `#{self.class}#types` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `types` method on the SQLite3::ResultSet object that created this object.
2624
eowarn
2725
@types
2826
end
2927

3028
def fields
3129
warn(<<-eowarn) if $VERBOSE
32-
#{caller[0]} is calling #{self.class}#fields. This method will be removed in
33-
sqlite3 version 2.0.0, please call the `columns` method on the SQLite3::ResultSet
34-
object that created this object
30+
#{caller[0]} is calling `#{self.class}#fields` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `columns` method on the SQLite3::ResultSet object that created this object.
3531
eowarn
3632
@fields
3733
end
@@ -45,18 +41,14 @@ class HashWithTypesAndFields < Hash # :nodoc:
4541

4642
def types
4743
warn(<<-eowarn) if $VERBOSE
48-
#{caller[0]} is calling #{self.class}#types. This method will be removed in
49-
sqlite3 version 2.0.0, please call the `types` method on the SQLite3::ResultSet
50-
object that created this object
44+
#{caller[0]} is calling `#{self.class}#types` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `types` method on the SQLite3::ResultSet object that created this object.
5145
eowarn
5246
@types
5347
end
5448

5549
def fields
5650
warn(<<-eowarn) if $VERBOSE
57-
#{caller[0]} is calling #{self.class}#fields. This method will be removed in
58-
sqlite3 version 2.0.0, please call the `columns` method on the SQLite3::ResultSet
59-
object that created this object
51+
#{caller[0]} is calling `#{self.class}#fields` which is deprecated and will be removed in sqlite3 version 2.0.0. Please call the `columns` method on the SQLite3::ResultSet object that created this object.
6052
eowarn
6153
@fields
6254
end

lib/sqlite3/translator.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def initialize
3636
# The block should return the translated value.
3737
def add_translator( type, &block ) # :yields: type, value
3838
warn(<<-eowarn) if $VERBOSE
39-
#{caller[0]} is calling `add_translator`.
40-
Built in translators are deprecated and will be removed in version 2.0.0
39+
#{caller[0]} is calling `SQLite3::Translator#add_translator`. Built-in translators are deprecated and will be removed in version 2.0.0.
4140
eowarn
4241
@translators[ type_name( type ) ] = block
4342
end

0 commit comments

Comments
 (0)