Skip to content

Commit a92be46

Browse files
authored
Merge pull request #494 from sparklemotion/flavorjones-move-files-around
doc file cleanup
2 parents 59f999e + 8107634 commit a92be46

File tree

6 files changed

+37
-165
lines changed

6 files changed

+37
-165
lines changed

API_CHANGES.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@
55
This doc is a short introduction on how to modify and maintain the sqlite3-ruby gem.
66

77

8+
## Architecture notes
9+
10+
### Garbage collection
11+
12+
All statements keep pointers back to their respective database connections.
13+
The `@connection` instance variable on the `Statement` handle keeps the database
14+
connection alive. Memory allocated for a statement handler will be freed in
15+
two cases:
16+
17+
1. `#close` is called on the statement
18+
2. The `SQLite3::Database` object gets garbage collected
19+
20+
We can't free the memory for the statement in the garbage collection function
21+
for the statement handler. The reason is because there exists a race
22+
condition. We cannot guarantee the order in which objects will be garbage
23+
collected. So, it is possible that a connection and a statement are up for
24+
garbage collection. If the database connection were to be free'd before the
25+
statement, then boom. Instead we'll be conservative and free unclosed
26+
statements when the connection is terminated.
27+
28+
29+
830
## Building gems
931

1032
As a prerequisite please make sure you have `docker` correctly installed, so that you're able to cross-compile the native gems.

ChangeLog.cvs

Lines changed: 0 additions & 88 deletions
This file was deleted.

bin/test-gem-file-contents

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,25 @@ describe File.basename(gemfile) do
9494
end
9595

9696
describe "all platforms" do
97-
["lib", "test"].each do |dir|
97+
["lib"].each do |dir|
9898
it "contains every ruby file in #{dir}/" do
9999
expected = `git ls-files #{dir}`.split("\n").grep(/\.rb$/).sort
100100
skip "looks like this isn't a git repository" if expected.empty?
101101
actual = gemfile_contents.select { |f| f.start_with?("#{dir}/") }.grep(/\.rb$/).sort
102102
assert_equal(expected, actual)
103103
end
104104
end
105+
106+
["test"].each do |dir|
107+
it "does not contain files from #{dir}/" do
108+
actual = gemfile_contents.select { |f| f.start_with?("#{dir}/") }.grep(/\.rb$/)
109+
assert_empty(actual)
110+
end
111+
end
112+
113+
it "does not contain the Gemfile" do
114+
refute_includes(gemfile_contents, "Gemfile")
115+
end
105116
end
106117

107118
if gemspec.platform == Gem::Platform::RUBY

rakelib/check-manifest.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ task :check_manifest do
1717
pkg
1818
ports
1919
rakelib
20+
test
2021
tmp
2122
vendor
2223
[0-9]*
@@ -26,7 +27,7 @@ task :check_manifest do
2627
.gitignore
2728
.rdoc_options
2829
.rubocop.yml
29-
Gemfile?*
30+
Gemfile*
3031
Rakefile
3132
[a-z]*.{log,out}
3233
[0-9]*

sqlite3.gemspec

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ Gem::Specification.new do |s|
3737

3838
s.files = [
3939
".gemtest",
40-
"API_CHANGES.md",
4140
"CHANGELOG.md",
4241
"CONTRIBUTING.md",
43-
"ChangeLog.cvs",
4442
"FAQ.md",
45-
"Gemfile",
4643
"INSTALLATION.md",
4744
"LICENSE",
4845
"LICENSE-DEPENDENCIES",
@@ -69,32 +66,10 @@ Gem::Specification.new do |s|
6966
"lib/sqlite3/resultset.rb",
7067
"lib/sqlite3/statement.rb",
7168
"lib/sqlite3/value.rb",
72-
"lib/sqlite3/version.rb",
73-
"test/helper.rb",
74-
"test/test_backup.rb",
75-
"test/test_collation.rb",
76-
"test/test_database.rb",
77-
"test/test_database_flags.rb",
78-
"test/test_database_readonly.rb",
79-
"test/test_database_readwrite.rb",
80-
"test/test_deprecated.rb",
81-
"test/test_encoding.rb",
82-
"test/test_integration.rb",
83-
"test/test_integration_aggregate.rb",
84-
"test/test_integration_open_close.rb",
85-
"test/test_integration_pending.rb",
86-
"test/test_integration_resultset.rb",
87-
"test/test_integration_statement.rb",
88-
"test/test_pragmas.rb",
89-
"test/test_resource_cleanup.rb",
90-
"test/test_result_set.rb",
91-
"test/test_sqlite3.rb",
92-
"test/test_statement.rb",
93-
"test/test_statement_execute.rb"
69+
"lib/sqlite3/version.rb"
9470
]
9571

9672
s.extra_rdoc_files = [
97-
"API_CHANGES.md",
9873
"CHANGELOG.md",
9974
"README.md",
10075
"ext/sqlite3/aggregator.c",

0 commit comments

Comments
 (0)