Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc file cleanup #494

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions API_CHANGES.md

This file was deleted.

22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@
This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem.


## Architecture notes

### Garbage collection

All statements keep pointers back to their respective database connections.
The `@connection` instance variable on the `Statement` handle keeps the database
connection alive. Memory allocated for a statement handler will be freed in
two cases:

1. `#close` is called on the statement
2. The `SQLite3::Database` object gets garbage collected

We can't free the memory for the statement in the garbage collection function
for the statement handler. The reason is because there exists a race
condition. We cannot guarantee the order in which objects will be garbage
collected. So, it is possible that a connection and a statement are up for
garbage collection. If the database connection were to be free'd before the
statement, then boom. Instead we'll be conservative and free unclosed
statements when the connection is terminated.



## Building gems

As a prerequisite please make sure you have `docker` correctly installed, so that you're able to cross-compile the native gems.
Expand Down
88 changes: 0 additions & 88 deletions ChangeLog.cvs

This file was deleted.

13 changes: 12 additions & 1 deletion bin/test-gem-file-contents
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,25 @@ describe File.basename(gemfile) do
end

describe "all platforms" do
["lib", "test"].each do |dir|
["lib"].each do |dir|
it "contains every ruby file in #{dir}/" do
expected = `git ls-files #{dir}`.split("\n").grep(/\.rb$/).sort
skip "looks like this isn't a git repository" if expected.empty?
actual = gemfile_contents.select { |f| f.start_with?("#{dir}/") }.grep(/\.rb$/).sort
assert_equal(expected, actual)
end
end

["test"].each do |dir|
it "does not contain files from #{dir}/" do
actual = gemfile_contents.select { |f| f.start_with?("#{dir}/") }.grep(/\.rb$/)
assert_empty(actual)
end
end

it "does not contain the Gemfile" do
refute_includes(gemfile_contents, "Gemfile")
end
end

if gemspec.platform == Gem::Platform::RUBY
Expand Down
3 changes: 2 additions & 1 deletion rakelib/check-manifest.rake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ task :check_manifest do
pkg
ports
rakelib
test
tmp
vendor
[0-9]*
Expand All @@ -26,7 +27,7 @@ task :check_manifest do
.gitignore
.rdoc_options
.rubocop.yml
Gemfile?*
Gemfile*
Rakefile
[a-z]*.{log,out}
[0-9]*
Expand Down
27 changes: 1 addition & 26 deletions sqlite3.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ Gem::Specification.new do |s|

s.files = [
".gemtest",
"API_CHANGES.md",
"CHANGELOG.md",
"CONTRIBUTING.md",
"ChangeLog.cvs",
"FAQ.md",
"Gemfile",
"INSTALLATION.md",
"LICENSE",
"LICENSE-DEPENDENCIES",
Expand All @@ -69,32 +66,10 @@ Gem::Specification.new do |s|
"lib/sqlite3/resultset.rb",
"lib/sqlite3/statement.rb",
"lib/sqlite3/value.rb",
"lib/sqlite3/version.rb",
"test/helper.rb",
"test/test_backup.rb",
"test/test_collation.rb",
"test/test_database.rb",
"test/test_database_flags.rb",
"test/test_database_readonly.rb",
"test/test_database_readwrite.rb",
"test/test_deprecated.rb",
"test/test_encoding.rb",
"test/test_integration.rb",
"test/test_integration_aggregate.rb",
"test/test_integration_open_close.rb",
"test/test_integration_pending.rb",
"test/test_integration_resultset.rb",
"test/test_integration_statement.rb",
"test/test_pragmas.rb",
"test/test_resource_cleanup.rb",
"test/test_result_set.rb",
"test/test_sqlite3.rb",
"test/test_statement.rb",
"test/test_statement_execute.rb"
"lib/sqlite3/version.rb"
]

s.extra_rdoc_files = [
"API_CHANGES.md",
"CHANGELOG.md",
"README.md",
"ext/sqlite3/aggregator.c",
Expand Down
Loading