bdb 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -0
- data/README.md +23 -13
- data/VERSION +1 -1
- data/ext/extconf.rb +8 -7
- metadata +3 -1
data/AUTHORS
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
Description
|
2
2
|
===
|
3
3
|
|
4
|
-
Ruby bindings for Berkeley DB versions 4.2-
|
4
|
+
Ruby bindings for Berkeley DB versions 4.2-5.1.
|
5
|
+
|
6
|
+
One of the [ruby-bdb][ruby-bdb] projects. See also:
|
7
|
+
|
8
|
+
* [sbdb][sbdb] - A simpler, more Ruby-like API
|
9
|
+
* [tuple][tuple] - A binary array serialisation library used by bdb internally
|
10
|
+
|
11
|
+
[ruby-bdb]: http://github.com/ruby-bdb
|
12
|
+
[sbdb]: http://github.com/ruby-bdb/sbdb
|
13
|
+
[tuple]: http://github.com/ruby-bdb/tuple
|
5
14
|
|
6
15
|
Installation
|
7
16
|
============
|
@@ -11,22 +20,23 @@ From Git
|
|
11
20
|
|
12
21
|
You can check out the latest source from git:
|
13
22
|
|
14
|
-
git clone git://github.com/
|
23
|
+
git clone git://github.com/ruby-bdb/bdb.git
|
15
24
|
|
16
25
|
As a Gem
|
17
|
-
|
26
|
+
--------
|
18
27
|
|
19
|
-
At the moment this library is not available on
|
28
|
+
At the moment this library is not available on RubyForge. To install it as a
|
20
29
|
gem, do the following:
|
21
30
|
|
22
|
-
sudo gem install
|
31
|
+
[sudo] gem install bdb
|
23
32
|
|
24
33
|
For Berkeley DB v4.7 installed from MacPorts do the following:
|
25
34
|
|
26
|
-
sudo env ARCHFLAGS="-arch i386" gem install
|
35
|
+
[sudo] env ARCHFLAGS="-arch i386" gem install bdb
|
27
36
|
|
28
37
|
This assumes you're on OS X and BerkeleyDB wasn't compiled as a universal binary.
|
29
38
|
|
39
|
+
|
30
40
|
Sample Usage
|
31
41
|
============
|
32
42
|
|
@@ -50,21 +60,19 @@ Sample Usage
|
|
50
60
|
db.close(0)
|
51
61
|
env.close
|
52
62
|
|
63
|
+
|
53
64
|
API
|
54
65
|
===
|
55
66
|
|
56
67
|
This interface is most closely based on the DB4 C api and tries to maintain close
|
57
|
-
interface proximity.
|
58
|
-
|
68
|
+
interface proximity. [That API is published by Oracle][oracle-api].
|
69
|
+
|
70
|
+
[oracle-api]: http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/frame_main.html
|
59
71
|
|
60
72
|
All function arguments systematically omit the leading DB handles and TXN handles.
|
61
73
|
A few calls omit the flags parameter when the documentation indicates that no
|
62
74
|
flag values are used - cursor.close is one.
|
63
75
|
|
64
|
-
Alternative API
|
65
|
-
---------------
|
66
|
-
|
67
|
-
You can use [SBDB](http://github.com/DenisKnauf/sbdb), too. It is easier to use, but base on this library.
|
68
76
|
|
69
77
|
Notes
|
70
78
|
=====
|
@@ -79,9 +87,11 @@ flawlessly.
|
|
79
87
|
The authors have put all possible caution into ensuring that DB and Ruby cooperate.
|
80
88
|
The memory access was one aspect carefully considered. Since Ruby copies
|
81
89
|
when doing String#new, all key/data retrieval from DB is done with a 0 flag,
|
82
|
-
meaning that DB will be responsible. See [*this* news group posting]
|
90
|
+
meaning that DB will be responsible. See [*this* news group posting][newsgroup-post]
|
83
91
|
about the effect of that.
|
84
92
|
|
93
|
+
[newsgroup-post]: http://groups.google.com/group/comp.databases.berkeley-db/browse_frm/thread/4f70a9999b64ce6a/c06b94692e3cbc41?tvc=1&q=dbt+malloc#c06b94692e3cbc41
|
94
|
+
|
85
95
|
The only other design consideration of consequence was associate. The prior
|
86
96
|
version used a Ruby thread local variable and kept track of the current
|
87
97
|
database in use. The authors decided to take a simpler approach since Ruby is green
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
data/ext/extconf.rb
CHANGED
@@ -9,6 +9,12 @@ require 'mkmf'
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
# MacPorts installs the directories "inside-out" compared to the structure expected above
|
13
|
+
macports_db_versions = Dir["/opt/local/include/db*"].map { |dir| /\d\d$/.match(dir)[0] }
|
14
|
+
macports_db_versions.each do |version|
|
15
|
+
dir_config('db', "/opt/local/include/db#{version}", "/opt/local/lib/db#{version}")
|
16
|
+
end
|
17
|
+
|
12
18
|
%w(db-5.1 db-5.0 db-4.9 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2).each do |ver|
|
13
19
|
have_library ver, 'db_version', 'db.h'
|
14
20
|
end
|
@@ -56,10 +62,5 @@ def create_header
|
|
56
62
|
}
|
57
63
|
end
|
58
64
|
|
59
|
-
|
60
|
-
|
61
|
-
create_makefile('bdb')
|
62
|
-
#else
|
63
|
-
# $stderr.puts("cannot create Makefile")
|
64
|
-
# exit 1
|
65
|
-
#end
|
65
|
+
create_header
|
66
|
+
create_makefile('bdb')
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Justin Balthrop
|
9
9
|
- Denis Knauf
|
10
|
+
- Ash Moran
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
@@ -16,6 +17,7 @@ description: Advanced Ruby Berkeley DB library.
|
|
16
17
|
email:
|
17
18
|
- code@justinbalthrop.com
|
18
19
|
- Denis.Knauf@gmail.com
|
20
|
+
- ash.moran@patchspace.co.uk
|
19
21
|
executables: []
|
20
22
|
extensions:
|
21
23
|
- ext/extconf.rb
|