simple-navigation 2.7.2 → 2.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *2.7.3
2
+
3
+ * initializing SimpleNavigation.config_file_path with empty array (was nil before). Allows for adding paths before gem has been initialized.
4
+
1
5
  *2.7.2
2
6
 
3
7
  * added ability to have more than one config_file_path (useful if simple-navigation is used as a part of another gem/plugin). Credits to Luke Imhoff.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 3
2
3
  :major: 2
3
4
  :minor: 7
4
- :patch: 2
@@ -19,6 +19,7 @@ module SimpleNavigation
19
19
  mattr_accessor :config_files, :config_file_paths, :default_renderer, :controller, :template, :explicit_current_navigation, :rails_env, :rails_root, :registered_renderers
20
20
 
21
21
  self.config_files = {}
22
+ self.config_file_paths = []
22
23
  self.registered_renderers = {
23
24
  :list => SimpleNavigation::Renderer::List,
24
25
  :links => SimpleNavigation::Renderer::Links,
@@ -30,7 +31,7 @@ module SimpleNavigation
30
31
 
31
32
  # Sets the config file path and installs the ControllerMethods in ActionController::Base.
32
33
  def init_rails
33
- SimpleNavigation.config_file_paths ||= [SimpleNavigation.default_config_file_path]
34
+ SimpleNavigation.config_file_paths << SimpleNavigation.default_config_file_path
34
35
  ActionController::Base.send(:include, SimpleNavigation::ControllerMethods)
35
36
  end
36
37
 
@@ -1,16 +1,7 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe SimpleNavigation do
4
-
5
- describe 'config_files' do
6
- before(:each) do
7
- SimpleNavigation.config_files = {}
8
- end
9
- it "should be an empty hash after loading the module" do
10
- SimpleNavigation.config_files.should == {}
11
- end
12
- end
13
-
4
+
14
5
  describe 'config_file_name' do
15
6
  context 'for :default navigation_context' do
16
7
  it "should return the name of the default config file" do
@@ -188,6 +179,7 @@ describe SimpleNavigation do
188
179
 
189
180
  describe 'self.init_rails' do
190
181
  before(:each) do
182
+ SimpleNavigation.config_file_paths = []
191
183
  SimpleNavigation.stub!(:default_config_file_path => 'default_path')
192
184
  ActionController::Base.stub!(:include)
193
185
  end
@@ -195,15 +187,12 @@ describe SimpleNavigation do
195
187
  before(:each) do
196
188
  SimpleNavigation.config_file_path = 'my_path'
197
189
  end
198
- it "should not override the config_file_path" do
190
+ it "should have both the default_path and the new path" do
199
191
  SimpleNavigation.init_rails
200
- SimpleNavigation.config_file_paths.should == ['my_path']
192
+ SimpleNavigation.config_file_paths.should == ['my_path', 'default_path']
201
193
  end
202
194
  end
203
195
  context 'SimpleNavigation.config_file_paths are not set' do
204
- before(:each) do
205
- SimpleNavigation.config_file_paths = nil
206
- end
207
196
  it "should set the config_file_path to the default" do
208
197
  SimpleNavigation.init_rails
209
198
  SimpleNavigation.config_file_paths.should == ['default_path']
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-navigation
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 7
9
- - 2
10
- version: 2.7.2
9
+ - 3
10
+ version: 2.7.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andi Schacke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-20 00:00:00 +02:00
18
+ date: 2010-08-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency