noodall-core 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
data/lib/noodall/site.rb CHANGED
@@ -5,6 +5,7 @@ module Noodall
5
5
  attr_accessor :map, :permalinks
6
6
 
7
7
  def build!
8
+ return false unless map.is_a?(Hash)
8
9
  map.each do |permalink, attributes|
9
10
  build_node(permalink, attributes)
10
11
  end
@@ -12,6 +13,7 @@ module Noodall
12
13
 
13
14
  def contains?(permalink)
14
15
  self.permalinks ||= []
16
+ return false unless map.is_a?(Hash)
15
17
  return true if map.keys.include?(permalink)
16
18
  map.values.each do |attrubutes|
17
19
  extract_permalinks(attrubutes)
data/noodall-core.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{noodall-core}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
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"]
data/spec/node_spec.rb CHANGED
@@ -261,10 +261,10 @@ describe Noodall::Node do
261
261
  it "shold allow groups to be set by strings for easy form access" do
262
262
  node = Factory(:page)
263
263
  node.destroyable_groups_list = 'Webbies, Dudes,Things, Dudes, ,'
264
- node.destroyable_groups.should == ['Webbies', 'Dudes', 'Things']
264
+ node.destroyable_groups.should == ['webbies', 'dudes', 'things']
265
265
 
266
266
  node = Factory(:page, :destroyable_groups_list => 'Webbies, Dudes,Things, Dudes, ,')
267
- node.destroyable_groups.should == ['Webbies', 'Dudes', 'Things']
267
+ node.destroyable_groups.should == ['webbies', 'dudes', 'things']
268
268
  end
269
269
 
270
270
  it "should restrict user accces by groups" do
@@ -44,4 +44,10 @@ describe Noodall::Site do
44
44
  Noodall::Site.contains?('wout').should == false
45
45
  Home.first.in_site_map?.should == true
46
46
  end
47
+
48
+ it 'should not fail if site map is empty' do
49
+ Noodall::Site.map = nil
50
+ Noodall::Site.build!
51
+ Noodall::Site.contains?('about').should == false
52
+ end
47
53
  end
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 2
10
- version: 0.4.2
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve England