libcdb-ruby 0.0.3-x86-mingw32 → 0.0.4-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +5 -0
- data/README +7 -6
- data/ext/libcdb/ruby_cdb_reader.c +1 -0
- data/ext/libcdb/ruby_cdb_writer.c +2 -2
- data/lib/libcdb/libcdb_ruby.so +0 -0
- data/lib/libcdb/version.rb +1 -1
- data/lib/libcdb.rb +23 -15
- metadata +38 -57
- data/lib/libcdb/1.8/libcdb_ruby.so +0 -0
- data/lib/libcdb/1.9/libcdb_ruby.so +0 -0
data/ChangeLog
CHANGED
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to libcdb-ruby version 0.0.
|
5
|
+
This documentation refers to libcdb-ruby version 0.0.4
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -63,9 +63,10 @@ creating and reading {constant databases}[http://cr.yp.to/cdb.html].
|
|
63
63
|
== PREREQUISITES
|
64
64
|
|
65
65
|
<b></b>
|
66
|
-
* Ruby 1.8.7+ or 1.9+ (see below
|
67
|
-
|
68
|
-
|
66
|
+
* Ruby 1.8.7+ or 1.9+ (see {below}[rdoc-label:label-SUPPORTED+PLATFORMS]
|
67
|
+
for details)
|
68
|
+
* TinyCDB[http://corpit.ru/mjt/tinycdb.html] headers (not needed when
|
69
|
+
installing the fat binary gem on Windows)
|
69
70
|
|
70
71
|
Debian/Ubuntu:: +libcdb-dev+
|
71
72
|
Fedora/SuSE:: +tinycdb-devel+
|
@@ -75,8 +76,8 @@ creating and reading {constant databases}[http://cr.yp.to/cdb.html].
|
|
75
76
|
== SUPPORTED PLATFORMS
|
76
77
|
|
77
78
|
<b></b>
|
78
|
-
Linux:: 1.8 & 1.9 (Tested on Ubuntu with 1.8.
|
79
|
-
Windows:: 1.9 only (Tested on XP with 1.9.
|
79
|
+
Linux:: 1.8 & 1.9 (Tested on Ubuntu with 1.8.7p361, 1.9.2p320 and 1.9.3p195)
|
80
|
+
Windows:: 1.9 only (Tested on XP with 1.9.2p290 and 1.9.3p194)
|
80
81
|
|
81
82
|
|
82
83
|
== LINKS
|
@@ -77,8 +77,8 @@ rcdb_writer_put_value(struct cdb_make *cdbm, VALUE key, VALUE val, enum cdb_put_
|
|
77
77
|
case CDB_PUT_INSERT:
|
78
78
|
/* see if key already exists */
|
79
79
|
switch (cdb_make_exists(cdbm,
|
80
|
-
|
81
|
-
|
80
|
+
RSTRING_PTR(key),
|
81
|
+
RSTRING_LEN(key))) {
|
82
82
|
case 0:
|
83
83
|
/* doesn't exist, add all */
|
84
84
|
mode = CDB_PUT_ADD;
|
Binary file
|
data/lib/libcdb/version.rb
CHANGED
data/lib/libcdb.rb
CHANGED
@@ -13,8 +13,8 @@ module LibCDB
|
|
13
13
|
|
14
14
|
extend Forwardable
|
15
15
|
|
16
|
-
MODE_READ = 'r' # :nodoc:
|
17
|
-
MODE_WRITE = 'w' # :nodoc:
|
16
|
+
MODE_READ = 'r'.freeze # :nodoc:
|
17
|
+
MODE_WRITE = 'w'.freeze # :nodoc:
|
18
18
|
|
19
19
|
class << self
|
20
20
|
|
@@ -32,20 +32,12 @@ module LibCDB
|
|
32
32
|
# <tt>r+</tt>:: CDB (initially opened for reading)
|
33
33
|
# <tt>w+</tt>:: CDB (initially opened for writing)
|
34
34
|
def open(path, mode = MODE_READ)
|
35
|
-
klass, args =
|
36
|
-
|
37
|
-
case mode
|
38
|
-
when 'r+' then args = [mode = MODE_READ]
|
39
|
-
when 'w+' then args = [ MODE_WRITE]
|
40
|
-
when MODE_READ then klass = Reader
|
41
|
-
when MODE_WRITE then klass, mode = Writer, 'w+'
|
42
|
-
else raise ArgumentError, "illegal access mode #{mode}"
|
43
|
-
end
|
35
|
+
klass, args = _open_args(path, mode)
|
44
36
|
|
45
37
|
cdb = begin
|
46
|
-
klass.new(
|
38
|
+
klass.new(*args)
|
47
39
|
rescue
|
48
|
-
|
40
|
+
args.first.close
|
49
41
|
raise
|
50
42
|
end
|
51
43
|
|
@@ -86,6 +78,22 @@ module LibCDB
|
|
86
78
|
}
|
87
79
|
end
|
88
80
|
|
81
|
+
private
|
82
|
+
|
83
|
+
def _open_args(path, mode)
|
84
|
+
klass, args = self, []
|
85
|
+
|
86
|
+
case mode
|
87
|
+
when 'r+' then args = [mode = MODE_READ]
|
88
|
+
when 'w+' then args = [ MODE_WRITE]
|
89
|
+
when MODE_READ then klass = Reader
|
90
|
+
when MODE_WRITE then klass, mode = Writer, 'w+'
|
91
|
+
else raise ArgumentError, "illegal access mode #{mode.inspect}"
|
92
|
+
end
|
93
|
+
|
94
|
+
[klass, args.unshift(File.open(path, mode + 'b'))]
|
95
|
+
end
|
96
|
+
|
89
97
|
end
|
90
98
|
|
91
99
|
# call-seq:
|
@@ -102,7 +110,7 @@ module LibCDB
|
|
102
110
|
case mode
|
103
111
|
when MODE_READ then open_read
|
104
112
|
when MODE_WRITE then open_write
|
105
|
-
else raise ArgumentError, "illegal access mode #{mode}"
|
113
|
+
else raise ArgumentError, "illegal access mode #{mode.inspect}"
|
106
114
|
end
|
107
115
|
end
|
108
116
|
|
@@ -248,7 +256,7 @@ module LibCDB
|
|
248
256
|
@mode = new_mode
|
249
257
|
new_mode += '+' if new_mode == MODE_WRITE
|
250
258
|
|
251
|
-
io.reopen(io.path, new_mode)
|
259
|
+
io.reopen(io.path, new_mode + 'b')
|
252
260
|
end
|
253
261
|
|
254
262
|
end
|
metadata
CHANGED
@@ -1,30 +1,21 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: libcdb-ruby
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 0.0.3
|
11
6
|
platform: x86-mingw32
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jens Wille
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-04-02 00:00:00 Z
|
12
|
+
date: 2012-08-09 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
14
|
description: Ruby bindings for CDB Constant Databases.
|
22
15
|
email: jens.wille@uni-koeln.de
|
23
16
|
executables: []
|
24
|
-
|
25
17
|
extensions: []
|
26
|
-
|
27
|
-
extra_rdoc_files:
|
18
|
+
extra_rdoc_files:
|
28
19
|
- README
|
29
20
|
- COPYING
|
30
21
|
- ChangeLog
|
@@ -32,71 +23,61 @@ extra_rdoc_files:
|
|
32
23
|
- ext/libcdb/ruby_cdb.c
|
33
24
|
- ext/libcdb/ruby_cdb_reader.c
|
34
25
|
- ext/libcdb/ruby_cdb_writer.c
|
35
|
-
files:
|
26
|
+
files:
|
36
27
|
- lib/libcdb-ruby.rb
|
37
|
-
- lib/libcdb/version.rb
|
38
28
|
- lib/cdb.rb
|
29
|
+
- lib/libcdb/version.rb
|
39
30
|
- lib/libcdb.rb
|
40
|
-
- ChangeLog
|
41
31
|
- COPYING
|
42
|
-
- README
|
43
|
-
- Rakefile
|
44
32
|
- TODO
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
- ext/libcdb/ruby_cdb_reader.c
|
49
|
-
- ext/libcdb/ruby_cdb.h
|
33
|
+
- ChangeLog
|
34
|
+
- Rakefile
|
35
|
+
- README
|
50
36
|
- ext/libcdb/ruby_cdb_writer.c
|
37
|
+
- ext/libcdb/ruby_cdb.h
|
38
|
+
- ext/libcdb/libcdb_ruby.def
|
51
39
|
- ext/libcdb/extconf.rb
|
40
|
+
- ext/libcdb/ruby_cdb_writer.h
|
41
|
+
- ext/libcdb/ruby_libcdb.h
|
52
42
|
- ext/libcdb/ruby_cdb_reader.h
|
53
43
|
- ext/libcdb/libcdb.c
|
54
|
-
- ext/libcdb/
|
55
|
-
-
|
56
|
-
- spec/libcdb/reader_spec.rb
|
44
|
+
- ext/libcdb/ruby_cdb_reader.c
|
45
|
+
- ext/libcdb/ruby_cdb.c
|
57
46
|
- spec/spec_helper.rb
|
47
|
+
- spec/libcdb/reader_spec.rb
|
48
|
+
- spec/libcdb/writer_spec.rb
|
58
49
|
- .rspec
|
59
|
-
- lib/libcdb/
|
60
|
-
- lib/libcdb/1.9/libcdb_ruby.so
|
50
|
+
- lib/libcdb/libcdb_ruby.so
|
61
51
|
homepage: http://github.com/blackwinter/libcdb-ruby
|
62
52
|
licenses: []
|
63
|
-
|
64
53
|
post_install_message:
|
65
|
-
rdoc_options:
|
66
|
-
- --main
|
67
|
-
- README
|
54
|
+
rdoc_options:
|
68
55
|
- --charset
|
69
56
|
- UTF-8
|
70
|
-
- --title
|
71
|
-
- libcdb-ruby Application documentation (v0.0.3)
|
72
|
-
- --all
|
73
57
|
- --line-numbers
|
74
|
-
|
58
|
+
- --all
|
59
|
+
- --title
|
60
|
+
- libcdb-ruby Application documentation (v0.0.4)
|
61
|
+
- --main
|
62
|
+
- README
|
63
|
+
require_paths:
|
75
64
|
- lib
|
76
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
66
|
none: false
|
78
|
-
requirements:
|
79
|
-
- -
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
|
82
|
-
|
83
|
-
- 0
|
84
|
-
version: "0"
|
85
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
72
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
segments:
|
92
|
-
- 0
|
93
|
-
version: "0"
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
94
77
|
requirements: []
|
95
|
-
|
96
78
|
rubyforge_project:
|
97
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.24
|
98
80
|
signing_key:
|
99
81
|
specification_version: 3
|
100
82
|
summary: Ruby bindings for CDB Constant Databases.
|
101
83
|
test_files: []
|
102
|
-
|
Binary file
|
Binary file
|