glebtv-mongoid_nested_set 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gitignore +44 -0
- data/.rspec +1 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +147 -0
- data/Rakefile +1 -0
- data/glebtv-mongoid_nested_set.gemspec +29 -0
- data/lib/glebtv-mongoid_nested_set.rb +1 -0
- data/lib/mongoid_nested_set/base.rb +90 -0
- data/lib/mongoid_nested_set/document.rb +238 -0
- data/lib/mongoid_nested_set/fields.rb +60 -0
- data/lib/mongoid_nested_set/outline_number.rb +122 -0
- data/lib/mongoid_nested_set/rebuild.rb +40 -0
- data/lib/mongoid_nested_set/relations.rb +100 -0
- data/lib/mongoid_nested_set/remove_order_by.rb +15 -0
- data/lib/mongoid_nested_set/update.rb +230 -0
- data/lib/mongoid_nested_set/validation.rb +59 -0
- data/lib/mongoid_nested_set/version.rb +3 -0
- data/lib/mongoid_nested_set.rb +40 -0
- data/spec/matchers/nestedset_pos.rb +46 -0
- data/spec/models/circle_node.rb +4 -0
- data/spec/models/node.rb +10 -0
- data/spec/models/node_without_nested_set.rb +6 -0
- data/spec/models/numbering_node.rb +10 -0
- data/spec/models/renamed_fields.rb +7 -0
- data/spec/models/shape_node.rb +18 -0
- data/spec/models/square_node.rb +4 -0
- data/spec/models/test_document.rb +36 -0
- data/spec/models/unscoped_node.rb +9 -0
- data/spec/mongoid_nested_set_spec.rb +786 -0
- data/spec/spec_helper.rb +43 -0
- metadata +147 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'rr'
|
5
|
+
require 'mongoid'
|
6
|
+
require 'mongoid_nested_set'
|
7
|
+
require 'remarkable/mongoid'
|
8
|
+
|
9
|
+
if ENV['COVERAGE'] == 'yes'
|
10
|
+
require 'simplecov'
|
11
|
+
require 'simplecov-rcov'
|
12
|
+
|
13
|
+
class SimpleCov::Formatter::MergedFormatter
|
14
|
+
def format(result)
|
15
|
+
SimpleCov::Formatter::HTMLFormatter.new.format(result)
|
16
|
+
SimpleCov::Formatter::RcovFormatter.new.format(result)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
|
21
|
+
SimpleCov.start
|
22
|
+
end
|
23
|
+
|
24
|
+
module Mongoid::Acts::NestedSet::Matchers
|
25
|
+
end
|
26
|
+
|
27
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
28
|
+
Dir["#{File.dirname(__FILE__)}/models/*.rb"].each {|file| require file }
|
29
|
+
Dir["#{File.dirname(__FILE__)}/matchers/*.rb"].each {|file| require file }
|
30
|
+
|
31
|
+
Mongoid.configure do |config|
|
32
|
+
config.connect_to("mongoid_nested_set_test")
|
33
|
+
config.allow_dynamic_fields = false
|
34
|
+
end
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.mock_with :rr
|
38
|
+
config.include(Mongoid::Acts::NestedSet::Matchers)
|
39
|
+
|
40
|
+
config.after(:each) do
|
41
|
+
Mongoid::Config.purge!
|
42
|
+
end
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: glebtv-mongoid_nested_set
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- GlebTV
|
8
|
+
- Brandon Turner
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: mongoid
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 3.0.0
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 3.0.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rspec
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.7.0
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 2.7.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: bundler
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.0.21
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.0.21
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: simplecov
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: simplecov-rcov
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
description: Fully featured tree implementation for Mongoid using the nested set model
|
85
|
+
email:
|
86
|
+
- bt@brandonturner.net
|
87
|
+
executables: []
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- .document
|
92
|
+
- .gitignore
|
93
|
+
- .rspec
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.markdown
|
97
|
+
- Rakefile
|
98
|
+
- glebtv-mongoid_nested_set.gemspec
|
99
|
+
- lib/glebtv-mongoid_nested_set.rb
|
100
|
+
- lib/mongoid_nested_set.rb
|
101
|
+
- lib/mongoid_nested_set/base.rb
|
102
|
+
- lib/mongoid_nested_set/document.rb
|
103
|
+
- lib/mongoid_nested_set/fields.rb
|
104
|
+
- lib/mongoid_nested_set/outline_number.rb
|
105
|
+
- lib/mongoid_nested_set/rebuild.rb
|
106
|
+
- lib/mongoid_nested_set/relations.rb
|
107
|
+
- lib/mongoid_nested_set/remove_order_by.rb
|
108
|
+
- lib/mongoid_nested_set/update.rb
|
109
|
+
- lib/mongoid_nested_set/validation.rb
|
110
|
+
- lib/mongoid_nested_set/version.rb
|
111
|
+
- spec/matchers/nestedset_pos.rb
|
112
|
+
- spec/models/circle_node.rb
|
113
|
+
- spec/models/node.rb
|
114
|
+
- spec/models/node_without_nested_set.rb
|
115
|
+
- spec/models/numbering_node.rb
|
116
|
+
- spec/models/renamed_fields.rb
|
117
|
+
- spec/models/shape_node.rb
|
118
|
+
- spec/models/square_node.rb
|
119
|
+
- spec/models/test_document.rb
|
120
|
+
- spec/models/unscoped_node.rb
|
121
|
+
- spec/mongoid_nested_set_spec.rb
|
122
|
+
- spec/spec_helper.rb
|
123
|
+
homepage: http://github.com/55ideas/mongoid_nested_set
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubyforge_project: mongoid_nested_set
|
143
|
+
rubygems_version: 2.0.3
|
144
|
+
signing_key:
|
145
|
+
specification_version: 4
|
146
|
+
summary: Nested set based tree implementation for Mongoid
|
147
|
+
test_files: []
|