bootstrap-navbar 1.0.2 → 1.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/.travis.yml +2 -1
- data/README.md +6 -6
- data/bootstrap-navbar.gemspec +2 -2
- data/lib/bootstrap-navbar.rb +1 -1
- data/lib/bootstrap-navbar/helpers/bootstrap3.rb +7 -5
- data/lib/bootstrap-navbar/version.rb +1 -1
- data/spec/bootstrap-navbar/helpers/bootstrap3_spec.rb +5 -0
- data/spec/support/helpers.rb +6 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfcaa232c9de0ba3888c8f87b6dc1c15b14edbb7
|
4
|
+
data.tar.gz: 7c4a7698d6211e01f89e42f93a144c19dd3532a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43ab97ee7b8af682f3f754c99f06beb5e8da86a17188d07939a1e63a5c582541c8bc32ee67c79004d4a54781e1edc6d4ae1532cc8e60e3a02dded4e0939d8e0c
|
7
|
+
data.tar.gz: 963c39652f38113cae133e98f66f14e7756c003eb97c59bfe1d568a16b07f22f1fc94cd083713c09e8a413cff1c292f3817077ad8d3e3a75202e01723ea5a687
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# BootstrapNavbar
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/bootstrap-navbar)
|
4
|
-
[](http://travis-ci.org/bootstrap-ruby/bootstrap-navbar)
|
5
|
+
[](https://gemnasium.com/bootstrap-ruby/bootstrap-navbar)
|
6
|
+
[](https://codeclimate.com/github/bootstrap-ruby/bootstrap-navbar)
|
7
7
|
|
8
8
|
Helpers to generate a Twitter Bootstrap style navbar
|
9
9
|
|
@@ -12,7 +12,7 @@ Helpers to generate a Twitter Bootstrap style navbar
|
|
12
12
|
This gem only provides a helper module with methods to generate HTML. It can be used by other gems to make these helpers available to a framework's rendering engine, e.g.:
|
13
13
|
|
14
14
|
* For Rails: https://github.com/julescopeland/Rails-Bootstrap-Navbar
|
15
|
-
* For [Middleman](http://middlemanapp.com/): https://github.com/
|
15
|
+
* For [Middleman](http://middlemanapp.com/): https://github.com/bootstrap-ruby/middleman-bootstrap-navbar
|
16
16
|
|
17
17
|
In short: __Unless you know what you're doing, do not use this gem directly in your app!__
|
18
18
|
|
@@ -69,9 +69,9 @@ ActionView::Base.send :include, BootstrapNavbar::Helpers
|
|
69
69
|
|
70
70
|
Since the navbar format changed quite a bit between Bootstrap 2.x and 3.x, generating them using this gem is quite different as well. Check out the Wiki pages for detailed instructions:
|
71
71
|
|
72
|
-
[Usage with Bootstrap 2.x](https://github.com/
|
72
|
+
[Usage with Bootstrap 2.x](https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-2.x)
|
73
73
|
|
74
|
-
[Usage with Bootstrap 3.x](https://github.com/
|
74
|
+
[Usage with Bootstrap 3.x](https://github.com/bootstrap-ruby/bootstrap-navbar/wiki/Usage-with-Bootstrap-3.x)
|
75
75
|
|
76
76
|
## Contributing
|
77
77
|
|
data/bootstrap-navbar.gemspec
CHANGED
@@ -10,10 +10,10 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.version = BootstrapNavbar::VERSION
|
11
11
|
gem.platform = Gem::Platform::RUBY
|
12
12
|
gem.authors = ['Manuel Meurer']
|
13
|
-
gem.email = 'manuel
|
13
|
+
gem.email = 'manuel@krautcomputing.com'
|
14
14
|
gem.summary = 'Helpers to generate a Twitter Bootstrap style navbar'
|
15
15
|
gem.description = 'Helpers to generate a Twitter Bootstrap style navbar'
|
16
|
-
gem.homepage = 'https://github.com/
|
16
|
+
gem.homepage = 'https://github.com/bootstrap-ruby/bootstrap-navbar'
|
17
17
|
gem.license = 'MIT'
|
18
18
|
|
19
19
|
gem.files = `git ls-files`.split($/)
|
data/lib/bootstrap-navbar.rb
CHANGED
@@ -3,7 +3,7 @@ require 'gem_config'
|
|
3
3
|
module BootstrapNavbar
|
4
4
|
include GemConfig::Base
|
5
5
|
|
6
|
-
BOOTSTRAP_VERSIONS = %w(3.0.3 3.0.2 3.0.1 3.0.0 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0)
|
6
|
+
BOOTSTRAP_VERSIONS = %w(3.1.0 3.0.3 3.0.2 3.0.1 3.0.0 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0)
|
7
7
|
|
8
8
|
with_configuration do
|
9
9
|
has :bootstrap_version, classes: [String, NilClass], values: BOOTSTRAP_VERSIONS.unshift(nil)
|
@@ -1,12 +1,11 @@
|
|
1
1
|
module BootstrapNavbar::Helpers::Bootstrap3
|
2
2
|
def navbar(options = {}, &block)
|
3
|
-
container = options.has_key?(:container) ? options[:container] : true
|
4
3
|
navbar_content =
|
5
4
|
header(options.delete(:brand), options.delete(:brand_link)) <<
|
6
5
|
collapsable(&block)
|
7
6
|
wrapper options do
|
8
|
-
|
9
|
-
container(navbar_content)
|
7
|
+
unless options[:container] == false
|
8
|
+
container(options[:container], navbar_content)
|
10
9
|
else
|
11
10
|
navbar_content
|
12
11
|
end
|
@@ -115,9 +114,12 @@ HTML
|
|
115
114
|
|
116
115
|
private
|
117
116
|
|
118
|
-
def container(content)
|
117
|
+
def container(type, content)
|
118
|
+
css_class = 'container'
|
119
|
+
css_class << "-#{type}" if type.is_a?(String)
|
120
|
+
attributes = attributes_for_tag(class: css_class)
|
119
121
|
prepare_html <<-HTML.chomp!
|
120
|
-
<div
|
122
|
+
<div#{attributes}>
|
121
123
|
#{content}
|
122
124
|
</div>
|
123
125
|
HTML
|
@@ -66,6 +66,11 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
66
66
|
without_tag :div, with: { class: 'container' }
|
67
67
|
end
|
68
68
|
end
|
69
|
+
with_version '3.1.0' do
|
70
|
+
expect(renderer.navbar(container: 'fluid')).to have_tag(:nav, with: { class: 'navbar navbar-default' }) do
|
71
|
+
with_tag :div, with: { class: 'container-fluid' }
|
72
|
+
end
|
73
|
+
end
|
69
74
|
end
|
70
75
|
end
|
71
76
|
|
data/spec/support/helpers.rb
CHANGED
@@ -16,20 +16,13 @@ module Helpers
|
|
16
16
|
with_versions '3'...'4', &block
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
20
|
-
|
21
|
-
|
22
|
-
raise "#{versions} is not a valid version!" unless BootstrapNavbar::BOOTSTRAP_VERSIONS.include?(versions)
|
23
|
-
[versions]
|
24
|
-
when Range
|
25
|
-
BootstrapNavbar::BOOTSTRAP_VERSIONS.select do |version|
|
26
|
-
versions.cover?(version)
|
27
|
-
end
|
28
|
-
else
|
29
|
-
raise "Please pass a string or a range to this method, not a #{versions.class}."
|
30
|
-
end
|
19
|
+
def with_version(version, &block)
|
20
|
+
with_versions version..version, &block
|
21
|
+
end
|
31
22
|
|
32
|
-
|
23
|
+
def with_versions(versions, &block)
|
24
|
+
BootstrapNavbar::BOOTSTRAP_VERSIONS.each do |version|
|
25
|
+
next unless versions.cover?(version)
|
33
26
|
puts "Testing version #{version}..."
|
34
27
|
BootstrapNavbar.configuration.bootstrap_version = version
|
35
28
|
block.call
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-navbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Meurer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.2.4
|
111
111
|
description: Helpers to generate a Twitter Bootstrap style navbar
|
112
|
-
email: manuel
|
112
|
+
email: manuel@krautcomputing.com
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
@@ -131,7 +131,7 @@ files:
|
|
131
131
|
- spec/bootstrap-navbar/helpers_spec.rb
|
132
132
|
- spec/spec_helper.rb
|
133
133
|
- spec/support/helpers.rb
|
134
|
-
homepage: https://github.com/
|
134
|
+
homepage: https://github.com/bootstrap-ruby/bootstrap-navbar
|
135
135
|
licenses:
|
136
136
|
- MIT
|
137
137
|
metadata: {}
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.2.0
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Helpers to generate a Twitter Bootstrap style navbar
|