fsdb 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/History.txt +7 -0
- data/{README.markdown → README.md} +1 -1
- data/Rakefile +46 -0
- data/examples/fsdb-example.rb +2 -1
- data/examples/fsdb-examples.rb +0 -0
- data/lib/fsdb/database.rb +1 -1
- data/test/{test.rb → lib/db-for-test.rb} +0 -0
- data/test/{test-concurrency → lib/test-concurrency}/init.rb +0 -0
- data/test/{test-concurrency → lib/test-concurrency}/test-object.rb +0 -0
- data/test/{runs.rb → misc/runs.rb} +0 -0
- data/test/{test-file-lock.rb → misc/test-file-lock.rb} +0 -0
- data/test/{test-util.rb → misc/test-util.rb} +0 -0
- data/test/{trap.rb → misc/trap.rb} +0 -0
- data/test/test-concurrency.rb +4 -7
- data/test/test-formats.rb +6 -8
- data/test/test-fsdb.rb +12 -11
- data/test/test-modex.rb +0 -2
- metadata +30 -28
- data/test/test-all.rb +0 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1361cd08dce77d57a66448c543f9bbbdb9a10c3d
|
4
|
+
data.tar.gz: 1ccdb0778b35c995ce5608814ce05f2f5a8609f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9a100f043d08103fb8f933c690978a1e1aa8680a742050ddc83f95047ac1013593847d779af76abd6cf74428f174f972adb544fc970df6e6e93de4e833d09ede
|
7
|
+
data.tar.gz: 868743ef4823cecc61b439779756a7a34bba8c9da01c88b7bc91e963fd8c925c9dc6506948c69091a552d873402a99f5b06ecef095865d39e5183d437e27e16f
|
data/History.txt
CHANGED
@@ -269,7 +269,7 @@ FSDB has been tested on the following platforms and file systems:
|
|
269
269
|
|
270
270
|
- Windows ME (single cpu, FAT32)
|
271
271
|
|
272
|
-
FSDB is currently tested with ruby-1.9.3 and ruby-1.8.7.
|
272
|
+
FSDB is currently tested with ruby-2.0.0, ruby-1.9.3, and ruby-1.8.7.
|
273
273
|
|
274
274
|
On windows, both the mswin32 and mingw32 builds of ruby have been used with FSDB. It has never been tested with cygwin or bccwin.
|
275
275
|
|
data/Rakefile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
def cur_ruby
|
5
|
+
require 'rbconfig'
|
6
|
+
@cur_ruby ||= RbConfig::CONFIG["RUBY_INSTALL_NAME"]
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Run unit tests"
|
10
|
+
Rake::TestTask.new :test_unit do |t|
|
11
|
+
t.libs << "lib"
|
12
|
+
t.libs << "test/lib"
|
13
|
+
t.test_files = FileList[
|
14
|
+
"test/test-fsdb.rb",
|
15
|
+
"test/test-formats.rb"
|
16
|
+
]
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "Run stress tests"
|
20
|
+
task :test_stress do
|
21
|
+
tests = [
|
22
|
+
"test/test-modex.rb",
|
23
|
+
"test/test-concurrency.rb"
|
24
|
+
]
|
25
|
+
|
26
|
+
tests.each do |test|
|
27
|
+
cmd = [cur_ruby, test]
|
28
|
+
puts "running>> #{cmd.join(" ")}"
|
29
|
+
sh *cmd
|
30
|
+
puts "$" * 60
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Run all tests"
|
35
|
+
task :test => [:test_stress, :test_unit]
|
36
|
+
|
37
|
+
desc "Run unit benchmarks"
|
38
|
+
task :bench_unit do
|
39
|
+
sh "bench/bench.rb"
|
40
|
+
end
|
41
|
+
|
42
|
+
desc "Run system benchmarks"
|
43
|
+
task :bench_system do
|
44
|
+
sh cur_ruby, "test/test-concurrency.rb", "-b"
|
45
|
+
end
|
46
|
+
|
data/examples/fsdb-example.rb
CHANGED
data/examples/fsdb-examples.rb
CHANGED
File without changes
|
data/lib/fsdb/database.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/test-concurrency.rb
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$:.unshift(File.expand_path("..", __FILE__))
|
4
|
-
|
5
|
-
require 'test.rb'
|
1
|
+
$LOAD_PATH.unshift(File.join(File.expand_path("..", __FILE__), "lib"))
|
6
2
|
|
3
|
+
require 'db-for-test'
|
7
4
|
require 'test-concurrency/init'
|
8
5
|
require 'test-concurrency/test-object'
|
9
6
|
|
@@ -89,8 +86,8 @@ class ConcurrencyTest
|
|
89
86
|
unless @ruby_name
|
90
87
|
require 'rbconfig'
|
91
88
|
|
92
|
-
@ruby_name = File.join(
|
93
|
-
|
89
|
+
@ruby_name = File.join(RbConfig::CONFIG['bindir'],
|
90
|
+
RbConfig::CONFIG['RUBY_INSTALL_NAME'])
|
94
91
|
end
|
95
92
|
|
96
93
|
cmd = "#{@ruby_name} #{$0} --child-index=#{idx} --database=#{@subdb_dir}"
|
data/test/test-formats.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
|
1
|
+
$LOAD_PATH.unshift(File.join(File.expand_path("..", __FILE__), "lib"))
|
2
2
|
|
3
|
-
|
3
|
+
require 'db-for-test'
|
4
4
|
|
5
5
|
require 'test/unit'
|
6
6
|
|
7
|
-
require 'test.rb'
|
8
|
-
|
9
7
|
class Test_Formats < Test::Unit::TestCase
|
10
8
|
|
11
9
|
PREFIX_FORMAT =
|
@@ -30,10 +28,10 @@ class Test_Formats < Test::Unit::TestCase
|
|
30
28
|
end
|
31
29
|
|
32
30
|
# this is like in test-concurrency.rb -- generalize?
|
33
|
-
def
|
31
|
+
def clean_up dir
|
34
32
|
@db.browse_dir dir do |child_path|
|
35
33
|
if child_path =~ /\/$/ ## ugh!
|
36
|
-
|
34
|
+
clean_up(child_path)
|
37
35
|
else
|
38
36
|
@db.delete(child_path)
|
39
37
|
end
|
@@ -72,8 +70,8 @@ class Test_Formats < Test::Unit::TestCase
|
|
72
70
|
assert_equal(binstr, @db['bin.bin'])
|
73
71
|
end
|
74
72
|
|
75
|
-
def
|
76
|
-
|
73
|
+
def test_zzz_clean_up # Argh! Test::Unit is missing a few features....
|
74
|
+
clean_up '/'
|
77
75
|
end
|
78
76
|
|
79
77
|
end
|
data/test/test-fsdb.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
|
1
|
+
$LOAD_PATH.unshift(File.join(File.expand_path("..", __FILE__), "lib"))
|
2
2
|
|
3
|
-
|
3
|
+
require 'db-for-test'
|
4
4
|
|
5
5
|
require 'test/unit'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
#Dir.chdir('/')
|
8
|
+
# Just to show that the curr dir is irrelevant.
|
9
|
+
# However, this plays havoc with the rake test loader, so only enable it if
|
10
|
+
# you are running 'ruby <thisfile>'
|
10
11
|
|
11
12
|
LINKS_WORK = FSDB::PLATFORM_IS_WINDOWS_NT
|
12
13
|
SYMLINKS_WORK = !FSDB::PLATFORM_IS_WINDOWS # maybe cygwin?
|
@@ -19,20 +20,20 @@ class Test_FSDB < Test::Unit::TestCase
|
|
19
20
|
super
|
20
21
|
@db = $db.subdb('test-fsdb')
|
21
22
|
# raise unless @db['/'].empty?
|
22
|
-
|
23
|
+
clean_up '/'
|
23
24
|
end
|
24
25
|
|
25
|
-
def
|
26
|
+
def test_zzz_clean_up # Argh! Test::Unit is missing a few features....
|
26
27
|
@db['foo.txt'] = "abc" # something to clean up
|
27
|
-
## really,
|
28
|
-
|
28
|
+
## really, clean_up should work when the dir is not there
|
29
|
+
clean_up '/'
|
29
30
|
end
|
30
31
|
|
31
32
|
# this is like in test-concurrency.rb -- generalize?
|
32
|
-
def
|
33
|
+
def clean_up dir
|
33
34
|
@db.browse_dir dir do |child_path|
|
34
35
|
if child_path =~ /\/$/ ## ugh!
|
35
|
-
|
36
|
+
clean_up(child_path)
|
36
37
|
else
|
37
38
|
@db.delete(child_path)
|
38
39
|
end
|
data/test/test-modex.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fsdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
5
|
-
prerelease:
|
4
|
+
version: 0.7.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Joel VanderWerf
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-05-28 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
description:
|
15
|
-
class.
|
16
|
-
|
17
|
-
Each entry is a separate file referenced by its relative path. Allows multiple
|
18
|
-
|
13
|
+
description: A file system data base. Provides a thread-safe, process-safe Database
|
14
|
+
class. Each entry is a separate file referenced by its relative path. Allows multiple
|
19
15
|
file formats and serialization methods. Pure ruby and very light weight.
|
20
|
-
|
21
|
-
'
|
22
16
|
email: vjoel@users.sourceforge.net
|
23
17
|
executables: []
|
24
18
|
extensions: []
|
25
19
|
extra_rdoc_files:
|
26
20
|
- History.txt
|
27
|
-
- README.
|
21
|
+
- README.md
|
28
22
|
files:
|
29
23
|
- History.txt
|
30
|
-
- README.
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
31
26
|
- bench/bench.rb
|
32
27
|
- examples/indexes.rb
|
33
28
|
- examples/fixture.rb
|
@@ -57,42 +52,49 @@ files:
|
|
57
52
|
- lib/fsdb/database.rb
|
58
53
|
- lib/fsdb/server.rb
|
59
54
|
- test/test-fsdb.rb
|
60
|
-
- test/test-file-lock.rb
|
61
|
-
- test/test-util.rb
|
55
|
+
- test/misc/test-file-lock.rb
|
56
|
+
- test/misc/test-util.rb
|
57
|
+
- test/misc/trap.rb
|
58
|
+
- test/misc/runs.rb
|
62
59
|
- test/test-modex.rb
|
63
|
-
- test/trap.rb
|
64
|
-
- test/test.rb
|
65
|
-
- test/test-concurrency/init.rb
|
66
|
-
- test/test-concurrency/test-object.rb
|
67
60
|
- test/test-formats.rb
|
68
|
-
- test/runs.rb
|
69
61
|
- test/test-concurrency.rb
|
70
|
-
- test/test
|
62
|
+
- test/lib/db-for-test.rb
|
63
|
+
- test/lib/test-concurrency/init.rb
|
64
|
+
- test/lib/test-concurrency/test-object.rb
|
71
65
|
homepage: http://rubyforge.org/projects/fsdb/
|
72
66
|
licenses: []
|
67
|
+
metadata: {}
|
73
68
|
post_install_message:
|
74
69
|
rdoc_options:
|
70
|
+
- --quiet
|
71
|
+
- --line-numbers
|
72
|
+
- --inline-source
|
73
|
+
- --title
|
74
|
+
- FSDB
|
75
75
|
- --main
|
76
|
-
- README.
|
76
|
+
- README.md
|
77
77
|
require_paths:
|
78
78
|
- lib
|
79
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
80
|
requirements:
|
82
|
-
- -
|
81
|
+
- - '>='
|
83
82
|
- !ruby/object:Gem::Version
|
84
83
|
version: '0'
|
85
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
85
|
requirements:
|
88
|
-
- -
|
86
|
+
- - '>='
|
89
87
|
- !ruby/object:Gem::Version
|
90
88
|
version: '0'
|
91
89
|
requirements: []
|
92
90
|
rubyforge_project: fsdb
|
93
|
-
rubygems_version:
|
91
|
+
rubygems_version: 2.0.3
|
94
92
|
signing_key:
|
95
|
-
specification_version:
|
93
|
+
specification_version: 4
|
96
94
|
summary: File System Database
|
97
|
-
test_files:
|
95
|
+
test_files:
|
96
|
+
- test/test-fsdb.rb
|
97
|
+
- test/test-modex.rb
|
98
|
+
- test/test-formats.rb
|
99
|
+
- test/test-concurrency.rb
|
98
100
|
has_rdoc:
|
data/test/test-all.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/user/bin/env ruby
|
2
|
-
|
3
|
-
require 'rbconfig'
|
4
|
-
|
5
|
-
ruby = Config::CONFIG["RUBY_INSTALL_NAME"]
|
6
|
-
|
7
|
-
tests = [
|
8
|
-
"test-mutex.rb",
|
9
|
-
"test-modex.rb",
|
10
|
-
"test-fsdb.rb",
|
11
|
-
"test-formats.rb",
|
12
|
-
"test-concurrency.rb"
|
13
|
-
]
|
14
|
-
|
15
|
-
tests.each do |test|
|
16
|
-
cmd = "#{ruby} #{test}"
|
17
|
-
puts "running>> #{cmd}"
|
18
|
-
system cmd
|
19
|
-
end
|