strokedb 0.0.2.1 → 0.0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +18 -20
- data/bench.html +4001 -0
- data/bin/strokedb +14 -0
- data/examples/movies.rb +105 -0
- data/examples/movies2.rb +97 -0
- data/examples/strokewiki/README +28 -0
- data/examples/strokewiki/view/edit.xhtml +27 -0
- data/examples/strokewiki/view/new.xhtml +26 -0
- data/examples/strokewiki/view/pages.xhtml +27 -0
- data/examples/strokewiki/view/show.xhtml +40 -0
- data/examples/strokewiki/view/versions.xhtml +25 -0
- data/examples/strokewiki/wiki.rb +106 -0
- data/examples/todo.rb +92 -0
- data/lib/strokedb.rb +85 -0
- data/lib/{config → strokedb}/config.rb +14 -9
- data/lib/strokedb/console.rb +87 -0
- data/lib/strokedb/core_ext.rb +10 -0
- data/lib/{util/ext → strokedb/core_ext}/blank.rb +1 -1
- data/lib/{util/ext → strokedb/core_ext}/enumerable.rb +0 -0
- data/lib/{util/ext → strokedb/core_ext}/fixnum.rb +0 -0
- data/lib/strokedb/core_ext/float.rb +4 -0
- data/lib/{util/ext → strokedb/core_ext}/hash.rb +0 -0
- data/lib/strokedb/core_ext/infinity.rb +33 -0
- data/lib/strokedb/core_ext/kernel.rb +41 -0
- data/lib/strokedb/core_ext/object.rb +16 -0
- data/lib/{util/ext → strokedb/core_ext}/string.rb +28 -1
- data/lib/strokedb/core_ext/symbol.rb +13 -0
- data/lib/strokedb/data_structures.rb +5 -0
- data/lib/strokedb/data_structures/chunked_skiplist.rb +123 -0
- data/lib/{data_structures → strokedb/data_structures}/inverted_list.rb +0 -0
- data/lib/{data_structures → strokedb/data_structures}/point_query.rb +0 -0
- data/lib/strokedb/data_structures/simple_skiplist.rb +350 -0
- data/lib/{data_structures → strokedb/data_structures}/skiplist.rb +1 -1
- data/lib/{document → strokedb}/document.rb +180 -71
- data/lib/{document → strokedb/document}/callback.rb +0 -0
- data/lib/{document → strokedb/document}/delete.rb +2 -2
- data/lib/strokedb/document/dsl.rb +4 -0
- data/lib/{document → strokedb/document/dsl}/associations.rb +0 -0
- data/lib/{document → strokedb/document/dsl}/coercions.rb +0 -0
- data/lib/strokedb/document/dsl/meta_dsl.rb +7 -0
- data/lib/{document → strokedb/document/dsl}/validations.rb +26 -21
- data/lib/{document → strokedb/document/dsl}/virtualize.rb +0 -0
- data/lib/{document → strokedb/document}/meta.rb +92 -29
- data/lib/{document → strokedb/document}/slot.rb +17 -5
- data/lib/{document → strokedb/document}/util.rb +0 -0
- data/lib/{document → strokedb/document}/versions.rb +2 -2
- data/lib/strokedb/index.rb +2 -0
- data/lib/strokedb/nsurl.rb +24 -0
- data/lib/strokedb/store.rb +149 -0
- data/lib/strokedb/stores.rb +6 -0
- data/lib/{stores → strokedb/stores}/chainable_storage.rb +20 -14
- data/lib/strokedb/stores/file_storage.rb +118 -0
- data/lib/{stores/inverted_list_index → strokedb/stores}/inverted_list_file_storage.rb +50 -0
- data/lib/strokedb/stores/memory_storage.rb +80 -0
- data/lib/{stores → strokedb/stores}/remote_store.rb +10 -4
- data/lib/strokedb/sync.rb +4 -0
- data/lib/{sync → strokedb/sync}/chain_sync.rb +0 -0
- data/lib/{sync → strokedb/sync}/diff.rb +12 -1
- data/lib/{sync/stroke_diff → strokedb/sync/diff}/array.rb +1 -1
- data/lib/{sync/stroke_diff → strokedb/sync/diff}/default.rb +0 -0
- data/lib/{sync/stroke_diff → strokedb/sync/diff}/hash.rb +1 -1
- data/lib/{sync/stroke_diff → strokedb/sync/diff}/string.rb +1 -1
- data/lib/{sync → strokedb/sync}/lamport_timestamp.rb +0 -0
- data/lib/{sync → strokedb/sync}/store_sync.rb +15 -7
- data/lib/strokedb/transaction.rb +78 -0
- data/lib/{util → strokedb}/util.rb +14 -7
- data/lib/strokedb/util/attach_dsl.rb +29 -0
- data/lib/{util → strokedb/util}/blankslate.rb +0 -0
- data/lib/strokedb/util/class_optimization.rb +93 -0
- data/lib/{util → strokedb/util}/inflect.rb +0 -0
- data/lib/strokedb/util/java_util.rb +13 -0
- data/lib/{util → strokedb/util}/lazy_array.rb +0 -0
- data/lib/{util → strokedb/util}/lazy_mapping_array.rb +4 -0
- data/lib/{util → strokedb/util}/lazy_mapping_hash.rb +0 -0
- data/lib/{util → strokedb/util}/serialization.rb +21 -0
- data/lib/strokedb/util/uuid.rb +159 -0
- data/lib/{util → strokedb/util}/xml.rb +0 -0
- data/lib/{view → strokedb}/view.rb +2 -2
- data/lib/strokedb/volumes.rb +5 -0
- data/lib/strokedb/volumes/archive_volume.rb +165 -0
- data/lib/strokedb/volumes/block_volume.rb +169 -0
- data/lib/strokedb/volumes/distributed_pointer.rb +43 -0
- data/lib/strokedb/volumes/fixed_length_skiplist_volume.rb +109 -0
- data/lib/strokedb/volumes/map_volume.rb +268 -0
- data/meta/MANIFEST +175 -0
- data/script/console +2 -70
- data/spec/integration/remote_store_spec.rb +70 -0
- data/spec/integration/search_spec.rb +76 -0
- data/spec/integration/spec_helper.rb +1 -0
- data/spec/lib/spec_helper.rb +1 -0
- data/spec/lib/strokedb/config_spec.rb +250 -0
- data/spec/lib/strokedb/core_ext/blank_spec.rb +20 -0
- data/spec/lib/strokedb/core_ext/extract_spec.rb +42 -0
- data/spec/lib/strokedb/core_ext/float_spec.rb +62 -0
- data/spec/lib/strokedb/core_ext/infinity_spec.rb +40 -0
- data/spec/lib/strokedb/core_ext/spec_helper.rb +1 -0
- data/spec/lib/strokedb/core_ext/string_spec.rb +25 -0
- data/spec/lib/strokedb/core_ext/symbol_spec.rb +8 -0
- data/spec/lib/strokedb/data_structures/chunked_skiplist_spec.rb +144 -0
- data/spec/lib/strokedb/data_structures/inverted_list_spec.rb +172 -0
- data/spec/lib/strokedb/data_structures/simple_skiplist_spec.rb +200 -0
- data/spec/lib/strokedb/data_structures/skiplist_spec.rb +253 -0
- data/spec/lib/strokedb/data_structures/spec_helper.rb +1 -0
- data/spec/lib/strokedb/document/associations_spec.rb +319 -0
- data/spec/lib/strokedb/document/callbacks_spec.rb +134 -0
- data/spec/lib/strokedb/document/coercions_spec.rb +110 -0
- data/spec/lib/strokedb/document/document_spec.rb +1063 -0
- data/spec/lib/strokedb/document/meta_meta_spec.rb +30 -0
- data/spec/lib/strokedb/document/meta_spec.rb +435 -0
- data/spec/lib/strokedb/document/metaslot_spec.rb +43 -0
- data/spec/lib/strokedb/document/slot_spec.rb +130 -0
- data/spec/lib/strokedb/document/spec_helper.rb +1 -0
- data/spec/lib/strokedb/document/validations_spec.rb +1081 -0
- data/spec/lib/strokedb/document/virtualize_spec.rb +80 -0
- data/spec/lib/strokedb/nsurl_spec.rb +73 -0
- data/spec/lib/strokedb/spec_helper.rb +1 -0
- data/spec/lib/strokedb/stores/chained_storages_spec.rb +116 -0
- data/spec/lib/strokedb/stores/spec_helper.rb +1 -0
- data/spec/lib/strokedb/stores/store_spec.rb +201 -0
- data/spec/lib/strokedb/stores/transaction_spec.rb +107 -0
- data/spec/lib/strokedb/sync/chain_sync_spec.rb +43 -0
- data/spec/lib/strokedb/sync/diff_spec.rb +111 -0
- data/spec/lib/strokedb/sync/lamport_timestamp_spec.rb +174 -0
- data/spec/lib/strokedb/sync/slot_diff_spec.rb +164 -0
- data/spec/lib/strokedb/sync/spec_helper.rb +1 -0
- data/spec/lib/strokedb/sync/store_sync_spec.rb +181 -0
- data/spec/lib/strokedb/sync/stroke_diff/array_spec.rb +97 -0
- data/spec/lib/strokedb/sync/stroke_diff/complex_spec.rb +58 -0
- data/spec/lib/strokedb/sync/stroke_diff/hash_spec.rb +144 -0
- data/spec/lib/strokedb/sync/stroke_diff/scalar_spec.rb +23 -0
- data/spec/lib/strokedb/sync/stroke_diff/spec_helper.rb +25 -0
- data/spec/lib/strokedb/sync/stroke_diff/string_spec.rb +61 -0
- data/spec/lib/strokedb/util/attach_dsl_spec.rb +45 -0
- data/spec/lib/strokedb/util/inflect_spec.rb +14 -0
- data/spec/lib/strokedb/util/lazy_array_spec.rb +157 -0
- data/spec/lib/strokedb/util/lazy_mapping_array_spec.rb +174 -0
- data/spec/lib/strokedb/util/lazy_mapping_hash_spec.rb +92 -0
- data/spec/lib/strokedb/util/spec_helper.rb +1 -0
- data/spec/lib/strokedb/util/uuid_spec.rb +46 -0
- data/spec/lib/strokedb/view_spec.rb +228 -0
- data/spec/lib/strokedb/volumes/archive_volume_spec.rb +105 -0
- data/spec/lib/strokedb/volumes/block_volume_spec.rb +100 -0
- data/spec/lib/strokedb/volumes/distributed_pointer_spec.rb +14 -0
- data/spec/lib/strokedb/volumes/fixed_length_skiplist_volume_spec.rb +177 -0
- data/spec/lib/strokedb/volumes/map_volume_spec.rb +172 -0
- data/spec/lib/strokedb/volumes/spec_helper.rb +1 -0
- data/spec/regression/docref_spec.rb +94 -0
- data/spec/regression/meta_spec.rb +23 -0
- data/spec/regression/spec_helper.rb +1 -0
- data/spec/regression/sync_spec.rb +36 -0
- data/spec/spec.opts +7 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/temp/storages/TIMESTAMP +1 -0
- data/spec/temp/storages/UUID +1 -0
- data/spec/temp/storages/database-sync/TIMESTAMP +1 -0
- data/spec/temp/storages/database-sync/UUID +1 -0
- data/spec/temp/storages/database-sync/config +1 -0
- data/spec/temp/storages/database-sync/file/LAST +1 -0
- data/spec/temp/storages/database-sync/file/bd/f6/bdf675e5-8a7b-494e-97f2-f74a14ccd95d.av +0 -0
- data/spec/temp/storages/database-sync/file/uindex.wal +0 -0
- data/spec/temp/storages/database-sync/inverted_list_file/INVERTED_INDEX +1 -0
- data/spec/temp/storages/inverted_list_storage/INVERTED_INDEX +0 -0
- data/strokedb.gemspec +120 -0
- data/task/benchmark.task +9 -0
- data/task/ditz.task +30 -0
- data/task/echoe.rb +17 -0
- data/task/rcov.task +50 -0
- data/task/rdoc.task +10 -0
- data/task/rspec.task +0 -0
- data/vendor/java_inline.rb +106 -0
- data/vendor/rbmodexcl/mrimodexcl.rb +82 -0
- data/vendor/rbmodexcl/rbmodexcl.rb +5 -0
- data/vendor/rbmodexcl/rbxmodexcl.rb +48 -0
- data/vendor/rbmodexcl/spec/unextend_spec.rb +50 -0
- data/vendor/rbmodexcl/spec/uninclude_spec.rb +26 -0
- metadata +271 -79
- data/CONTRIBUTORS +0 -7
- data/CREDITS +0 -13
- data/bin/sdbc +0 -2
- data/lib/init.rb +0 -57
- data/lib/stores/inverted_list_index/inverted_list_index.rb +0 -49
- data/lib/stores/skiplist_store/chunk.rb +0 -119
- data/lib/stores/skiplist_store/chunk_storage.rb +0 -21
- data/lib/stores/skiplist_store/file_chunk_storage.rb +0 -44
- data/lib/stores/skiplist_store/memory_chunk_storage.rb +0 -37
- data/lib/stores/skiplist_store/skiplist_store.rb +0 -217
- data/lib/stores/store.rb +0 -5
- data/lib/sync/stroke_diff/stroke_diff.rb +0 -9
- data/lib/util/ext/object.rb +0 -8
- data/lib/util/java_util.rb +0 -9
- data/lib/util/trigger_partition.rb +0 -136
- data/strokedb.rb +0 -75
@@ -0,0 +1 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe 'DocRef' do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
@path = TEMP_STORAGES + '/docref_reg'
|
7
|
+
FileUtils.rm_rf @path
|
8
|
+
StrokeDB::Config.build :default => true, :base_path => @path
|
9
|
+
Object.send!(:remove_const,'T') if defined?(T)
|
10
|
+
T = StrokeDB::Meta.new do
|
11
|
+
on_new_document do |doc|
|
12
|
+
doc.children = []
|
13
|
+
doc.parent = nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_child c
|
17
|
+
# unless children.find{ |d| d.uuid == c.uuid } # works
|
18
|
+
unless children.include?(c) # XXX doesn't work
|
19
|
+
children << c
|
20
|
+
save!
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should add children' do
|
27
|
+
a = T.find_or_create :name => 'a'
|
28
|
+
b = T.find_or_create :name => 'b'
|
29
|
+
|
30
|
+
a.children.size.should == 0
|
31
|
+
a.children.should_not include(b)
|
32
|
+
|
33
|
+
a.add_child b
|
34
|
+
|
35
|
+
a.children.size.should == 1
|
36
|
+
a.children.should include(b)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should not add child if exists' do
|
40
|
+
a = T.find_or_create :name => 'a'
|
41
|
+
b = T.find_or_create :name => 'b'
|
42
|
+
c = T.find_or_create :name => 'c'
|
43
|
+
|
44
|
+
a.add_child b
|
45
|
+
|
46
|
+
a.children.size.should == 1
|
47
|
+
a.children.should include(b)
|
48
|
+
|
49
|
+
a.add_child b
|
50
|
+
|
51
|
+
a.children.size.should == 1
|
52
|
+
a.children.should include(b)
|
53
|
+
|
54
|
+
|
55
|
+
b.add_child c
|
56
|
+
|
57
|
+
a.children.should include(b)
|
58
|
+
a.children.should_not include(b.extend(VersionedDocument))
|
59
|
+
|
60
|
+
b.children.should include(c)
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'should work with -' do
|
64
|
+
a = T.find_or_create :name => 'a'
|
65
|
+
b = T.find_or_create :name => 'b'
|
66
|
+
|
67
|
+
a.add_child b
|
68
|
+
|
69
|
+
a = T.find_or_create :name => 'a'
|
70
|
+
b = T.find_or_create :name => 'b'
|
71
|
+
|
72
|
+
([a, b] - [a, b]).should == []
|
73
|
+
#a.children.reject{|c| [b].include?(c) }.should == [] # old workaround
|
74
|
+
(a.children - [b]).should == []
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'should work after re-opening database' do
|
78
|
+
a = T.find_or_create :name => 'a'
|
79
|
+
b = T.find_or_create :name => 'b'
|
80
|
+
|
81
|
+
a.add_child b
|
82
|
+
|
83
|
+
StrokeDB.default_store.stop_autosync!
|
84
|
+
StrokeDB::Config.build :default => true, :base_path => @path
|
85
|
+
|
86
|
+
a = T.find_or_create :name => 'a'
|
87
|
+
b = T.find_or_create :name => 'b'
|
88
|
+
|
89
|
+
a.children.size.should == 1
|
90
|
+
#a.children.find{ |d| d.uuid == b.uuid }.should_not be_nil # old workaround
|
91
|
+
a.children.should include(b)
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe "Adding meta" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
setup_default_store
|
7
|
+
setup_index
|
8
|
+
Object.send!(:remove_const,'User') if defined?(User)
|
9
|
+
Object.send!(:remove_const,'Buyer') if defined?(Buyer)
|
10
|
+
User = StrokeDB::Meta.new
|
11
|
+
Buyer = StrokeDB::Meta.new
|
12
|
+
@user = User.create!
|
13
|
+
end
|
14
|
+
|
15
|
+
it "and saving document should not alter list of actual metas" do
|
16
|
+
@user.metas << Buyer
|
17
|
+
metas = @user[:meta].map{|v| v.to_raw }
|
18
|
+
@user.save!
|
19
|
+
@user[:meta].map{|v| v.to_raw }.should == metas
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe "Database sync" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@path = TEMP_STORAGES + '/database-sync'
|
7
|
+
FileUtils.rm_rf @path
|
8
|
+
build_config!
|
9
|
+
end
|
10
|
+
|
11
|
+
it "empty save test" do
|
12
|
+
M = Meta.new
|
13
|
+
save! # this save may cause problems
|
14
|
+
M.document
|
15
|
+
save!
|
16
|
+
|
17
|
+
uuid = M.document.uuid
|
18
|
+
|
19
|
+
# reload session
|
20
|
+
Object.send :remove_const, 'M'
|
21
|
+
build_config!
|
22
|
+
|
23
|
+
doc = StrokeDB.default_store.find(uuid)
|
24
|
+
doc.should_not be_nil
|
25
|
+
doc.uuid.should == uuid
|
26
|
+
end
|
27
|
+
|
28
|
+
def build_config!
|
29
|
+
StrokeDB::Config.build :default => true, :base_path => @path
|
30
|
+
end
|
31
|
+
|
32
|
+
def save!
|
33
|
+
StrokeDB.default_store.storage.sync_chained_storages!
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
$LOAD_PATH.unshift( File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) ).uniq!
|
2
|
+
require 'strokedb'
|
3
|
+
include StrokeDB
|
4
|
+
|
5
|
+
SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
|
6
|
+
TEMP_DIR = SPEC_ROOT + '/temp'
|
7
|
+
TEMP_STORAGES = TEMP_DIR + '/storages'
|
8
|
+
|
9
|
+
def setup_default_store(store=nil)
|
10
|
+
if store
|
11
|
+
StrokeDB.stub!(:default_store).and_return(store)
|
12
|
+
return store
|
13
|
+
end
|
14
|
+
@mem_storage = StrokeDB::MemoryStorage.new
|
15
|
+
@path = TEMP_STORAGES
|
16
|
+
FileUtils.rm_rf @path
|
17
|
+
StrokeDB.stub!(:default_store).and_return(StrokeDB::Store.new(:storage => @mem_storage,:index => @index,
|
18
|
+
:path => @path))
|
19
|
+
StrokeDB.default_store
|
20
|
+
end
|
21
|
+
|
22
|
+
def stub_meta_in_store(store=nil)
|
23
|
+
store ||= StrokeDB.default_store
|
24
|
+
meta = store.find(NIL_UUID)
|
25
|
+
store.should_receive(:find).with(NIL_UUID).any_number_of_times.and_return(meta)
|
26
|
+
store.should_receive(:include?).with(NIL_UUID).any_number_of_times.and_return(true)
|
27
|
+
end
|
28
|
+
|
29
|
+
def setup_index(store=nil)
|
30
|
+
store ||= StrokeDB.default_store
|
31
|
+
index_storage = StrokeDB::InvertedListFileStorage.new(:path => TEMP_STORAGES + '/inverted_list_storage')
|
32
|
+
index_storage.clear!
|
33
|
+
@index = StrokeDB::InvertedListIndex.new(index_storage)
|
34
|
+
@index.document_store = store
|
35
|
+
store.index_store = @index
|
36
|
+
@index
|
37
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
5
|
@@ -0,0 +1 @@
|
|
1
|
+
7c75a6de-e97e-47a6-97b9-42be5f62981c
|
@@ -0,0 +1 @@
|
|
1
|
+
2
|
@@ -0,0 +1 @@
|
|
1
|
+
1f447713-6090-4596-ad68-d6fc1473ddfd
|
@@ -0,0 +1 @@
|
|
1
|
+
{"base_path":"\/Users\/yrashk\/Development\/idbns\/strokedb\/spec\/temp\/storages\/database-sync"}
|
@@ -0,0 +1 @@
|
|
1
|
+
bdf675e5-8a7b-494e-97f2-f74a14ccd95d
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
{
|
Binary file
|
data/strokedb.gemspec
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
|
2
|
+
# Gem::Specification for Strokedb-0.0.2.2
|
3
|
+
# Originally generated by Echoe
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = %q{strokedb}
|
7
|
+
s.version = "0.0.2.2"
|
8
|
+
|
9
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.authors = ["Yurii Rashkovskii, Oleg Andreev"]
|
13
|
+
s.date = %q{2008-05-22}
|
14
|
+
s.default_executable = %q{strokedb}
|
15
|
+
s.description = %q{StrokeDB is an embeddable, distributed, document-based database written in Ruby. It is schema-free (allowing you to define any attribute on any object at any time), it scales infinitely, it even allows free versioning and integrates perfectly with Ruby applications.}
|
16
|
+
s.email = ["strokedb@googlegroups.com"]
|
17
|
+
s.executables = ["strokedb"]
|
18
|
+
s.extra_rdoc_files = ["bin/strokedb", "lib/strokedb/config.rb", "lib/strokedb/console.rb", "lib/strokedb/core_ext/blank.rb", "lib/strokedb/core_ext/enumerable.rb", "lib/strokedb/core_ext/fixnum.rb", "lib/strokedb/core_ext/float.rb", "lib/strokedb/core_ext/hash.rb", "lib/strokedb/core_ext/infinity.rb", "lib/strokedb/core_ext/kernel.rb", "lib/strokedb/core_ext/object.rb", "lib/strokedb/core_ext/string.rb", "lib/strokedb/core_ext/symbol.rb", "lib/strokedb/core_ext.rb", "lib/strokedb/data_structures/chunked_skiplist.rb", "lib/strokedb/data_structures/inverted_list.rb", "lib/strokedb/data_structures/point_query.rb", "lib/strokedb/data_structures/simple_skiplist.rb", "lib/strokedb/data_structures/skiplist.rb", "lib/strokedb/data_structures.rb", "lib/strokedb/document/callback.rb", "lib/strokedb/document/delete.rb", "lib/strokedb/document/dsl/associations.rb", "lib/strokedb/document/dsl/coercions.rb", "lib/strokedb/document/dsl/meta_dsl.rb", "lib/strokedb/document/dsl/validations.rb", "lib/strokedb/document/dsl/virtualize.rb", "lib/strokedb/document/dsl.rb", "lib/strokedb/document/meta.rb", "lib/strokedb/document/slot.rb", "lib/strokedb/document/util.rb", "lib/strokedb/document/versions.rb", "lib/strokedb/document.rb", "lib/strokedb/index.rb", "lib/strokedb/nsurl.rb", "lib/strokedb/store.rb", "lib/strokedb/stores/chainable_storage.rb", "lib/strokedb/stores/file_storage.rb", "lib/strokedb/stores/inverted_list_file_storage.rb", "lib/strokedb/stores/memory_storage.rb", "lib/strokedb/stores/remote_store.rb", "lib/strokedb/stores.rb", "lib/strokedb/sync/chain_sync.rb", "lib/strokedb/sync/diff/array.rb", "lib/strokedb/sync/diff/default.rb", "lib/strokedb/sync/diff/hash.rb", "lib/strokedb/sync/diff/string.rb", "lib/strokedb/sync/diff.rb", "lib/strokedb/sync/lamport_timestamp.rb", "lib/strokedb/sync/store_sync.rb", "lib/strokedb/sync.rb", "lib/strokedb/transaction.rb", "lib/strokedb/util/attach_dsl.rb", "lib/strokedb/util/blankslate.rb", "lib/strokedb/util/class_optimization.rb", "lib/strokedb/util/inflect.rb", "lib/strokedb/util/java_util.rb", "lib/strokedb/util/lazy_array.rb", "lib/strokedb/util/lazy_mapping_array.rb", "lib/strokedb/util/lazy_mapping_hash.rb", "lib/strokedb/util/serialization.rb", "lib/strokedb/util/uuid.rb", "lib/strokedb/util/xml.rb", "lib/strokedb/util.rb", "lib/strokedb/view.rb", "lib/strokedb/volumes/archive_volume.rb", "lib/strokedb/volumes/block_volume.rb", "lib/strokedb/volumes/distributed_pointer.rb", "lib/strokedb/volumes/fixed_length_skiplist_volume.rb", "lib/strokedb/volumes/map_volume.rb", "lib/strokedb/volumes.rb", "lib/strokedb.rb", "README"]
|
19
|
+
s.files = ["bench.html", "bin/strokedb", "examples/movies.rb", "examples/movies2.rb", "examples/strokewiki/README", "examples/strokewiki/view/edit.xhtml", "examples/strokewiki/view/new.xhtml", "examples/strokewiki/view/pages.xhtml", "examples/strokewiki/view/show.xhtml", "examples/strokewiki/view/versions.xhtml", "examples/strokewiki/wiki.rb", "examples/todo.rb", "lib/strokedb/config.rb", "lib/strokedb/console.rb", "lib/strokedb/core_ext/blank.rb", "lib/strokedb/core_ext/enumerable.rb", "lib/strokedb/core_ext/fixnum.rb", "lib/strokedb/core_ext/float.rb", "lib/strokedb/core_ext/hash.rb", "lib/strokedb/core_ext/infinity.rb", "lib/strokedb/core_ext/kernel.rb", "lib/strokedb/core_ext/object.rb", "lib/strokedb/core_ext/string.rb", "lib/strokedb/core_ext/symbol.rb", "lib/strokedb/core_ext.rb", "lib/strokedb/data_structures/chunked_skiplist.rb", "lib/strokedb/data_structures/inverted_list.rb", "lib/strokedb/data_structures/point_query.rb", "lib/strokedb/data_structures/simple_skiplist.rb", "lib/strokedb/data_structures/skiplist.rb", "lib/strokedb/data_structures.rb", "lib/strokedb/document/callback.rb", "lib/strokedb/document/delete.rb", "lib/strokedb/document/dsl/associations.rb", "lib/strokedb/document/dsl/coercions.rb", "lib/strokedb/document/dsl/meta_dsl.rb", "lib/strokedb/document/dsl/validations.rb", "lib/strokedb/document/dsl/virtualize.rb", "lib/strokedb/document/dsl.rb", "lib/strokedb/document/meta.rb", "lib/strokedb/document/slot.rb", "lib/strokedb/document/util.rb", "lib/strokedb/document/versions.rb", "lib/strokedb/document.rb", "lib/strokedb/index.rb", "lib/strokedb/nsurl.rb", "lib/strokedb/store.rb", "lib/strokedb/stores/chainable_storage.rb", "lib/strokedb/stores/file_storage.rb", "lib/strokedb/stores/inverted_list_file_storage.rb", "lib/strokedb/stores/memory_storage.rb", "lib/strokedb/stores/remote_store.rb", "lib/strokedb/stores.rb", "lib/strokedb/sync/chain_sync.rb", "lib/strokedb/sync/diff/array.rb", "lib/strokedb/sync/diff/default.rb", "lib/strokedb/sync/diff/hash.rb", "lib/strokedb/sync/diff/string.rb", "lib/strokedb/sync/diff.rb", "lib/strokedb/sync/lamport_timestamp.rb", "lib/strokedb/sync/store_sync.rb", "lib/strokedb/sync.rb", "lib/strokedb/transaction.rb", "lib/strokedb/util/attach_dsl.rb", "lib/strokedb/util/blankslate.rb", "lib/strokedb/util/class_optimization.rb", "lib/strokedb/util/inflect.rb", "lib/strokedb/util/java_util.rb", "lib/strokedb/util/lazy_array.rb", "lib/strokedb/util/lazy_mapping_array.rb", "lib/strokedb/util/lazy_mapping_hash.rb", "lib/strokedb/util/serialization.rb", "lib/strokedb/util/uuid.rb", "lib/strokedb/util/xml.rb", "lib/strokedb/util.rb", "lib/strokedb/view.rb", "lib/strokedb/volumes/archive_volume.rb", "lib/strokedb/volumes/block_volume.rb", "lib/strokedb/volumes/distributed_pointer.rb", "lib/strokedb/volumes/fixed_length_skiplist_volume.rb", "lib/strokedb/volumes/map_volume.rb", "lib/strokedb/volumes.rb", "lib/strokedb.rb", "README", "script/console", "spec/integration/remote_store_spec.rb", "spec/integration/search_spec.rb", "spec/integration/spec_helper.rb", "spec/lib/spec_helper.rb", "spec/lib/strokedb/config_spec.rb", "spec/lib/strokedb/core_ext/blank_spec.rb", "spec/lib/strokedb/core_ext/extract_spec.rb", "spec/lib/strokedb/core_ext/float_spec.rb", "spec/lib/strokedb/core_ext/infinity_spec.rb", "spec/lib/strokedb/core_ext/spec_helper.rb", "spec/lib/strokedb/core_ext/string_spec.rb", "spec/lib/strokedb/core_ext/symbol_spec.rb", "spec/lib/strokedb/data_structures/chunked_skiplist_spec.rb", "spec/lib/strokedb/data_structures/inverted_list_spec.rb", "spec/lib/strokedb/data_structures/simple_skiplist_spec.rb", "spec/lib/strokedb/data_structures/skiplist_spec.rb", "spec/lib/strokedb/data_structures/spec_helper.rb", "spec/lib/strokedb/document/associations_spec.rb", "spec/lib/strokedb/document/callbacks_spec.rb", "spec/lib/strokedb/document/coercions_spec.rb", "spec/lib/strokedb/document/document_spec.rb", "spec/lib/strokedb/document/meta_meta_spec.rb", "spec/lib/strokedb/document/meta_spec.rb", "spec/lib/strokedb/document/metaslot_spec.rb", "spec/lib/strokedb/document/slot_spec.rb", "spec/lib/strokedb/document/spec_helper.rb", "spec/lib/strokedb/document/validations_spec.rb", "spec/lib/strokedb/document/virtualize_spec.rb", "spec/lib/strokedb/nsurl_spec.rb", "spec/lib/strokedb/spec_helper.rb", "spec/lib/strokedb/stores/chained_storages_spec.rb", "spec/lib/strokedb/stores/spec_helper.rb", "spec/lib/strokedb/stores/store_spec.rb", "spec/lib/strokedb/stores/transaction_spec.rb", "spec/lib/strokedb/sync/chain_sync_spec.rb", "spec/lib/strokedb/sync/diff_spec.rb", "spec/lib/strokedb/sync/lamport_timestamp_spec.rb", "spec/lib/strokedb/sync/slot_diff_spec.rb", "spec/lib/strokedb/sync/spec_helper.rb", "spec/lib/strokedb/sync/store_sync_spec.rb", "spec/lib/strokedb/sync/stroke_diff/array_spec.rb", "spec/lib/strokedb/sync/stroke_diff/complex_spec.rb", "spec/lib/strokedb/sync/stroke_diff/hash_spec.rb", "spec/lib/strokedb/sync/stroke_diff/scalar_spec.rb", "spec/lib/strokedb/sync/stroke_diff/spec_helper.rb", "spec/lib/strokedb/sync/stroke_diff/string_spec.rb", "spec/lib/strokedb/util/attach_dsl_spec.rb", "spec/lib/strokedb/util/inflect_spec.rb", "spec/lib/strokedb/util/lazy_array_spec.rb", "spec/lib/strokedb/util/lazy_mapping_array_spec.rb", "spec/lib/strokedb/util/lazy_mapping_hash_spec.rb", "spec/lib/strokedb/util/spec_helper.rb", "spec/lib/strokedb/util/uuid_spec.rb", "spec/lib/strokedb/view_spec.rb", "spec/lib/strokedb/volumes/archive_volume_spec.rb", "spec/lib/strokedb/volumes/block_volume_spec.rb", "spec/lib/strokedb/volumes/distributed_pointer_spec.rb", "spec/lib/strokedb/volumes/fixed_length_skiplist_volume_spec.rb", "spec/lib/strokedb/volumes/map_volume_spec.rb", "spec/lib/strokedb/volumes/spec_helper.rb", "spec/regression/docref_spec.rb", "spec/regression/meta_spec.rb", "spec/regression/spec_helper.rb", "spec/regression/sync_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/temp/storages/database-sync/config", "spec/temp/storages/database-sync/file/bd/f6/bdf675e5-8a7b-494e-97f2-f74a14ccd95d.av", "spec/temp/storages/database-sync/file/LAST", "spec/temp/storages/database-sync/file/uindex.wal", "spec/temp/storages/database-sync/inverted_list_file/INVERTED_INDEX", "spec/temp/storages/database-sync/TIMESTAMP", "spec/temp/storages/database-sync/UUID", "spec/temp/storages/inverted_list_storage/INVERTED_INDEX", "spec/temp/storages/TIMESTAMP", "spec/temp/storages/UUID", "strokedb.gemspec", "task/benchmark.task", "task/ditz.task", "task/echoe.rb", "task/rcov.task", "task/rdoc.task", "task/rspec.task", "vendor/java_inline.rb", "vendor/rbmodexcl/mrimodexcl.rb", "vendor/rbmodexcl/rbmodexcl.rb", "vendor/rbmodexcl/rbxmodexcl.rb", "vendor/rbmodexcl/spec/unextend_spec.rb", "vendor/rbmodexcl/spec/uninclude_spec.rb", "meta/MANIFEST"]
|
20
|
+
s.has_rdoc = true
|
21
|
+
s.homepage = %q{http://strokedb.com}
|
22
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Strokedb", "--main", "README"]
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
s.rubyforge_project = %q{strokedb}
|
25
|
+
s.rubygems_version = %q{1.1.1}
|
26
|
+
s.summary = %q{embeddable, distributed, document-based database}
|
27
|
+
|
28
|
+
s.add_dependency(%q<diff-lcs>, [">= 0", "= 1.1.2"])
|
29
|
+
s.add_dependency(%q<uuidtools>, [">= 0", "= 1.0.3"])
|
30
|
+
s.add_dependency(%q<json>, [">= 0", "= 1.1.2"])
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
# # Original Rakefile source (requires the Echoe gem):
|
35
|
+
#
|
36
|
+
# require 'rake'; require 'rubygems'
|
37
|
+
#
|
38
|
+
# $:.unshift(File.dirname(__FILE__) + '/lib')
|
39
|
+
# require 'strokedb'; require 'core_ext'
|
40
|
+
#
|
41
|
+
# require 'task/echoe'
|
42
|
+
# Echoe.taskify do
|
43
|
+
# Dir['task/**/*.task'].each {|t| load t}
|
44
|
+
#
|
45
|
+
# namespace :echoe do
|
46
|
+
# Echoe.new('strokedb', StrokeDB::VERSION) do |g|
|
47
|
+
# g.author = ['Yurii Rashkovskii', 'Oleg Andreev']
|
48
|
+
# g.email = ['strokedb@googlegroups.com']
|
49
|
+
# g.summary = 'embeddable, distributed, document-based database'
|
50
|
+
# g.url = 'http://strokedb.com'
|
51
|
+
# g.description = <<-EOF
|
52
|
+
# StrokeDB is an embeddable, distributed, document-based database written in Ruby.
|
53
|
+
# It is schema-free (allowing you to define any attribute on any object at any
|
54
|
+
# time), it scales infinitely, it even allows free versioning and integrates
|
55
|
+
# perfectly with Ruby applications.
|
56
|
+
# EOF
|
57
|
+
#
|
58
|
+
# g.platform = Gem::Platform::RUBY
|
59
|
+
# g.dependencies = ['diff-lcs >= 1.1.2', 'uuidtools >= 1.0.3', 'json >= 1.1.2']
|
60
|
+
#
|
61
|
+
# g.manifest_name = 'meta/MANIFEST'
|
62
|
+
# g.ignore_pattern = /(^\.git|^.DS_Store$|^meta|^test\/storages|^examples\/(.*).strokedb|^bugs)/
|
63
|
+
# g.executable_pattern = 'bin/strokedb'
|
64
|
+
# end
|
65
|
+
#
|
66
|
+
# desc 'tests packaged files to ensure they are all present'
|
67
|
+
# task :verify => :package do
|
68
|
+
# # An error message will be displayed if files are missing
|
69
|
+
# if system %(ruby -e "require 'rubygems'; require 'pkg/strokedb-#{StrokeDB::VERSION}/strokedb'")
|
70
|
+
# puts "\nThe library files are present"
|
71
|
+
# end
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# desc 'Clean tree, update manifest, and install gem'
|
75
|
+
# task :magic => [:clean, :manifest, :install]
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# desc 'Check what\'s up in this mug'
|
79
|
+
# task :sup => [:'rcov:run', :'rcov:verify']
|
80
|
+
#
|
81
|
+
# # Developers: Run this before commiting!
|
82
|
+
# desc 'Check everything over before commiting!'
|
83
|
+
# task :aok => [:'rcov:verbose', :'rcov:strict', :'rcov:open',
|
84
|
+
# :'rdoc:html', :'rdoc:open',
|
85
|
+
# :'ditz:stage', :'ditz:html', :'ditz:todo', :'ditz:status', :'ditz:html:open']
|
86
|
+
# end
|
87
|
+
#
|
88
|
+
# # desc 'Run by CruiseControl.rb during continuous integration'
|
89
|
+
# task :cruise => [:'ditz:html', :'rdoc:html', :'rcov:bw', :'rcov:verify']
|
90
|
+
#
|
91
|
+
# # By default, we just list the tasks.
|
92
|
+
# task :default => :list
|
93
|
+
# task :list do
|
94
|
+
# system 'rake -T'
|
95
|
+
# end
|
96
|
+
#
|
97
|
+
#
|
98
|
+
# desc "Detects interfering spec group pairs. By Michael Klishin."
|
99
|
+
# task :interfers do
|
100
|
+
# file = ENV['SPECFILE']
|
101
|
+
#
|
102
|
+
# all_specs = Dir.glob(File.dirname(__FILE__) + "/spec/**/*_spec.rb") - [File.expand_path(file)]
|
103
|
+
# all_specs.each do |specfile|
|
104
|
+
# pair = "#{specfile} #{file}"
|
105
|
+
# output = `spec -c #{pair}`
|
106
|
+
#
|
107
|
+
# if output =~ /0\sfailures/
|
108
|
+
# print "."
|
109
|
+
# STDOUT.flush
|
110
|
+
# else
|
111
|
+
# puts "\n\nACHTUNG! Coupled spec groups detected! Fuck! Shit! You should have this fixed ASAP! AAAAA!!!"
|
112
|
+
# puts "spec -c #{pair}"
|
113
|
+
# puts "Run says \n\n"
|
114
|
+
# puts output
|
115
|
+
# end
|
116
|
+
# end
|
117
|
+
#
|
118
|
+
# puts
|
119
|
+
# puts
|
120
|
+
# end
|
data/task/benchmark.task
ADDED
data/task/ditz.task
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
namespace :ditz do
|
2
|
+
|
3
|
+
desc "Show current issue status overview"
|
4
|
+
task :status do
|
5
|
+
system 'ditz status'
|
6
|
+
end
|
7
|
+
desc "Show currently open issues"
|
8
|
+
task :todo do
|
9
|
+
system 'ditz todo'
|
10
|
+
end
|
11
|
+
desc "Show recent issue activity"
|
12
|
+
task :log do
|
13
|
+
system 'ditz log'
|
14
|
+
end
|
15
|
+
|
16
|
+
# desc "Generate issues to meta/issues"
|
17
|
+
task :html do
|
18
|
+
# `'d instead of system'd, because I don't want that output cluttering shit
|
19
|
+
`ditz html meta/issues`
|
20
|
+
end
|
21
|
+
# desc "Opens meta/issues in your main browser, if you are using a Macintosh"
|
22
|
+
task :'html:open' do
|
23
|
+
system 'open ' + :meta / :issues / 'index.html' if PLATFORM['darwin']
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "Stage all issues to git (to be run before commiting, or just use aok)"
|
27
|
+
task :stage do
|
28
|
+
system 'git-add bugs/*'
|
29
|
+
end
|
30
|
+
end
|
data/task/echoe.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
class Echoe
|
2
|
+
def self.taskify(&block)
|
3
|
+
|
4
|
+
begin
|
5
|
+
%w|echoe spec
|
6
|
+
spec/rake/spectask rake/rdoctask spec/rake/verify_rcov|.each {|d| require d}
|
7
|
+
|
8
|
+
yield block
|
9
|
+
|
10
|
+
rescue LoadError
|
11
|
+
puts "(You need to install the echoe and rspec gems if you wish to" +
|
12
|
+
" perform meta-gem operations, such as installing from source or" +
|
13
|
+
" running specs)"
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/task/rcov.task
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
namespace :rcov do
|
2
|
+
# Runs specs, runs rcov and textual summary
|
3
|
+
Spec::Rake::SpecTask.new(:bw) do |t|
|
4
|
+
t.spec_files = Dir['spec/**/*_spec.rb'].sort
|
5
|
+
t.libs = ['lib', 'server/lib' ]
|
6
|
+
t.rcov = true
|
7
|
+
# t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^app,^lib']
|
8
|
+
t.rcov_opts = ['--text-summary', '--exclude-only', '"spec\/,^\/"']
|
9
|
+
t.rcov_dir = :meta / :coverage
|
10
|
+
end
|
11
|
+
|
12
|
+
# Runs specs, runs rcov, with color and textual summary
|
13
|
+
Spec::Rake::SpecTask.new(:run) do |t|
|
14
|
+
t.spec_opts = ["--colour"]
|
15
|
+
t.spec_files = Dir['spec/**/*_spec.rb'].sort
|
16
|
+
t.libs = ['lib', 'server/lib' ]
|
17
|
+
t.rcov = true
|
18
|
+
# t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^app,^lib']
|
19
|
+
t.rcov_opts = ['--text-summary', '--exclude-only', '"spec\/,^\/"']
|
20
|
+
t.rcov_dir = :meta / :coverage
|
21
|
+
end
|
22
|
+
|
23
|
+
# Runs verbose specs, runs rcov, with color and textual summary
|
24
|
+
Spec::Rake::SpecTask.new(:verbose) do |t|
|
25
|
+
t.spec_opts = ["--format", "specdoc", "--colour"]
|
26
|
+
t.spec_files = Dir['spec/**/*_spec.rb'].sort
|
27
|
+
t.libs = ['lib', 'server/lib' ]
|
28
|
+
t.rcov = true
|
29
|
+
# t.rcov_opts = ['--exclude-only', '".*"', '--include-file', '^app,^lib']
|
30
|
+
t.rcov_opts = ['--text-summary', '--exclude-only', '"spec\/,^\/"']
|
31
|
+
t.rcov_dir = :meta / :coverage
|
32
|
+
end
|
33
|
+
|
34
|
+
# Verify coverage
|
35
|
+
RCov::VerifyTask.new(:verify) do |t|
|
36
|
+
t.threshold = StrokeDB::COVERAGE
|
37
|
+
t.index_html = :meta / :coverage / 'index.html'
|
38
|
+
t.require_exact_threshold = false
|
39
|
+
end
|
40
|
+
|
41
|
+
# Verify coverage, strictly
|
42
|
+
RCov::VerifyTask.new(:strict) do |t|
|
43
|
+
t.threshold = StrokeDB::COVERAGE
|
44
|
+
t.index_html = :meta / :coverage / 'index.html'
|
45
|
+
end
|
46
|
+
|
47
|
+
task :open do
|
48
|
+
system 'open ' + :meta / :coverage / 'index.html' if PLATFORM['darwin']
|
49
|
+
end
|
50
|
+
end
|