simple-navigation 3.14.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +10 -2
  5. data/CHANGELOG.md +400 -0
  6. data/Guardfile +4 -2
  7. data/README.md +1 -1
  8. data/gemfiles/.bundle/config +2 -0
  9. data/gemfiles/rails-3-2-stable.gemfile +10 -0
  10. data/gemfiles/rails-4-1-stable.gemfile +6 -0
  11. data/gemfiles/rails-4-2-stable.gemfile +7 -0
  12. data/generators/navigation_config/navigation_config_generator.rb +0 -1
  13. data/generators/navigation_config/templates/config/navigation.rb +18 -15
  14. data/lib/simple_navigation.rb +25 -42
  15. data/lib/simple_navigation/adapters/rails.rb +1 -24
  16. data/lib/simple_navigation/adapters/sinatra.rb +2 -11
  17. data/lib/simple_navigation/config_file.rb +36 -0
  18. data/lib/simple_navigation/config_file_finder.rb +42 -0
  19. data/lib/simple_navigation/{core/configuration.rb → configuration.rb} +7 -1
  20. data/lib/simple_navigation/{rendering/helpers.rb → helpers.rb} +0 -4
  21. data/lib/simple_navigation/{core/item.rb → item.rb} +76 -85
  22. data/lib/simple_navigation/{core/item_adapter.rb → item_adapter.rb} +3 -17
  23. data/lib/simple_navigation/{core/item_container.rb → item_container.rb} +23 -14
  24. data/lib/simple_navigation/{core/items_provider.rb → items_provider.rb} +0 -0
  25. data/lib/simple_navigation/railtie.rb +7 -0
  26. data/lib/simple_navigation/renderer.rb +12 -0
  27. data/lib/simple_navigation/{rendering/renderer → renderer}/base.rb +1 -1
  28. data/lib/simple_navigation/{rendering/renderer → renderer}/breadcrumbs.rb +0 -0
  29. data/lib/simple_navigation/{rendering/renderer → renderer}/json.rb +2 -0
  30. data/lib/simple_navigation/{rendering/renderer → renderer}/links.rb +0 -0
  31. data/lib/simple_navigation/{rendering/renderer → renderer}/list.rb +0 -0
  32. data/lib/simple_navigation/{rendering/renderer → renderer}/text.rb +0 -0
  33. data/lib/simple_navigation/version.rb +1 -1
  34. data/simple-navigation.gemspec +5 -4
  35. data/spec/fake_app/config/navigation.rb +6 -0
  36. data/spec/fake_app/rails_app.rb +35 -0
  37. data/spec/initializers/coveralls.rb +3 -0
  38. data/spec/initializers/have_css_matcher.rb +8 -3
  39. data/spec/initializers/memfs.rb +7 -0
  40. data/spec/initializers/rails.rb +4 -0
  41. data/spec/initializers/rspec.rb +7 -0
  42. data/spec/integration/rendering_navigation_spec.rb +12 -0
  43. data/spec/{lib/simple_navigation → simple_navigation}/adapters/padrino_spec.rb +0 -2
  44. data/spec/{lib/simple_navigation → simple_navigation}/adapters/rails_spec.rb +36 -93
  45. data/spec/{lib/simple_navigation → simple_navigation}/adapters/sinatra_spec.rb +4 -6
  46. data/spec/simple_navigation/config_file_finder_spec.rb +50 -0
  47. data/spec/simple_navigation/config_file_spec.rb +25 -0
  48. data/spec/{lib/simple_navigation/core → simple_navigation}/configuration_spec.rb +29 -19
  49. data/spec/{lib/simple_navigation/rendering → simple_navigation}/helpers_spec.rb +10 -13
  50. data/spec/{lib/simple_navigation/core → simple_navigation}/item_adapter_spec.rb +14 -11
  51. data/spec/{lib/simple_navigation/core → simple_navigation}/item_container_spec.rb +130 -42
  52. data/spec/simple_navigation/item_spec.rb +467 -0
  53. data/spec/{lib/simple_navigation/core → simple_navigation}/items_provider_spec.rb +1 -3
  54. data/spec/{lib/simple_navigation/rendering → simple_navigation}/renderer/base_spec.rb +34 -36
  55. data/spec/{lib/simple_navigation/rendering → simple_navigation}/renderer/breadcrumbs_spec.rb +4 -7
  56. data/spec/{lib/simple_navigation/rendering → simple_navigation}/renderer/json_spec.rb +5 -11
  57. data/spec/{lib/simple_navigation/rendering → simple_navigation}/renderer/links_spec.rb +5 -8
  58. data/spec/{lib/simple_navigation/rendering → simple_navigation}/renderer/list_spec.rb +4 -7
  59. data/spec/{lib/simple_navigation/rendering → simple_navigation}/renderer/text_spec.rb +4 -7
  60. data/spec/simple_navigation_spec.rb +190 -0
  61. data/spec/spec_helper.rb +29 -35
  62. metadata +103 -68
  63. data/CHANGELOG +0 -292
  64. data/lib/simple_navigation/core.rb +0 -5
  65. data/lib/simple_navigation/rails_controller_methods.rb +0 -164
  66. data/lib/simple_navigation/rendering.rb +0 -12
  67. data/rails/init.rb +0 -1
  68. data/spec/lib/simple_navigation/core/item_spec.rb +0 -703
  69. data/spec/lib/simple_navigation/rails_controller_methods_spec.rb +0 -270
  70. data/spec/lib/simple_navigation_spec.rb +0 -300
data/spec/spec_helper.rb CHANGED
@@ -1,45 +1,39 @@
1
1
  require 'initializers/have_css_matcher'
2
- require 'action_controller'
3
- require 'coveralls'
4
- require 'html/document'
2
+ require 'initializers/memfs'
3
+ require 'initializers/coveralls'
4
+ require 'initializers/rails'
5
+ require 'initializers/rspec'
6
+ require 'capybara/rspec'
5
7
 
6
- Coveralls.wear!
8
+ require 'bundler/setup'
9
+ Bundler.require
7
10
 
8
- # FIXME: actualize to make it 4 by default
9
- unless defined? Rails
10
- module Rails
11
- module VERSION
12
- MAJOR = 2
13
- end
14
- end
15
- end
16
-
17
- RAILS_ROOT = './' unless defined?(RAILS_ROOT)
18
- RAILS_ENV = 'test' unless defined?(RAILS_ENV)
11
+ if defined? Rails
12
+ require 'fake_app/rails_app'
13
+ require 'rspec/rails'
19
14
 
20
- require 'simple_navigation'
15
+ Capybara.app = RailsApp::Application
21
16
 
22
- def setup_adapter_for(framework)
23
- adapter = case framework
24
- when :rails
25
- context = double(:context, view_context: ActionView::Base.new)
26
- SimpleNavigation::Adapters::Rails.new(context)
27
- end
28
- SimpleNavigation.stub(adapter: adapter)
29
- adapter
17
+ RSpec.configure do |config|
18
+ config.before do
19
+ SimpleNavigation.config_files.clear
20
+ setup_adapter_for :rails
21
+ end
22
+ end
30
23
  end
31
24
 
32
- def setup_renderer(renderer_class, options)
33
- renderer_class.new(options)
34
- end
25
+ def setup_adapter_for(framework, context = double(:context))
26
+ if framework == :rails
27
+ allow(context).to receive_messages(view_context: ActionView::Base.new)
28
+ end
35
29
 
36
- def primary_navigation
37
- # TODO
38
- primary_container
30
+ allow(SimpleNavigation).to receive_messages(framework: framework)
31
+ SimpleNavigation.load_adapter
32
+ SimpleNavigation.init_adapter_from(context)
39
33
  end
40
34
 
41
35
  def select_an_item(item)
42
- item.stub(selected?: true)
36
+ allow(item).to receive_messages(selected?: true)
43
37
  end
44
38
 
45
39
  def setup_container(dom_id, dom_class)
@@ -59,20 +53,20 @@ end
59
53
  # FIXME: adding the :link option for the list renderer messes up the other
60
54
  # renderers
61
55
  def setup_items(container)
62
- container.item :users, 'Users', '/users', id: 'users_id', link: { id: 'users_link_id' }
56
+ container.item :users, 'Users', '/users', html: { id: 'users_id' }, link_html: { id: 'users_link_id' }
63
57
  container.item :invoices, 'Invoices', '/invoices' do |invoices|
64
58
  invoices.item :paid, 'Paid', '/invoices/paid'
65
59
  invoices.item :unpaid, 'Unpaid', '/invoices/unpaid'
66
60
  end
67
- container.item :accounts, 'Accounts', '/accounts', style: 'float:right', link: { style: 'float:left' }
61
+ container.item :accounts, 'Accounts', '/accounts', html: { style: 'float:right' }
68
62
  container.item :miscellany, 'Miscellany'
69
63
 
70
64
  container.items.each do |item|
71
- item.stub(selected?: false, selected_by_condition?: false)
65
+ allow(item).to receive_messages(selected?: false, selected_by_condition?: false)
72
66
 
73
67
  if item.sub_navigation
74
68
  item.sub_navigation.items.each do |item|
75
- item.stub(selected?: false, selected_by_condition?: false)
69
+ allow(item).to receive_messages(selected?: false, selected_by_condition?: false)
76
70
  end
77
71
  end
78
72
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andi Schacke
8
8
  - Mark J. Titorenko
9
+ - Simon Courtois
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2015-01-19 00:00:00.000000000 Z
13
+ date: 2015-04-02 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activesupport
@@ -26,33 +27,33 @@ dependencies:
26
27
  - !ruby/object:Gem::Version
27
28
  version: 2.3.2
28
29
  - !ruby/object:Gem::Dependency
29
- name: actionpack
30
+ name: bundler
30
31
  requirement: !ruby/object:Gem::Requirement
31
32
  requirements:
32
- - - ">="
33
+ - - "~>"
33
34
  - !ruby/object:Gem::Version
34
- version: 2.3.2
35
+ version: '1.5'
35
36
  type: :development
36
37
  prerelease: false
37
38
  version_requirements: !ruby/object:Gem::Requirement
38
39
  requirements:
39
- - - ">="
40
+ - - "~>"
40
41
  - !ruby/object:Gem::Version
41
- version: 2.3.2
42
+ version: '1.5'
42
43
  - !ruby/object:Gem::Dependency
43
- name: bundler
44
+ name: capybara
44
45
  requirement: !ruby/object:Gem::Requirement
45
46
  requirements:
46
- - - "~>"
47
+ - - ">="
47
48
  - !ruby/object:Gem::Version
48
- version: '1.5'
49
+ version: '0'
49
50
  type: :development
50
51
  prerelease: false
51
52
  version_requirements: !ruby/object:Gem::Requirement
52
53
  requirements:
53
- - - "~>"
54
+ - - ">="
54
55
  - !ruby/object:Gem::Version
55
- version: '1.5'
56
+ version: '0'
56
57
  - !ruby/object:Gem::Dependency
57
58
  name: coveralls
58
59
  requirement: !ruby/object:Gem::Requirement
@@ -82,19 +83,19 @@ dependencies:
82
83
  - !ruby/object:Gem::Version
83
84
  version: '4.2'
84
85
  - !ruby/object:Gem::Dependency
85
- name: json_spec
86
+ name: memfs
86
87
  requirement: !ruby/object:Gem::Requirement
87
88
  requirements:
88
89
  - - "~>"
89
90
  - !ruby/object:Gem::Version
90
- version: '1.1'
91
+ version: 0.4.1
91
92
  type: :development
92
93
  prerelease: false
93
94
  version_requirements: !ruby/object:Gem::Requirement
94
95
  requirements:
95
96
  - - "~>"
96
97
  - !ruby/object:Gem::Version
97
- version: '1.1'
98
+ version: 0.4.1
98
99
  - !ruby/object:Gem::Dependency
99
100
  name: rake
100
101
  requirement: !ruby/object:Gem::Requirement
@@ -129,14 +130,28 @@ dependencies:
129
130
  requirements:
130
131
  - - "~>"
131
132
  - !ruby/object:Gem::Version
132
- version: '2.0'
133
+ version: '3.0'
133
134
  type: :development
134
135
  prerelease: false
135
136
  version_requirements: !ruby/object:Gem::Requirement
136
137
  requirements:
137
138
  - - "~>"
138
139
  - !ruby/object:Gem::Version
139
- version: '2.0'
140
+ version: '3.0'
141
+ - !ruby/object:Gem::Dependency
142
+ name: tzinfo
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
140
155
  description: With the simple-navigation gem installed you can easily create multilevel
141
156
  navigations for your Rails, Sinatra or Padrino applications. The navigation is defined
142
157
  in a single configuration file. It supports automatic as well as explicit highlighting
@@ -150,12 +165,16 @@ files:
150
165
  - ".gitignore"
151
166
  - ".rspec"
152
167
  - ".travis.yml"
153
- - CHANGELOG
168
+ - CHANGELOG.md
154
169
  - Gemfile
155
170
  - Guardfile
156
171
  - LICENSE
157
172
  - README.md
158
173
  - Rakefile
174
+ - gemfiles/.bundle/config
175
+ - gemfiles/rails-3-2-stable.gemfile
176
+ - gemfiles/rails-4-1-stable.gemfile
177
+ - gemfiles/rails-4-2-stable.gemfile
159
178
  - generators/navigation_config/USAGE
160
179
  - generators/navigation_config/navigation_config_generator.rb
161
180
  - generators/navigation_config/templates/config/navigation.rb
@@ -170,42 +189,50 @@ files:
170
189
  - lib/simple_navigation/adapters/padrino.rb
171
190
  - lib/simple_navigation/adapters/rails.rb
172
191
  - lib/simple_navigation/adapters/sinatra.rb
173
- - lib/simple_navigation/core.rb
174
- - lib/simple_navigation/core/configuration.rb
175
- - lib/simple_navigation/core/item.rb
176
- - lib/simple_navigation/core/item_adapter.rb
177
- - lib/simple_navigation/core/item_container.rb
178
- - lib/simple_navigation/core/items_provider.rb
179
- - lib/simple_navigation/rails_controller_methods.rb
180
- - lib/simple_navigation/rendering.rb
181
- - lib/simple_navigation/rendering/helpers.rb
182
- - lib/simple_navigation/rendering/renderer/base.rb
183
- - lib/simple_navigation/rendering/renderer/breadcrumbs.rb
184
- - lib/simple_navigation/rendering/renderer/json.rb
185
- - lib/simple_navigation/rendering/renderer/links.rb
186
- - lib/simple_navigation/rendering/renderer/list.rb
187
- - lib/simple_navigation/rendering/renderer/text.rb
192
+ - lib/simple_navigation/config_file.rb
193
+ - lib/simple_navigation/config_file_finder.rb
194
+ - lib/simple_navigation/configuration.rb
195
+ - lib/simple_navigation/helpers.rb
196
+ - lib/simple_navigation/item.rb
197
+ - lib/simple_navigation/item_adapter.rb
198
+ - lib/simple_navigation/item_container.rb
199
+ - lib/simple_navigation/items_provider.rb
200
+ - lib/simple_navigation/railtie.rb
201
+ - lib/simple_navigation/renderer.rb
202
+ - lib/simple_navigation/renderer/base.rb
203
+ - lib/simple_navigation/renderer/breadcrumbs.rb
204
+ - lib/simple_navigation/renderer/json.rb
205
+ - lib/simple_navigation/renderer/links.rb
206
+ - lib/simple_navigation/renderer/list.rb
207
+ - lib/simple_navigation/renderer/text.rb
188
208
  - lib/simple_navigation/version.rb
189
- - rails/init.rb
190
209
  - simple-navigation.gemspec
210
+ - spec/fake_app/config/navigation.rb
211
+ - spec/fake_app/rails_app.rb
212
+ - spec/initializers/coveralls.rb
191
213
  - spec/initializers/have_css_matcher.rb
192
- - spec/lib/simple_navigation/adapters/padrino_spec.rb
193
- - spec/lib/simple_navigation/adapters/rails_spec.rb
194
- - spec/lib/simple_navigation/adapters/sinatra_spec.rb
195
- - spec/lib/simple_navigation/core/configuration_spec.rb
196
- - spec/lib/simple_navigation/core/item_adapter_spec.rb
197
- - spec/lib/simple_navigation/core/item_container_spec.rb
198
- - spec/lib/simple_navigation/core/item_spec.rb
199
- - spec/lib/simple_navigation/core/items_provider_spec.rb
200
- - spec/lib/simple_navigation/rails_controller_methods_spec.rb
201
- - spec/lib/simple_navigation/rendering/helpers_spec.rb
202
- - spec/lib/simple_navigation/rendering/renderer/base_spec.rb
203
- - spec/lib/simple_navigation/rendering/renderer/breadcrumbs_spec.rb
204
- - spec/lib/simple_navigation/rendering/renderer/json_spec.rb
205
- - spec/lib/simple_navigation/rendering/renderer/links_spec.rb
206
- - spec/lib/simple_navigation/rendering/renderer/list_spec.rb
207
- - spec/lib/simple_navigation/rendering/renderer/text_spec.rb
208
- - spec/lib/simple_navigation_spec.rb
214
+ - spec/initializers/memfs.rb
215
+ - spec/initializers/rails.rb
216
+ - spec/initializers/rspec.rb
217
+ - spec/integration/rendering_navigation_spec.rb
218
+ - spec/simple_navigation/adapters/padrino_spec.rb
219
+ - spec/simple_navigation/adapters/rails_spec.rb
220
+ - spec/simple_navigation/adapters/sinatra_spec.rb
221
+ - spec/simple_navigation/config_file_finder_spec.rb
222
+ - spec/simple_navigation/config_file_spec.rb
223
+ - spec/simple_navigation/configuration_spec.rb
224
+ - spec/simple_navigation/helpers_spec.rb
225
+ - spec/simple_navigation/item_adapter_spec.rb
226
+ - spec/simple_navigation/item_container_spec.rb
227
+ - spec/simple_navigation/item_spec.rb
228
+ - spec/simple_navigation/items_provider_spec.rb
229
+ - spec/simple_navigation/renderer/base_spec.rb
230
+ - spec/simple_navigation/renderer/breadcrumbs_spec.rb
231
+ - spec/simple_navigation/renderer/json_spec.rb
232
+ - spec/simple_navigation/renderer/links_spec.rb
233
+ - spec/simple_navigation/renderer/list_spec.rb
234
+ - spec/simple_navigation/renderer/text_spec.rb
235
+ - spec/simple_navigation_spec.rb
209
236
  - spec/spec_helper.rb
210
237
  - uninstall.rb
211
238
  homepage: http://github.com/codeplant/simple-navigation
@@ -236,22 +263,30 @@ specification_version: 4
236
263
  summary: simple-navigation is a ruby library for creating navigations (with multiple
237
264
  levels) for your Rails2, Rails3, Rails4, Sinatra or Padrino application.
238
265
  test_files:
266
+ - spec/fake_app/config/navigation.rb
267
+ - spec/fake_app/rails_app.rb
268
+ - spec/initializers/coveralls.rb
239
269
  - spec/initializers/have_css_matcher.rb
240
- - spec/lib/simple_navigation/adapters/padrino_spec.rb
241
- - spec/lib/simple_navigation/adapters/rails_spec.rb
242
- - spec/lib/simple_navigation/adapters/sinatra_spec.rb
243
- - spec/lib/simple_navigation/core/configuration_spec.rb
244
- - spec/lib/simple_navigation/core/item_adapter_spec.rb
245
- - spec/lib/simple_navigation/core/item_container_spec.rb
246
- - spec/lib/simple_navigation/core/item_spec.rb
247
- - spec/lib/simple_navigation/core/items_provider_spec.rb
248
- - spec/lib/simple_navigation/rails_controller_methods_spec.rb
249
- - spec/lib/simple_navigation/rendering/helpers_spec.rb
250
- - spec/lib/simple_navigation/rendering/renderer/base_spec.rb
251
- - spec/lib/simple_navigation/rendering/renderer/breadcrumbs_spec.rb
252
- - spec/lib/simple_navigation/rendering/renderer/json_spec.rb
253
- - spec/lib/simple_navigation/rendering/renderer/links_spec.rb
254
- - spec/lib/simple_navigation/rendering/renderer/list_spec.rb
255
- - spec/lib/simple_navigation/rendering/renderer/text_spec.rb
256
- - spec/lib/simple_navigation_spec.rb
270
+ - spec/initializers/memfs.rb
271
+ - spec/initializers/rails.rb
272
+ - spec/initializers/rspec.rb
273
+ - spec/integration/rendering_navigation_spec.rb
274
+ - spec/simple_navigation/adapters/padrino_spec.rb
275
+ - spec/simple_navigation/adapters/rails_spec.rb
276
+ - spec/simple_navigation/adapters/sinatra_spec.rb
277
+ - spec/simple_navigation/config_file_finder_spec.rb
278
+ - spec/simple_navigation/config_file_spec.rb
279
+ - spec/simple_navigation/configuration_spec.rb
280
+ - spec/simple_navigation/helpers_spec.rb
281
+ - spec/simple_navigation/item_adapter_spec.rb
282
+ - spec/simple_navigation/item_container_spec.rb
283
+ - spec/simple_navigation/item_spec.rb
284
+ - spec/simple_navigation/items_provider_spec.rb
285
+ - spec/simple_navigation/renderer/base_spec.rb
286
+ - spec/simple_navigation/renderer/breadcrumbs_spec.rb
287
+ - spec/simple_navigation/renderer/json_spec.rb
288
+ - spec/simple_navigation/renderer/links_spec.rb
289
+ - spec/simple_navigation/renderer/list_spec.rb
290
+ - spec/simple_navigation/renderer/text_spec.rb
291
+ - spec/simple_navigation_spec.rb
257
292
  - spec/spec_helper.rb
data/CHANGELOG DELETED
@@ -1,292 +0,0 @@
1
- *3.14.0
2
-
3
- * renamed PADRINO_ENV to RACK_ENV for Padrino adapter. Thanks to Slava Ptsarev.
4
-
5
- *3.13.0
6
-
7
- * consider_item_names_as_safe is now false by default. Removed deprecation warning
8
-
9
- *3.12.2
10
-
11
- * Fixing issue #154. Thanks to Simon Curtois.
12
-
13
- *3.12.1
14
-
15
- * bugfix (error in generator)
16
-
17
- *3.12.0
18
-
19
- * Relax hash constraint on item_adapter. Thanks to Ramon Tayag.
20
- * Fixed hidden special character in navigation template. Credits to Stef Lewandowski
21
- * Added full MIT license text. Thanks to Ben Armstrong.
22
- * Added license to gemspec. Thanks to Troy Thompson.
23
- * Allow defining other html attributes than :id and :class on menu container. Credits to Jacek Tomaszewski.
24
- * Added new config option "consider_item_names_as_safe". Thanks to Alexey Naumov.
25
- * Big cleanup of specs, removed jeweler in favor of the "bundler" way. Huge thank you to Simon Courtois.
26
- * Added more powerful name generator which yields the item itself in addition to the item's name. Credits to Simon Curtois.
27
-
28
- *3.11.0
29
-
30
- * Added Json renderer. Thanks to Alberto Avila.
31
-
32
- *3.10.1
33
-
34
- * Padrino adapter now returns "html_safe"d content_tag
35
-
36
- *3.10.0
37
-
38
- * Added ability to set selected_class on container level. Credits to Joost Hietbrink.
39
- * do not highlight items that are only partial matches. Thanks to Troy Thompson.
40
- * adding support for rails 4. Credits to Samer Masry.
41
-
42
- *3.9.0
43
-
44
- * Added ability to pass a block to render_navigation for configuring dynamic navigation items (instead of passing :items). Credits to Ronald Chan.
45
-
46
- *3.8.0
47
-
48
- * Changed the way the context is fetched. Fixes incompatibility with Gretel. Thanks to Ivan Kasatenko.
49
- * Added :join_with option to links renderer. Thanks to Stefan Melmuk.
50
- * Added :prefix option to breadcrumb renderer. Credits to Rodrigo Manhães.
51
- * Added :ordered option for allowing list renderer to render an <ol> rather than a <ul>.
52
- * Sinatra adapter no longer renders attributes with nil values as attributes with empty strings in the output, instead electing not to render the attribute at all. Thanks to revdan for pointing this out.
53
-
54
- *3.7.0
55
-
56
- * Added new adapater for working with the Nanoc static site generation framework.
57
- * Fix issue #22 - last link in a breadcrumb trail may now be rendered as static text insted by supplying :static_leaf => true as an option
58
- * Allow breadcrumbs to be provided with link id and classes by supplying :allow_classes_and_ids => true as an option
59
-
60
- *3.6.0
61
-
62
- * Added linkless items functionality - the `url` parameter is now optional, items which aren't links will be rendered within a 'span' element rather than an 'a' element. `options` remain optional (defaults to an empty Hash). `options` may be provided without providing a `url` (detected by checking if the '`url`' parameter is a Hash or otherwise).
63
-
64
- *3.5.1
65
-
66
- * Fixed specs related to testing name_generator functionality - stub the name_generator method rather than calling it to ensure subsequent tests aren't affected.
67
-
68
- *3.5.0
69
-
70
- * Added (configurable) "simple-navigation-active-leaf" class to last selected element and elements that have :highlights_on return true. Thanks to Frank Schumacher (thenoseman).
71
-
72
- *3.4.2
73
-
74
- * Improve Gemfile dependencies with :development and :rails groups.
75
-
76
- *3.4.1
77
-
78
- * Rerelease using ruby-1.8.7 rather than ruby-1.9.2 in order that the rubygems.org gemspec is generated in a compatible fashion.
79
-
80
- *3.4.0
81
-
82
- * Added Gemfile for easier development with Bundler. Thanks to Josep Jaume.
83
- * modified :highlights_on option to accept a :subpath option (as well as Proc and Regexp forms). This can be used to automatically highlight an item even for items within a subpath. Thanks to Josep Jaume.
84
-
85
- *3.3.4
86
-
87
- * modified :highlights_on option to accept a Proc (as well as the existing Regexp form). This can be used to provide specific highlighting conditions inline. Thanks to superlou for sparking the idea for the concept.
88
-
89
- *3.3.3
90
-
91
- * Bugfix in Adapters::Sinatra#current_url? (compares unencoded URIs). Thanks to Matthew Gast.
92
-
93
- *3.3.2
94
-
95
- * The patch listed in 3.3.1 somehow did not make it into the gem... sorry. Re-releasing...
96
-
97
- *3.3.1
98
-
99
- * bugfix in sinatra adapter. Use Rack::Request#scheme instead of Rack::Request#protocol. Credits to Matthew Gast.
100
-
101
- *3.3.0
102
-
103
- * add a new method active_navigation_item_key which returns the symbol for the currently selected navigation item in a similar way to active_navigation_item_name does for the name (useful for CSS class styling for eg.)
104
- * open up the helper API to provide active_navigation_item and active_navigation_item_container methods to make it easy to access the items/containers should it be necessary (came for free with the above refactoring)
105
- * isolate the apply_defaults and load_config private methods from ActionController mixin leakage by refactoring to module class instance methods
106
- * addition of test coverage for the added helpers within helpers_spec.rb
107
- * inclusion of new helpers within the rails adapter and minor refactoring to DRY up the helper_method invocations
108
- * addition of test coverage for the newly included helpers
109
- * Credits to Mark J. Titorenko for all the changes in this release! Thanks.
110
-
111
- *3.2.0
112
-
113
- * Added Renderer::Text for rendering selected navigation items without markup (useful for dynamic page titles). Credits to Tim Cowlishaw.
114
- * Added ability to add custom markup around item names specifying a name_generator in the config file. Thanks to Jack Dempsey.
115
-
116
- *3.1.1
117
-
118
- * Item#selected_by_url? now strips anchors from the item's url before comparing it with the current request's url. Credits to opengovernment.
119
-
120
- *3.1.0
121
-
122
- * added new helper method 'active_navigation_item_name' to render the name of the currently active item
123
-
124
- *3.0.2
125
-
126
- * dom_id and dom_class can now be set as option in the item's definition (useful for dynamic menu items).
127
-
128
- *3.0.1
129
-
130
- * allow controller instance variables named @template for rails3 apps. Credits to cmartyn.
131
- * added possibility to specify and item's URL as a block which is evaulated after the :if and :unless conditions have been checked. Credits to Nicholas Firth-McCoy.
132
- * upgraded to rspec 2.0.0
133
- * fixed cgi error in sinatra adapter. Credits to Jack Dempsey.
134
-
135
- *3.0.0
136
-
137
- * added ability to specify dynamic items using an array of hashes. Credits to Anshul Khandelwal for input and discussion.
138
- * added ability to specify attributes for the generated link-tag in list renderer (up to now the attributes have been applied to the li-tag). Credits to Anthony Navarre for input and discussion.
139
-
140
- *3.0.0.beta2
141
-
142
- * moving code for initializing plugin in sinatra to separate gem
143
-
144
- *3.0.0.beta1
145
-
146
- * moving deprecated rails controller methods (navigation, current_navigation) to separate file 'rails_controller_methods'. Deprecations removed. File can be required explicitly if controller methods should be still available.
147
- * decoupling from Rails. Introducing the concept of adapters to work with several frameworks.
148
- * tested with Rails 3.0.0
149
- * adding support for Sinatra and Padrino frameworks.
150
- * cherry picking active_support stuff instead of requiring the whole bunch (tested with active_support >= 2.3.2 and 3.0.0)
151
- * created public sample project which includes demo for Rails2, Rails3, Sinatra and Padrino (will be available on github soon)
152
- * better src file organization (adapters/core/rendering folders)
153
-
154
- *2.7.3
155
-
156
- * initializing SimpleNavigation.config_file_path with empty array (was nil before). Allows for adding paths before gem has been initialized.
157
-
158
- *2.7.2
159
-
160
- * 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.
161
-
162
- *2.7.1
163
-
164
- * added SimpleNavigation.request and SimpleNavigation.request_uri as abstraction for getting request_uri (rails2/rails3)
165
- * use request.fullpath instead of request.request_uri for Rails3. Credits to Ben Langfeld.
166
-
167
- *2.7.0
168
-
169
- * added new option :highlights_on to item definition in config-file. Specify a regexp which is matched against the current_uri to determine if an item is active or not. Replaces explicit highlighting in controllers.
170
- * deprecated explicit highlighting in the controllers.
171
-
172
- *2.6.0
173
-
174
- * added rendering option 'skip_if_empty' to Renderer::List to avoid rendering of empty ul-tags
175
- * added breadcrumbs renderer incl. specs. A big thanks to Markus Schirp.
176
- * added ability to register a renderer / specify your renderer as symbol in render_navigation
177
- * renderer can be specified in render_navigation. Credits to Andi Bade from Galaxy Cats.
178
-
179
- *2.5.4
180
-
181
- * bugfix: SimpleNavigation.config_file? without params does not check for _navigation.rb file anymore. Credits to Markus Schirp.
182
-
183
- *2.5.3
184
-
185
- * removed deprecated railtie_name from simple_navigation/railtie. Credits to Markus Schirp.
186
-
187
- *2.5.2
188
-
189
- * added Rails3 generator for navigation_config.rb. Thanks to Josep Jaume Rey.
190
-
191
- *2.5.1
192
-
193
- * set template correctly for Rails3 (brings auto highlighting to life again). Credits to Josep Jaume Rey.
194
-
195
- *2.5.0
196
-
197
- * added new renderer Renderer::Links to simply render the navigation as links inside a div.
198
- * also make item.name html_safe (in order you have html_code in the item's name). Thanks again, Johan Svensson.
199
-
200
- *2.4.2
201
-
202
- * Rails 3.0.0.beta2 compatibility
203
- * Renderer::List --> make content of ul-tag html_safe for rails 3.0.0.beta2 (due to rails3 XSS protection). Credits to Johan Svensson and Disha Albaqui.
204
- * updated copyright
205
- * reduced visibility of 'sn_set_navigation' to protected
206
-
207
- *2.4.1
208
-
209
- * removing depencency to rails. It installs the newest rails, even if a matching version is present. why is that?
210
-
211
- *2.4.0
212
-
213
- * added Rails3 compatibility
214
- * added Jeweler::Gemcutter Tasks to Rakefile
215
-
216
- *2.2.3
217
-
218
- * changed error handling in config-file. Do not ignore errors in config-file anymore.
219
- * only load config-file if it is present. Needed when directly providing items in render_navigation.
220
-
221
- *2.2.2
222
-
223
- * added lib/simple-navigation.rb to allow 'require simple-navigation' or 'config.gem "simple-navigation"'
224
-
225
- *2.2.1
226
-
227
- * Corrected URL to API-Doc on rubyforge in README
228
-
229
- *2.2.0
230
-
231
- * Allow Ranges for :level option. Credits to Ying Tsen Hong.
232
- * Changing the API of Helpers#render_navigation. Now supports Ranges for :level option and :expand_all to render all levels as expanded. Old Api is still supported, but deprecated.
233
- * Deprecated render_all_levels in config-file.
234
-
235
- *2.1.0
236
-
237
- * included Ben Marini's commit which allows individual id-generators. Thanks Ben!
238
- * added ability to specify navigation items through items_provider. This is useful for generating the navigation dynamically (e.g. from database)
239
- * items can now even be passed directly into render_navigation method.
240
-
241
- *2.0.1
242
-
243
- * fixed handling of a non-existent explicit navigation item for a navigation context
244
-
245
- *2.0.0
246
-
247
- * added auto_highlight feature. Active navigation is determined by comparing urls, no need to explicitly set it in the controllers anymore. Thanks to Jack Dempsey and Florian Hanke for the support on this.
248
- * added ability to create multi-level navigations (not just limited to primary and secondary navigation). Thanks again to Jack Dempsey for the motivation ;-)
249
- * simplified the process to explicitly set the navigation in the controller (where needed) - only deepest level has to be specified
250
- * made auto_highlight feature configurable both on global and item_container's level
251
- * config file is now evaluated in template if ever possible (not in controller anymore)
252
-
253
- *1.4.2
254
-
255
- * explicitly loading all source files when requiring 'simple_navigation'.
256
-
257
- *1.4.0
258
-
259
- * added the capability to have several navigation-contexts
260
- * doc-fix
261
-
262
- *1.3.1
263
-
264
- * now compliant with ruby 1.9.1 (thanks to Gernot Kogler for the feedback)
265
-
266
- *1.3.0
267
-
268
- * render_all_levels-option allows to render all subnavigation independent from the active primary navigation ('full open tree'). Userful for javascript menus. Thanks to Richard Hulse.
269
- * ability to turn off automatic generation of dom_ids for the list items (autogenerate_item_ids). Credits again to Richard Hulse.
270
- * ability to specify dom_class for primary and secondary lists. Thanks Richard!
271
-
272
- *1.2.2
273
-
274
- * renderers now have access to request_forgery_protection stuff (this allows delete-links as navigation-items)
275
-
276
- *1.2.1
277
-
278
- * changed way to include render_*-helper_methods into view (including them into Controller and declaring them as helper_methods instead of adding whole module as Helper). this seems to be more reliable under certain conditions. Credits to Gernot Kogler.
279
-
280
- *1.2.0
281
-
282
- * added capability to add conditions to navigation-items (primary.item key, name, url, :if => Proc.new {current_user.admin?})
283
-
284
- *1.1.2
285
-
286
- * Bugfix: config now gets evaluated on every render_navigation call. Credits to Joël Azémar.
287
- * Config file gets reloaded on every render_navigation call in development mode. Only load config file on server start in production mode.
288
-
289
-
290
- *1.1.1
291
-
292
- * Change plugin into a GemPlugin