noodall-core 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +7 -7
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/noodall/node.rb +3 -2
- data/noodall-core.gemspec +5 -5
- data/spec/node_spec.rb +13 -13
- metadata +8 -8
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
gem 'mongo_mapper', '~> 0.8.6'
|
4
4
|
gem 'ramdiv-mongo_mapper_acts_as_tree', '~> 0.1.1'
|
5
|
-
gem 'mm-multi-parameter-attributes', '0.1.
|
5
|
+
gem 'mm-multi-parameter-attributes', '~> 0.1.1'
|
6
6
|
gem 'canable', '~> 0.1.1'
|
7
7
|
gem 'ruby-stemmer'
|
8
8
|
gem 'i18n'
|
data/Gemfile.lock
CHANGED
@@ -2,8 +2,8 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
4
|
activesupport (3.0.3)
|
5
|
-
bson (1.1.
|
6
|
-
bson_ext (1.1.
|
5
|
+
bson (1.1.5)
|
6
|
+
bson_ext (1.1.5)
|
7
7
|
canable (0.1.1)
|
8
8
|
database_cleaner (0.5.2)
|
9
9
|
diff-lcs (1.1.2)
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
faker (0.3.1)
|
12
12
|
gemcutter (0.6.1)
|
13
13
|
git (1.2.5)
|
14
|
-
i18n (0.
|
14
|
+
i18n (0.5.0)
|
15
15
|
jeweler (1.4.0)
|
16
16
|
gemcutter (>= 0.1.0)
|
17
17
|
git (>= 1.2.5)
|
@@ -19,10 +19,10 @@ GEM
|
|
19
19
|
jnunemaker-validatable (1.8.4)
|
20
20
|
activesupport (>= 2.3.4)
|
21
21
|
json_pure (1.4.6)
|
22
|
-
mm-multi-parameter-attributes (0.1.
|
22
|
+
mm-multi-parameter-attributes (0.1.1)
|
23
23
|
mongo_mapper
|
24
|
-
mongo (1.1.
|
25
|
-
bson (>= 1.1.
|
24
|
+
mongo (1.1.5)
|
25
|
+
bson (>= 1.1.5)
|
26
26
|
mongo_mapper (0.8.6)
|
27
27
|
activesupport (>= 2.3.4)
|
28
28
|
jnunemaker-validatable (~> 1.8.4)
|
@@ -57,7 +57,7 @@ DEPENDENCIES
|
|
57
57
|
faker (~> 0.3.1)
|
58
58
|
i18n
|
59
59
|
jeweler (~> 1.4.0)
|
60
|
-
mm-multi-parameter-attributes (
|
60
|
+
mm-multi-parameter-attributes (~> 0.1.1)
|
61
61
|
mongo_mapper (~> 0.8.6)
|
62
62
|
rake
|
63
63
|
ramdiv-mongo_mapper_acts_as_tree (~> 0.1.1)
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ begin
|
|
13
13
|
gem.authors = ["Steve England"]
|
14
14
|
gem.add_dependency('mongo_mapper', '~> 0.8.6')
|
15
15
|
gem.add_dependency('ramdiv-mongo_mapper_acts_as_tree', '~> 0.1.1')
|
16
|
-
gem.add_dependency('mm-multi-parameter-attributes', '
|
16
|
+
gem.add_dependency('mm-multi-parameter-attributes', '~> 0.1.1')
|
17
17
|
gem.add_dependency('canable', '0.1.1')
|
18
18
|
gem.add_dependency('ruby-stemmer')
|
19
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.12
|
data/lib/noodall/node.rb
CHANGED
@@ -21,6 +21,7 @@ module Noodall
|
|
21
21
|
key :updatable_groups, Array
|
22
22
|
key :destroyable_groups, Array
|
23
23
|
key :publishable_groups, Array
|
24
|
+
key :viewable_groups, Array
|
24
25
|
key :permalink, Permalink, :required => true, :index => true
|
25
26
|
|
26
27
|
timestamps!
|
@@ -125,10 +126,10 @@ module Noodall
|
|
125
126
|
|
126
127
|
## CANS
|
127
128
|
def all_groups
|
128
|
-
updatable_groups | destroyable_groups | publishable_groups
|
129
|
+
updatable_groups | destroyable_groups | publishable_groups | viewable_groups
|
129
130
|
end
|
130
131
|
|
131
|
-
%w( updatable destroyable publishable ).each do |permission|
|
132
|
+
%w( updatable destroyable publishable viewable ).each do |permission|
|
132
133
|
define_method("#{permission}_by?") do |user|
|
133
134
|
user.admin? or send("#{permission}_groups").empty? or user.groups.any?{ |g| send("#{permission}_groups").include?(g) }
|
134
135
|
end
|
data/noodall-core.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{noodall-core}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.12"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Steve England"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-11}
|
13
13
|
s.description = %q{Core data objects for Noodall}
|
14
14
|
s.email = %q{steve@wearebeef.co.uk}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -59,20 +59,20 @@ Gem::Specification.new do |s|
|
|
59
59
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
60
60
|
s.add_runtime_dependency(%q<mongo_mapper>, ["~> 0.8.6"])
|
61
61
|
s.add_runtime_dependency(%q<ramdiv-mongo_mapper_acts_as_tree>, ["~> 0.1.1"])
|
62
|
-
s.add_runtime_dependency(%q<mm-multi-parameter-attributes>, ["
|
62
|
+
s.add_runtime_dependency(%q<mm-multi-parameter-attributes>, ["~> 0.1.1"])
|
63
63
|
s.add_runtime_dependency(%q<canable>, ["= 0.1.1"])
|
64
64
|
s.add_runtime_dependency(%q<ruby-stemmer>, [">= 0"])
|
65
65
|
else
|
66
66
|
s.add_dependency(%q<mongo_mapper>, ["~> 0.8.6"])
|
67
67
|
s.add_dependency(%q<ramdiv-mongo_mapper_acts_as_tree>, ["~> 0.1.1"])
|
68
|
-
s.add_dependency(%q<mm-multi-parameter-attributes>, ["
|
68
|
+
s.add_dependency(%q<mm-multi-parameter-attributes>, ["~> 0.1.1"])
|
69
69
|
s.add_dependency(%q<canable>, ["= 0.1.1"])
|
70
70
|
s.add_dependency(%q<ruby-stemmer>, [">= 0"])
|
71
71
|
end
|
72
72
|
else
|
73
73
|
s.add_dependency(%q<mongo_mapper>, ["~> 0.8.6"])
|
74
74
|
s.add_dependency(%q<ramdiv-mongo_mapper_acts_as_tree>, ["~> 0.1.1"])
|
75
|
-
s.add_dependency(%q<mm-multi-parameter-attributes>, ["
|
75
|
+
s.add_dependency(%q<mm-multi-parameter-attributes>, ["~> 0.1.1"])
|
76
76
|
s.add_dependency(%q<canable>, ["= 0.1.1"])
|
77
77
|
s.add_dependency(%q<ruby-stemmer>, [">= 0"])
|
78
78
|
end
|
data/spec/node_spec.rb
CHANGED
@@ -281,9 +281,9 @@ describe Noodall::Node do
|
|
281
281
|
john = User.create!(:name => 'John', :groups => ['Webbies','Blokes'])
|
282
282
|
steve = User.create!(:name => 'Steve', :groups => ['Dudes'])
|
283
283
|
|
284
|
-
ruby = Factory(:page, :updatable_groups => ['Dudes'], :destroyable_groups => ['Webbies', 'Dudes'], :publishable_groups => ['Dudes'] )
|
284
|
+
ruby = Factory(:page, :updatable_groups => ['Dudes'], :destroyable_groups => ['Webbies', 'Dudes'], :publishable_groups => ['Dudes'], :viewable_groups => ['Blokes'] )
|
285
285
|
|
286
|
-
ruby.all_groups.should have(
|
286
|
+
ruby.all_groups.should have(3).things
|
287
287
|
|
288
288
|
john.can_create?(ruby).should == true
|
289
289
|
steve.can_create?(ruby).should == true
|
@@ -292,7 +292,7 @@ describe Noodall::Node do
|
|
292
292
|
ruby.save
|
293
293
|
|
294
294
|
john.can_view?(ruby).should == true
|
295
|
-
steve.can_view?(ruby).should ==
|
295
|
+
steve.can_view?(ruby).should == false
|
296
296
|
|
297
297
|
john.can_update?(ruby).should == false
|
298
298
|
steve.can_update?(ruby).should == true
|
@@ -329,24 +329,24 @@ describe Noodall::Node do
|
|
329
329
|
|
330
330
|
results.should have(0).things
|
331
331
|
end
|
332
|
-
|
332
|
+
|
333
333
|
describe "creating keywords" do
|
334
|
-
|
334
|
+
|
335
335
|
it "should create keywords" do
|
336
336
|
page = Factory(:page, :title => "I like to teach")
|
337
337
|
page._keywords.should include("teach")
|
338
|
-
|
338
|
+
|
339
339
|
page = Factory(:page, :title => "I am going to be teaching")
|
340
340
|
page._keywords.should include("teach")
|
341
|
-
|
341
|
+
|
342
342
|
page = Factory(:page, :title => "The way he teaches is terrible")
|
343
343
|
page._keywords.should include("teach")
|
344
344
|
end
|
345
|
-
|
345
|
+
|
346
346
|
end
|
347
|
-
|
347
|
+
|
348
348
|
describe "stemmed searching" do
|
349
|
-
|
349
|
+
|
350
350
|
before(:each) do
|
351
351
|
Factory(:page, :title => "I like to teach")
|
352
352
|
Factory(:page, :title => "I like teaching")
|
@@ -354,14 +354,14 @@ describe Noodall::Node do
|
|
354
354
|
Factory(:page, :title => "I like the moon")
|
355
355
|
Factory(:page, :title => "I like cheese")
|
356
356
|
end
|
357
|
-
|
357
|
+
|
358
358
|
it "should return stemmed matches" do
|
359
359
|
results = Page.search("teaching")
|
360
360
|
results.should have(3).things
|
361
361
|
end
|
362
|
-
|
362
|
+
|
363
363
|
end
|
364
|
-
|
364
|
+
|
365
365
|
it "should return related" do
|
366
366
|
Factory(:page, :title => "My Page 1", :tag_list => 'one,two,three')
|
367
367
|
Factory(:page, :title => "My Page 2", :tag_list => 'two,three,four')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noodall-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 12
|
10
|
+
version: 0.3.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-11 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -54,14 +54,14 @@ dependencies:
|
|
54
54
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
55
55
|
none: false
|
56
56
|
requirements:
|
57
|
-
- -
|
57
|
+
- - ~>
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
hash:
|
59
|
+
hash: 25
|
60
60
|
segments:
|
61
61
|
- 0
|
62
62
|
- 1
|
63
|
-
-
|
64
|
-
version: 0.1.
|
63
|
+
- 1
|
64
|
+
version: 0.1.1
|
65
65
|
requirement: *id003
|
66
66
|
prerelease: false
|
67
67
|
name: mm-multi-parameter-attributes
|