rdbxml 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +21 -0
- data/README +80 -0
- data/Rakefile +100 -0
- data/docs/db.rb +6 -0
- data/docs/dbxml.rb +6 -0
- data/ext/db.i +23 -0
- data/ext/dbxml.i +1708 -0
- data/ext/dbxml_ruby.i +14 -0
- data/extconf.rb +37 -0
- data/lib/rdbxml.rb +79 -0
- data/rake/extensiontask.rb +194 -0
- data/rake/swigextensiontask.rb +62 -0
- data/test/db_test.rb +11 -0
- data/test/dbxml_test.rb +48 -0
- data/test/rdbxml_test.rb +40 -0
- metadata +75 -0
data/test/rdbxml_test.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'rdbxml'
|
4
|
+
|
5
|
+
class RDBXMLTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@dir = File.join( File.dirname(__FILE__), File.basename(__FILE__, '.rb') + '.db' )
|
9
|
+
Dir.mkdir @dir unless File.exists? @dir
|
10
|
+
@env = RDBXML::env(@dir)
|
11
|
+
|
12
|
+
@db = RDBXML::XmlManager.new @env, 0
|
13
|
+
@db.setDefaultContainerType RDBXML::XmlContainer::WholedocContainer
|
14
|
+
@docs = @db['test']
|
15
|
+
|
16
|
+
@name = "test document ##{rand(10000)}"
|
17
|
+
@content = '<test>This is a test</test>'
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_put_get_document
|
21
|
+
assert_not_nil @docs
|
22
|
+
|
23
|
+
@docs[name] = @content
|
24
|
+
doc = @docs[name]
|
25
|
+
assert_not_nil doc
|
26
|
+
assert_equal doc.to_s, @content
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_update_document
|
30
|
+
assert_not_nil @docs
|
31
|
+
|
32
|
+
for content in [@content, @content.upcase]
|
33
|
+
@docs[name] = content
|
34
|
+
doc = @docs[name]
|
35
|
+
assert_not_nil doc
|
36
|
+
assert_equal doc.to_s, content
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.8.11
|
3
|
+
specification_version: 1
|
4
|
+
name: rdbxml
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: "0.1"
|
7
|
+
date: 2006-05-07 00:00:00 -07:00
|
8
|
+
summary: Provides wrappers for the BDBXML (and BDB) C++ APIs, plus pure Ruby extensions
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
- ext
|
12
|
+
email:
|
13
|
+
homepage:
|
14
|
+
rubyforge_project:
|
15
|
+
description: ""
|
16
|
+
autorequire: rdbxml
|
17
|
+
default_executable:
|
18
|
+
bindir: bin
|
19
|
+
has_rdoc: true
|
20
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.0.0
|
25
|
+
version:
|
26
|
+
platform: ruby
|
27
|
+
signing_key:
|
28
|
+
cert_chain:
|
29
|
+
authors:
|
30
|
+
- Steve Sloan
|
31
|
+
files:
|
32
|
+
- README
|
33
|
+
- MIT-LICENSE
|
34
|
+
- lib/rdbxml.rb
|
35
|
+
- docs/dbxml.rb
|
36
|
+
- docs/db.rb
|
37
|
+
- rake/extensiontask.rb
|
38
|
+
- rake/swigextensiontask.rb
|
39
|
+
- Rakefile
|
40
|
+
- ext/dbxml.i
|
41
|
+
- ext/db.i
|
42
|
+
- ext/dbxml_ruby.i
|
43
|
+
- test/db_test.rb
|
44
|
+
- test/dbxml_test.rb
|
45
|
+
- test/rdbxml_test.rb
|
46
|
+
test_files:
|
47
|
+
- test/db_test.rb
|
48
|
+
- test/dbxml_test.rb
|
49
|
+
- test/rdbxml_test.rb
|
50
|
+
rdoc_options:
|
51
|
+
- --line-numbers
|
52
|
+
- --inline-source
|
53
|
+
- --main
|
54
|
+
- README
|
55
|
+
- --exclude
|
56
|
+
- ext/*.c*
|
57
|
+
extra_rdoc_files:
|
58
|
+
- README
|
59
|
+
- MIT-LICENSE
|
60
|
+
executables: []
|
61
|
+
|
62
|
+
extensions:
|
63
|
+
- ./extconf.rb
|
64
|
+
requirements: []
|
65
|
+
|
66
|
+
dependencies:
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rake
|
69
|
+
version_requirement:
|
70
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.7.0
|
75
|
+
version:
|