bootstrap-navbar 1.0.0.pre5 → 1.0.0.pre6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce035a6d2d9f6e1e92fcf991c1776b4e2b837b6e
4
- data.tar.gz: 777ec660ec7e53ef8ccbb75874e767b6aa679312
3
+ metadata.gz: 747804f867d7733cc7d2017d150c251c697f7d7b
4
+ data.tar.gz: 52bb44678ab9b4d832892e10bbf40c3626f48a25
5
5
  SHA512:
6
- metadata.gz: 9455ae0897b3e174650316cec70ab8ab037b9a83888ec6254aa68651919cbbf35f1bf821a2a084ef11d2b68442a4da6932995fd0fc445ed8590626d7c33138d0
7
- data.tar.gz: 53455168eb7fd09d7eb87df1b86d67225a8b61a6326b73625acabb50ab7897f0b10cc3c937ba1f0d5fdb60619cf0c2efa107f35625a7e1940ff230d7f7fe2430
6
+ metadata.gz: f489bfdef9f57536f29361de3f3b362e6b286f7e6b8f35aea252d9c96ef1997163a57c8ef6d15c0bc116b530944e2c1c931cda365257da4b29073b0404cbc36a
7
+ data.tar.gz: cd3160ef9e88939818289d9ecb1d45ed29151d62c46f9cb3613d8e39a6caabd881d0912f0f5937520add2a45d8728eef723cbdaf8c8b9a00e77ff279dc21a234
@@ -1,6 +1,6 @@
1
1
  module BootstrapNavbar::Helpers::Bootstrap2
2
- def navbar(options = {}, &block)
3
- wrapper options do
2
+ def navbar(options = {}, wrapper_options = {}, &block)
3
+ wrapper options, wrapper_options do
4
4
  inner_wrapper do
5
5
  container options[:brand], options[:brand_link], options[:responsive], options[:fluid], &block
6
6
  end
@@ -101,7 +101,7 @@ HTML
101
101
 
102
102
  private
103
103
 
104
- def wrapper(options, &block)
104
+ def wrapper(options, html_options, &block)
105
105
  position = case
106
106
  when options.has_key?(:static)
107
107
  "static-#{options[:static]}"
@@ -112,8 +112,9 @@ HTML
112
112
  css_classes = %w(navbar).tap do |css_classes|
113
113
  css_classes << "navbar-#{position}" if position
114
114
  css_classes << 'navbar-inverse' if options[:inverse]
115
+ css_classes << html_options.delete(:class)
115
116
  end
116
- attribute_hash = { class: css_classes.join(' ') }
117
+ attribute_hash = { class: css_classes.join(' ') }.merge(html_options)
117
118
  attributes = attributes_for_tag(attribute_hash)
118
119
 
119
120
  prepare_html <<-HTML.chomp!
@@ -1,3 +1,3 @@
1
1
  module BootstrapNavbar
2
- VERSION = '1.0.0.pre5'
2
+ VERSION = '1.0.0.pre6'
3
3
  end
@@ -107,6 +107,14 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
107
107
  end
108
108
  end
109
109
  end
110
+
111
+ context 'with wrapper parameters' do
112
+ it 'generates the correct HTML' do
113
+ with_all_2_dot_x_versions do
114
+ expect(renderer.navbar({}, class: 'my-wrapper-class', id: 'my-wrapper-id')).to have_tag(:div, with: { class: 'navbar my-wrapper-class', id: 'my-wrapper-id' })
115
+ end
116
+ end
117
+ end
110
118
  end
111
119
 
112
120
  describe '#navbar_group' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-navbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre5
4
+ version: 1.0.0.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Meurer