simple-navigation 4.0.5 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +15 -8
- data/CHANGELOG.md +8 -0
- data/README.md +2 -2
- data/Rakefile +1 -0
- data/gemfiles/rails-5-2-stable.gemfile +7 -0
- data/gemfiles/rails-6-0-stable.gemfile +10 -0
- data/lib/simple_navigation/adapters/rails.rb +15 -0
- data/lib/simple_navigation/item_container.rb +3 -1
- data/lib/simple_navigation/version.rb +1 -1
- data/simple-navigation.gemspec +1 -1
- data/spec/initializers/have_css_matcher.rb +2 -1
- data/spec/simple_navigation/renderer/breadcrumbs_spec.rb +3 -4
- data/spec/simple_navigation/renderer/links_spec.rb +4 -5
- data/spec/simple_navigation/renderer/list_spec.rb +2 -3
- metadata +9 -7
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 80fdb7f2e02862d983ad05c0fdfc0abba3e702e8
         | 
| 4 | 
            +
              data.tar.gz: 8b61d65bd217b32bea405141a7e5f5e212d79159
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8171a0a34b62e9ca31f1c1d7fb6ab9ca838be0d566243cd0d11c106797d8279f2e53aeb634eeae79b01e9007da24b47bb706a776580ec010859bc9b74751d0e5
         | 
| 7 | 
            +
              data.tar.gz: 9cff271a844731db1151e6031dac06351d8592b3038327e92e0f7b245045f523974c741f9dd33332baeeb492cea9d474fd29f54fe6318517596d02222d5115fc
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/.travis.yml
    CHANGED
    
    | @@ -1,11 +1,18 @@ | |
| 1 1 | 
             
            before_install:
         | 
| 2 2 | 
             
              - gem install bundler
         | 
| 3 3 |  | 
| 4 | 
            -
             | 
| 5 | 
            -
               | 
| 6 | 
            -
              - 2. | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
              -  | 
| 11 | 
            -
             | 
| 4 | 
            +
            matrix:
         | 
| 5 | 
            +
              include:
         | 
| 6 | 
            +
              - rvm: 2.5.3
         | 
| 7 | 
            +
                gemfile: gemfiles/rails-6-0-stable.gemfile
         | 
| 8 | 
            +
              - rvm: 2.6.0
         | 
| 9 | 
            +
                gemfile: gemfiles/rails-6-0-stable.gemfile
         | 
| 10 | 
            +
              - rvm: 2.5.1
         | 
| 11 | 
            +
                gemfile: gemfiles/rails-5-2-stable.gemfile
         | 
| 12 | 
            +
              - rvm: 2.4.5
         | 
| 13 | 
            +
                gemfile: gemfiles/rails-4-2-stable.gemfile
         | 
| 14 | 
            +
              - rvm: 2.3.3
         | 
| 15 | 
            +
                gemfile: gemfiles/rails-4-1-stable.gemfile
         | 
| 16 | 
            +
              - rvm: 2.3.3
         | 
| 17 | 
            +
                gemfile: gemfiles/rails-3-2-stable.gemfile
         | 
| 18 | 
            +
              
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,13 @@ | |
| 1 1 | 
             
            # Changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ## 4.1.0
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            * Delay rails6 initialization using on_load (getting rid of deprecation warnings in rails 6). Credits to Markus Benning.
         | 
| 6 | 
            +
            * Fix link to wiki in README. Thanks to Greg Molnar.
         | 
| 7 | 
            +
            * Fix uninitialized variable `@dom_attributes` warning. Credits to Johan Tell.
         | 
| 8 | 
            +
            * Fixed tests for rails 5x. Credits to Eugene Gavrilov.
         | 
| 9 | 
            +
             | 
| 10 | 
            +
             | 
| 3 11 | 
             
            ## 4.0.5
         | 
| 4 12 |  | 
| 5 13 | 
             
            * Fix #188 Blank url and highligh_on_subpath = true causes error. Credits to Tristan Harmer (gondalez) and Ilia Pozhilov (ilyapoz).
         | 
    
        data/README.md
    CHANGED
    
    | @@ -9,7 +9,7 @@ Simple Navigation is a ruby library for creating navigations (with multiple leve | |
| 9 9 |  | 
| 10 10 | 
             
            ## Documentation
         | 
| 11 11 |  | 
| 12 | 
            -
            For the complete documentation, take a look at the [project's wiki]( | 
| 12 | 
            +
            For the complete documentation, take a look at the [project's wiki](https://github.com/codeplant/simple-navigation/wiki).
         | 
| 13 13 |  | 
| 14 14 | 
             
            ## RDoc
         | 
| 15 15 |  | 
| @@ -60,4 +60,4 @@ In this situation `/Users/username/.rubies/ruby-2.2.3/bin/rake` is the command y | |
| 60 60 |  | 
| 61 61 | 
             
            ## License
         | 
| 62 62 |  | 
| 63 | 
            -
            Copyright (c)  | 
| 63 | 
            +
            Copyright (c) 2019 codeplant GmbH, released under the MIT license
         | 
    
        data/Rakefile
    CHANGED
    
    
| @@ -5,6 +5,21 @@ module SimpleNavigation | |
| 5 5 |  | 
| 6 6 | 
             
                  def self.register
         | 
| 7 7 | 
             
                    SimpleNavigation.set_env(::Rails.root, ::Rails.env)
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                    # Autoloading in initializers is deprecated on rails 6.0
         | 
| 10 | 
            +
                    # This delays the hook initialization using the on_load
         | 
| 11 | 
            +
                    # hooks, but does not change behaviour for existing
         | 
| 12 | 
            +
                    # rails versions.
         | 
| 13 | 
            +
                    if ::Rails::VERSION::MAJOR >= 6
         | 
| 14 | 
            +
                      ActiveSupport.on_load(:action_controller_base) do
         | 
| 15 | 
            +
                        SimpleNavigation::Adapters::Rails.register_controller_helpers
         | 
| 16 | 
            +
                      end
         | 
| 17 | 
            +
                    else
         | 
| 18 | 
            +
                      register_controller_helpers
         | 
| 19 | 
            +
                    end
         | 
| 20 | 
            +
                  end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                  def self.register_controller_helpers
         | 
| 8 23 | 
             
                    ActionController::Base.send(:include, SimpleNavigation::Helpers)
         | 
| 9 24 | 
             
                    SimpleNavigation::Helpers.instance_methods.each do |m|
         | 
| 10 25 | 
             
                      ActionController::Base.send(:helper_method, m.to_sym)
         | 
| @@ -16,6 +16,7 @@ module SimpleNavigation | |
| 16 16 | 
             
                  @items ||= []
         | 
| 17 17 | 
             
                  @renderer = SimpleNavigation.config.renderer
         | 
| 18 18 | 
             
                  @auto_highlight = true
         | 
| 19 | 
            +
                  @dom_attributes = {}
         | 
| 19 20 | 
             
                end
         | 
| 20 21 |  | 
| 21 22 | 
             
                def dom_attributes
         | 
| @@ -24,7 +25,8 @@ module SimpleNavigation | |
| 24 25 | 
             
                    id: dom_id,
         | 
| 25 26 | 
             
                    class: dom_class
         | 
| 26 27 | 
             
                  }.reject { |_, v| v.nil? }
         | 
| 27 | 
            -
             | 
| 28 | 
            +
             | 
| 29 | 
            +
                  @dom_attributes.merge(dom_id_and_class)
         | 
| 28 30 | 
             
                end
         | 
| 29 31 |  | 
| 30 32 | 
             
                # Creates a new navigation item.
         | 
    
        data/simple-navigation.gemspec
    CHANGED
    
    | @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| | |
| 29 29 |  | 
| 30 30 | 
             
              spec.add_runtime_dependency 'activesupport', '>= 2.3.2'
         | 
| 31 31 |  | 
| 32 | 
            -
              spec.add_development_dependency 'bundler' | 
| 32 | 
            +
              spec.add_development_dependency 'bundler'
         | 
| 33 33 | 
             
              spec.add_development_dependency 'capybara'
         | 
| 34 34 | 
             
              spec.add_development_dependency 'coveralls', '~> 0.7'
         | 
| 35 35 | 
             
              spec.add_development_dependency 'guard-rspec', '~> 4.2'
         | 
| @@ -5,8 +5,7 @@ module SimpleNavigation | |
| 5 5 |  | 
| 6 6 | 
             
                  let(:item) { nil }
         | 
| 7 7 | 
             
                  let(:options) {{ level: :all }}
         | 
| 8 | 
            -
                  let(:output) {  | 
| 9 | 
            -
                  let(:raw_output) { renderer.render(navigation) }
         | 
| 8 | 
            +
                  let(:output) { renderer.render(navigation) }
         | 
| 10 9 | 
             
                  let(:renderer) { Breadcrumbs.new(options) }
         | 
| 11 10 |  | 
| 12 11 | 
             
                  before { select_an_item(navigation[item]) if item }
         | 
| @@ -75,7 +74,7 @@ module SimpleNavigation | |
| 75 74 | 
             
                        let(:item) { nil }
         | 
| 76 75 |  | 
| 77 76 | 
             
                        it "doesn't render the prefix before the breadcrumbs" do
         | 
| 78 | 
            -
                          expect( | 
| 77 | 
            +
                          expect(output).not_to match(/^<div.+>You are here: /)
         | 
| 79 78 | 
             
                        end
         | 
| 80 79 | 
             
                      end
         | 
| 81 80 |  | 
| @@ -83,7 +82,7 @@ module SimpleNavigation | |
| 83 82 | 
             
                        let(:item) { :invoices }
         | 
| 84 83 |  | 
| 85 84 | 
             
                        it 'renders the prefix before the breadcrumbs' do
         | 
| 86 | 
            -
                          expect( | 
| 85 | 
            +
                          expect(output).to match(/^<div.+>You are here: /)
         | 
| 87 86 | 
             
                        end
         | 
| 88 87 | 
             
                      end
         | 
| 89 88 | 
             
                    end
         | 
| @@ -5,9 +5,8 @@ module SimpleNavigation | |
| 5 5 | 
             
                    let!(:navigation) { setup_navigation('nav_id', 'nav_class') }
         | 
| 6 6 |  | 
| 7 7 | 
             
                    let(:item) { nil }
         | 
| 8 | 
            -
                    let(:options) {{ level: :all }}
         | 
| 9 | 
            -
                    let(:output) {  | 
| 10 | 
            -
                    let(:raw_output) { renderer.render(navigation) }
         | 
| 8 | 
            +
                    let(:options) { { level: :all } }
         | 
| 9 | 
            +
                    let(:output) { renderer.render(navigation) }
         | 
| 11 10 | 
             
                    let(:renderer) { Links.new(options) }
         | 
| 12 11 |  | 
| 13 12 | 
             
                    before { select_an_item(navigation[item]) if item }
         | 
| @@ -29,7 +28,7 @@ module SimpleNavigation | |
| 29 28 | 
             
                    end
         | 
| 30 29 |  | 
| 31 30 | 
             
                    it "renders the 'a' tags with the corresponding item's :html_options" do
         | 
| 32 | 
            -
                      expect(output).to have_css('a[style=float:right]')
         | 
| 31 | 
            +
                      expect(output).to have_css('a[style="float:right"]')
         | 
| 33 32 | 
             
                    end
         | 
| 34 33 |  | 
| 35 34 | 
             
                    context 'when an item has a specified id' do
         | 
| @@ -62,7 +61,7 @@ module SimpleNavigation | |
| 62 61 | 
             
                      let(:options) {{ level: :all, join_with: ' | ' }}
         | 
| 63 62 |  | 
| 64 63 | 
             
                      it 'separates the items with the specified separator' do
         | 
| 65 | 
            -
                        expect( | 
| 64 | 
            +
                        expect(output.scan(' | ').size).to eq 3
         | 
| 66 65 | 
             
                      end
         | 
| 67 66 | 
             
                    end
         | 
| 68 67 |  | 
| @@ -4,9 +4,8 @@ module SimpleNavigation | |
| 4 4 | 
             
                  let!(:navigation) { setup_navigation('nav_id', 'nav_class') }
         | 
| 5 5 |  | 
| 6 6 | 
             
                  let(:item) { nil }
         | 
| 7 | 
            -
                  let(:options) {{ level: :all }}
         | 
| 8 | 
            -
                  let(:output) {  | 
| 9 | 
            -
                  let(:raw_output) { renderer.render(navigation) }
         | 
| 7 | 
            +
                  let(:options) { { level: :all } }
         | 
| 8 | 
            +
                  let(:output) { renderer.render(navigation) }
         | 
| 10 9 | 
             
                  let(:renderer) { List.new(options) }
         | 
| 11 10 |  | 
| 12 11 | 
             
                  before { select_an_item(navigation[item]) if item }
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: simple-navigation
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 4.0 | 
| 4 | 
            +
              version: 4.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Andi Schacke
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date:  | 
| 13 | 
            +
            date: 2019-08-17 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: activesupport
         | 
| @@ -30,16 +30,16 @@ dependencies: | |
| 30 30 | 
             
              name: bundler
         | 
| 31 31 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 32 32 | 
             
                requirements:
         | 
| 33 | 
            -
                - - " | 
| 33 | 
            +
                - - ">="
         | 
| 34 34 | 
             
                  - !ruby/object:Gem::Version
         | 
| 35 | 
            -
                    version: ' | 
| 35 | 
            +
                    version: '0'
         | 
| 36 36 | 
             
              type: :development
         | 
| 37 37 | 
             
              prerelease: false
         | 
| 38 38 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                requirements:
         | 
| 40 | 
            -
                - - " | 
| 40 | 
            +
                - - ">="
         | 
| 41 41 | 
             
                  - !ruby/object:Gem::Version
         | 
| 42 | 
            -
                    version: ' | 
| 42 | 
            +
                    version: '0'
         | 
| 43 43 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 44 44 | 
             
              name: capybara
         | 
| 45 45 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -175,6 +175,8 @@ files: | |
| 175 175 | 
             
            - gemfiles/rails-3-2-stable.gemfile
         | 
| 176 176 | 
             
            - gemfiles/rails-4-1-stable.gemfile
         | 
| 177 177 | 
             
            - gemfiles/rails-4-2-stable.gemfile
         | 
| 178 | 
            +
            - gemfiles/rails-5-2-stable.gemfile
         | 
| 179 | 
            +
            - gemfiles/rails-6-0-stable.gemfile
         | 
| 178 180 | 
             
            - generators/navigation_config/USAGE
         | 
| 179 181 | 
             
            - generators/navigation_config/navigation_config_generator.rb
         | 
| 180 182 | 
             
            - generators/navigation_config/templates/config/navigation.rb
         | 
| @@ -257,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 257 259 | 
             
                  version: '0'
         | 
| 258 260 | 
             
            requirements: []
         | 
| 259 261 | 
             
            rubyforge_project: 
         | 
| 260 | 
            -
            rubygems_version: 2. | 
| 262 | 
            +
            rubygems_version: 2.6.14
         | 
| 261 263 | 
             
            signing_key: 
         | 
| 262 264 | 
             
            specification_version: 4
         | 
| 263 265 | 
             
            summary: simple-navigation is a ruby library for creating navigations (with multiple
         |