bootstrap-navbar 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4fc1d1d81a16651072e930c183d430d1eb262e7
4
- data.tar.gz: 7257a1c996bc8c11274f73893dcfbad43e4c0b24
3
+ metadata.gz: cfcaa232c9de0ba3888c8f87b6dc1c15b14edbb7
4
+ data.tar.gz: 7c4a7698d6211e01f89e42f93a144c19dd3532a0
5
5
  SHA512:
6
- metadata.gz: 8d84f575dcaf1bc3a9929bffd6a82951b0737aaf91b71ee23ee664d4f46431d00e1bc52f1eb5bf0f995602c9fd591f764ceaa8a4d4846125dd0652d4696d8828
7
- data.tar.gz: f36eead4d4ed5cd0d320eaf0c73f501ad126035682c502de6a55c548a2504a3503a89bcf3d811db8e1b39a7d8cf9502c534c64822eff77415475b96f4165a456
6
+ metadata.gz: 43ab97ee7b8af682f3f754c99f06beb5e8da86a17188d07939a1e63a5c582541c8bc32ee67c79004d4a54781e1edc6d4ae1532cc8e60e3a02dded4e0939d8e0c
7
+ data.tar.gz: 963c39652f38113cae133e98f66f14e7756c003eb97c59bfe1d568a16b07f22f1fc94cd083713c09e8a413cff1c292f3817077ad8d3e3a75202e01723ea5a687
@@ -3,4 +3,5 @@ rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
5
  - 2.0.0
6
- - jruby-19mode
6
+ - 2.1.0
7
+ - jruby
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # BootstrapNavbar
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/bootstrap-navbar.png)](http://badge.fury.io/rb/bootstrap-navbar)
4
- [![Build Status](https://secure.travis-ci.org/krautcomputing/bootstrap-navbar.png)](http://travis-ci.org/krautcomputing/bootstrap-navbar)
5
- [![Dependency Status](https://gemnasium.com/krautcomputing/bootstrap-navbar.png)](https://gemnasium.com/krautcomputing/bootstrap-navbar)
6
- [![Code Climate](https://codeclimate.com/github/krautcomputing/bootstrap-navbar.png)](https://codeclimate.com/github/krautcomputing/bootstrap-navbar)
4
+ [![Build Status](https://secure.travis-ci.org/bootstrap-ruby/bootstrap-navbar.png)](http://travis-ci.org/bootstrap-ruby/bootstrap-navbar)
5
+ [![Dependency Status](https://gemnasium.com/bootstrap-ruby/bootstrap-navbar.png)](https://gemnasium.com/bootstrap-ruby/bootstrap-navbar)
6
+ [![Code Climate](https://codeclimate.com/github/bootstrap-ruby/bootstrap-navbar.png)](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/krautcomputing/middleman-bootstrap-navbar
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/krautcomputing/bootstrap-navbar/wiki/Usage-with-Bootstrap-2.x)
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/krautcomputing/bootstrap-navbar/wiki/Usage-with-Bootstrap-3.x)
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
 
@@ -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.meurer@gmail.com'
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/krautcomputing/bootstrap-navbar'
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($/)
@@ -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
- if container
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 class="container">
122
+ <div#{attributes}>
121
123
  #{content}
122
124
  </div>
123
125
  HTML
@@ -1,3 +1,3 @@
1
1
  module BootstrapNavbar
2
- VERSION = '1.0.2'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -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
 
@@ -16,20 +16,13 @@ module Helpers
16
16
  with_versions '3'...'4', &block
17
17
  end
18
18
 
19
- def with_versions(versions, &block)
20
- versions = case versions
21
- when String
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
- versions.each do |version|
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.2
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: 2013-12-08 00:00:00.000000000 Z
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.meurer@gmail.com
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/krautcomputing/bootstrap-navbar
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.1.5
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