fsdb 0.7.2 → 0.7.3

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.
@@ -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
@@ -1,3 +1,10 @@
1
+ fsdb 0.7.3
2
+
3
+ - avoid warnings with ruby 2.0
4
+ - update rakefile and gemspec
5
+ - reorganized test dir and scripts
6
+ - add bench tasks to rakefile
7
+
1
8
  fsdb 0.7.2
2
9
 
3
10
  - rename lock_shared and lock_exclusive by appending _fsdb to avoid conflicts
@@ -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
 
@@ -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
+
@@ -1,4 +1,5 @@
1
- require 'fsdb' # http://redshift.sourceforge.net/fsdb
1
+ require 'fsdb'
2
+ require 'yaml'
2
3
 
3
4
  db = FSDB::Database.new("~/tmp")
4
5
 
File without changes
@@ -8,7 +8,7 @@ require 'fsdb/formats'
8
8
  module FSDB
9
9
  include Formats
10
10
 
11
- FSDB::VERSION = "0.7.1"
11
+ FSDB::VERSION = "0.7.3"
12
12
 
13
13
  # A thread-safe, process-safe object database class which uses the
14
14
  # native file system as its back end and allows multiple file formats.
File without changes
File without changes
File without changes
File without changes
@@ -1,9 +1,6 @@
1
- #!/usr/bin/env ruby
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(Config::CONFIG['bindir'],
93
- Config::CONFIG['RUBY_INSTALL_NAME'])
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}"
@@ -1,11 +1,9 @@
1
- #!/usr/bin/env ruby
1
+ $LOAD_PATH.unshift(File.join(File.expand_path("..", __FILE__), "lib"))
2
2
 
3
- $:.unshift(File.expand_path("..", __FILE__))
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 cleanup dir
31
+ def clean_up dir
34
32
  @db.browse_dir dir do |child_path|
35
33
  if child_path =~ /\/$/ ## ugh!
36
- cleanup(child_path)
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 test_zzz_cleanup # Argh! Test::Unit is missing a few features....
76
- cleanup '/'
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
@@ -1,12 +1,13 @@
1
- #!/usr/bin/env ruby
1
+ $LOAD_PATH.unshift(File.join(File.expand_path("..", __FILE__), "lib"))
2
2
 
3
- $:.unshift(File.expand_path("..", __FILE__))
3
+ require 'db-for-test'
4
4
 
5
5
  require 'test/unit'
6
6
 
7
- require 'test.rb'
8
-
9
- Dir.chdir('/') # just to show that the curr dir is irrelevant
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
- cleanup '/'
23
+ clean_up '/'
23
24
  end
24
25
 
25
- def test_zzz_cleanup # Argh! Test::Unit is missing a few features....
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, cleanup should work when the dir is not there
28
- cleanup '/'
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 cleanup dir
33
+ def clean_up dir
33
34
  @db.browse_dir dir do |child_path|
34
35
  if child_path =~ /\/$/ ## ugh!
35
- cleanup(child_path)
36
+ clean_up(child_path)
36
37
  else
37
38
  @db.delete(child_path)
38
39
  end
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env ruby
2
-
3
1
  require 'fsdb/modex'
4
2
 
5
3
  include FSDB
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.2
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: 2012-05-20 00:00:00.000000000 Z
11
+ date: 2013-05-28 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description: ! 'A file system data base. Provides a thread-safe, process-safe Database
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.markdown
21
+ - README.md
28
22
  files:
29
23
  - History.txt
30
- - README.markdown
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-all.rb
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.markdown
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: 1.8.24
91
+ rubygems_version: 2.0.3
94
92
  signing_key:
95
- specification_version: 3
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:
@@ -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