├── .gitignore ├── .rspec ├── .travis.yml ├── CHANGELOG.md ├── Gemfile ├── Guardfile ├── LICENSE ├── README.md ├── Rakefile ├── gemfiles ├── .bundle │ └── config ├── rails-3-2-stable.gemfile ├── rails-4-1-stable.gemfile ├── rails-4-2-stable.gemfile ├── rails-5-2-stable.gemfile ├── rails-6-0-stable.gemfile └── rails-6-1-stable.gemfile ├── generators └── navigation_config │ ├── USAGE │ ├── navigation_config_generator.rb │ └── templates │ └── config │ └── navigation.rb ├── init.rb ├── install.rb ├── lib ├── generators │ └── navigation_config │ │ └── navigation_config_generator.rb ├── simple-navigation.rb ├── simple_navigation.rb └── simple_navigation │ ├── adapters.rb │ ├── adapters │ ├── base.rb │ ├── nanoc.rb │ ├── padrino.rb │ ├── rails.rb │ └── sinatra.rb │ ├── config_file.rb │ ├── config_file_finder.rb │ ├── configuration.rb │ ├── helpers.rb │ ├── item.rb │ ├── item_adapter.rb │ ├── item_container.rb │ ├── items_provider.rb │ ├── railtie.rb │ ├── renderer.rb │ ├── renderer │ ├── base.rb │ ├── breadcrumbs.rb │ ├── json.rb │ ├── links.rb │ ├── list.rb │ └── text.rb │ └── version.rb ├── simple-navigation.gemspec ├── spec ├── fake_app │ ├── config │ │ └── navigation.rb │ └── rails_app.rb ├── initializers │ ├── coveralls.rb │ ├── have_css_matcher.rb │ ├── memfs.rb │ ├── rails.rb │ └── rspec.rb ├── integration │ └── rendering_navigation_spec.rb ├── simple_navigation │ ├── adapters │ │ ├── padrino_spec.rb │ │ ├── rails_spec.rb │ │ └── sinatra_spec.rb │ ├── config_file_finder_spec.rb │ ├── config_file_spec.rb │ ├── configuration_spec.rb │ ├── helpers_spec.rb │ ├── item_adapter_spec.rb │ ├── item_container_spec.rb │ ├── item_spec.rb │ ├── items_provider_spec.rb │ └── renderer │ │ ├── base_spec.rb │ │ ├── breadcrumbs_spec.rb │ │ ├── json_spec.rb │ │ ├── links_spec.rb │ │ ├── list_spec.rb │ │ └── text_spec.rb ├── simple_navigation_spec.rb └── spec_helper.rb └── uninstall.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | rdoc 3 | pkg 4 | coverage 5 | Gemfile.lock 6 | .rvmrc 7 | capybara-* 8 | gemfiles/*.lock 9 | log 10 | spec/fake_app/tmp 11 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --format=documentation 3 | --require spec_helper 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | - gem install bundler 3 | 4 | matrix: 5 | include: 6 | - rvm: 2.5.8 7 | gemfile: gemfiles/rails-6-1-stable.gemfile 8 | - rvm: 2.6.7 9 | gemfile: gemfiles/rails-6-1-stable.gemfile 10 | - rvm: 2.7.3 11 | gemfile: gemfiles/rails-6-1-stable.gemfile 12 | - rvm: 2.5.3 13 | gemfile: gemfiles/rails-6-0-stable.gemfile 14 | - rvm: 2.6.0 15 | gemfile: gemfiles/rails-6-0-stable.gemfile 16 | - rvm: 2.5.1 17 | gemfile: gemfiles/rails-5-2-stable.gemfile 18 | - rvm: 2.4.5 19 | gemfile: gemfiles/rails-4-2-stable.gemfile 20 | - rvm: 2.3.3 21 | gemfile: gemfiles/rails-4-1-stable.gemfile 22 | - rvm: 2.3.3 23 | gemfile: gemfiles/rails-3-2-stable.gemfile 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 4.4.0 4 | 5 | * add options rendering to json renderer. Credits to Mikhail Kytyzov. 6 | 7 | ## 4.3.0 8 | 9 | * removed warnings from rspec. Thanks mgrunberg. 10 | * add compatibility with rails 6.1. Credits to mgrunberg. 11 | * run specs against 6.1. Credits to mgrunberg. 12 | 13 | ## 4.2.0 14 | 15 | * improvements to generator template. Credits to mgrunberg. 16 | * be able to run 'rake spec:rails-6-0-stable'. Credits to mgrunberg. 17 | 18 | ## 4.1.0 19 | 20 | * Delay rails6 initialization using on_load (getting rid of deprecation warnings in rails 6). Credits to Markus Benning. 21 | * Fix link to wiki in README. Thanks to Greg Molnar. 22 | * Fix uninitialized variable `@dom_attributes` warning. Credits to Johan Tell. 23 | * Fixed tests for rails 5x. Credits to Eugene Gavrilov. 24 | 25 | 26 | ## 4.0.5 27 | 28 | * Fix #188 Blank url and highligh_on_subpath = true causes error. Credits to Tristan Harmer (gondalez) and Ilia Pozhilov (ilyapoz). 29 | 30 | ## 4.0.4 31 | 32 | * Fix #184 uninitialized constant Rails::Railtie (NameError). Credits to n-rodriguez. 33 | 34 | ## 4.0.3 35 | 36 | * Fix #180 Check URL before invoking current_page? 37 | 38 | ## 4.0.2 39 | 40 | * fixing current_page? when url is nil 41 | 42 | ## 4.0.1 43 | 44 | * fixed padrino adapter 45 | 46 | ## 4.0.0 47 | 48 | * added two new configuration options ignore_query_params_on_auto_highlight and ignore_anchors_on_auto_highlight 49 | * Remove dependency on classic-style Sinatra applications and enable use with modular-style apps. Credits to Stefan Kolb. 50 | * Item can now receive a block as `name` 51 | * It's now possible to set a global `highlight_on_subpath` option instead of adding it to every item 52 | * Creating an Item doesn't remove options anymore 53 | * Creating an Item no longer changed its container, only adding it to a container 54 | does 55 | * `Item#autogenerate_item_ids?` has been removed 56 | * `SN.config_file_name`, `SN.config_file` and `SN.config_file?` have been 57 | removed 58 | * `ConfigFileFinder` and `ConfigFile` handle the configuration logic 59 | * File organization was been changed to reflect the Ruby namespacing 60 | 61 | ## 3.13.0 62 | 63 | * consider_item_names_as_safe is now false by default. Removed deprecation warning 64 | 65 | ## 3.12.2 66 | 67 | * Fixing issue #154. Thanks to Simon Curtois. 68 | 69 | ## 3.12.1 70 | 71 | * bugfix (error in generator) 72 | 73 | ## 3.12.0 74 | 75 | * Relax hash constraint on item_adapter. Thanks to Ramon Tayag. 76 | * Fixed hidden special character in navigation template. Credits to Stef 77 | Lewandowski 78 | * Added full MIT license text. Thanks to Ben Armstrong. 79 | * Added license to gemspec. Thanks to Troy Thompson. 80 | * Allow defining other html attributes than :id and :class on menu container. 81 | Credits to Jacek Tomaszewski. 82 | * Added new config option "consider_item_names_as_safe". Thanks to Alexey 83 | Naumov. 84 | * Big cleanup of specs, removed jeweler in favor of the "bundler" way. Huge 85 | thank you to Simon Courtois. 86 | * Added more powerful name generator which yields the item itself in addition to 87 | the item's name. Credits to Simon Curtois. 88 | 89 | ## 3.11.0 90 | 91 | * Added Json renderer. Thanks to Alberto Avila. 92 | 93 | ## 3.10.1 94 | 95 | * Padrino adapter now returns "html_safe"d content_tag 96 | 97 | ## 3.10.0 98 | 99 | * Added ability to set selected_class on container level. Credits to Joost 100 | Hietbrink. 101 | * do not highlight items that are only partial matches. Thanks to Troy Thompson. 102 | * adding support for rails 4. Credits to Samer Masry. 103 | 104 | ## 3.9.0 105 | 106 | * Added ability to pass a block to render_navigation for configuring dynamic 107 | navigation items (instead of passing :items). Credits to Ronald Chan. 108 | 109 | ## 3.8.0 110 | 111 | * Changed the way the context is fetched. Fixes incompatibility with Gretel. 112 | Thanks to Ivan Kasatenko. 113 | * Added :join_with option to links renderer. Thanks to Stefan Melmuk. 114 | * Added :prefix option to breadcrumb renderer. Credits to Rodrigo Manhães. 115 | * Added :ordered option for allowing list renderer to render an `
    ` rather 116 | than a `