tabs_for 0.2.0 → 0.2.1

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: 93bd9c65f4daec48c119cac219beb04cf65118e7
4
- data.tar.gz: f1a99e2c0a4bddfb85db2f15a161ac46c8c83bca
3
+ metadata.gz: 72e301e7aababf373d0035296f9267601cda7d09
4
+ data.tar.gz: ceb43f2ddeef6e185bda8cab00c21708cb8344ea
5
5
  SHA512:
6
- metadata.gz: cf9ecc0319c075bbc1a2176bf9b55da36a890686b68e4dd1098ad283a5830b3877c36bec24ecfc4e2c90ffd648b002436757a7c6ac47bc700ec43a052a3357e2
7
- data.tar.gz: 855ef5176dbb0227886c349d89a3878d1dbe7937b1384cab5d7f69246fe2cb4b0ff232bf33c0178eeb039d214902243cb2aae04fabb1f170230bb5e92725693f
6
+ metadata.gz: 59151874011f4f23203aed05df29eb7dede8cb45e681be7163bc0d4e84f3c3c8162583a047ddadec8ba5df38e598db93ad613e96fdba803d80a4477c86bfc92c
7
+ data.tar.gz: 944cbfcd34e6be723b56d7b79357237b2ad929e9633efb9dc18d252479036f940034e75544d29b6562404df83772d76fc6d867e87e41b570cab66dab335562e7
data/.travis.yml CHANGED
@@ -3,4 +3,5 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.1.0
5
5
  - 2.2.2
6
+ - 2.2.3
6
7
  before_install: gem install bundler -v 1.10.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.1] 2015-11-24
4
+ ### Changed
5
+ - Update dependencies
6
+
3
7
  ## [0.2.0] 2015-10-13
4
8
  ### Fixes
5
9
  - Use `font-awesome-rails` to handle icons.
data/Gemfile.lock CHANGED
@@ -1,43 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tabs_for (0.2.0)
4
+ tabs_for (0.2.1)
5
5
  font-awesome-rails (~> 4.0)
6
6
  rails (>= 3.2, < 5.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionmailer (4.2.4)
12
- actionpack (= 4.2.4)
13
- actionview (= 4.2.4)
14
- activejob (= 4.2.4)
11
+ actionmailer (4.2.5)
12
+ actionpack (= 4.2.5)
13
+ actionview (= 4.2.5)
14
+ activejob (= 4.2.5)
15
15
  mail (~> 2.5, >= 2.5.4)
16
16
  rails-dom-testing (~> 1.0, >= 1.0.5)
17
- actionpack (4.2.4)
18
- actionview (= 4.2.4)
19
- activesupport (= 4.2.4)
17
+ actionpack (4.2.5)
18
+ actionview (= 4.2.5)
19
+ activesupport (= 4.2.5)
20
20
  rack (~> 1.6)
21
21
  rack-test (~> 0.6.2)
22
22
  rails-dom-testing (~> 1.0, >= 1.0.5)
23
23
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
- actionview (4.2.4)
25
- activesupport (= 4.2.4)
24
+ actionview (4.2.5)
25
+ activesupport (= 4.2.5)
26
26
  builder (~> 3.1)
27
27
  erubis (~> 2.7.0)
28
28
  rails-dom-testing (~> 1.0, >= 1.0.5)
29
29
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
- activejob (4.2.4)
31
- activesupport (= 4.2.4)
30
+ activejob (4.2.5)
31
+ activesupport (= 4.2.5)
32
32
  globalid (>= 0.3.0)
33
- activemodel (4.2.4)
34
- activesupport (= 4.2.4)
33
+ activemodel (4.2.5)
34
+ activesupport (= 4.2.5)
35
35
  builder (~> 3.1)
36
- activerecord (4.2.4)
37
- activemodel (= 4.2.4)
38
- activesupport (= 4.2.4)
36
+ activerecord (4.2.5)
37
+ activemodel (= 4.2.5)
38
+ activesupport (= 4.2.5)
39
39
  arel (~> 6.0)
40
- activesupport (4.2.4)
40
+ activesupport (4.2.5)
41
41
  i18n (~> 0.7)
42
42
  json (~> 1.7, >= 1.7.7)
43
43
  minitest (~> 5.1)
@@ -45,17 +45,18 @@ GEM
45
45
  tzinfo (~> 1.1)
46
46
  arel (6.0.3)
47
47
  builder (3.2.2)
48
- coveralls (0.8.2)
48
+ coveralls (0.8.9)
49
49
  json (~> 1.8)
50
50
  rest-client (>= 1.6.8, < 2)
51
51
  simplecov (~> 0.10.0)
52
52
  term-ansicolor (~> 1.3)
53
53
  thor (~> 0.19.1)
54
+ tins (~> 1.6.0)
54
55
  docile (1.1.5)
55
- domain_name (0.5.24)
56
+ domain_name (0.5.25)
56
57
  unf (>= 0.0.5, < 1.0.0)
57
58
  erubis (2.7.0)
58
- font-awesome-rails (4.4.0.0)
59
+ font-awesome-rails (4.5.0.0)
59
60
  railties (>= 3.2, < 5.0)
60
61
  globalid (0.3.6)
61
62
  activesupport (>= 4.1.0)
@@ -67,25 +68,25 @@ GEM
67
68
  nokogiri (>= 1.5.9)
68
69
  mail (2.6.3)
69
70
  mime-types (>= 1.16, < 3)
70
- mime-types (2.6.1)
71
+ mime-types (2.99)
71
72
  mini_portile (0.6.2)
72
- minitest (5.8.0)
73
- netrc (0.10.3)
74
- nokogiri (1.6.6.2)
73
+ minitest (5.8.3)
74
+ netrc (0.11.0)
75
+ nokogiri (1.6.6.4)
75
76
  mini_portile (~> 0.6.0)
76
77
  rack (1.6.4)
77
78
  rack-test (0.6.3)
78
79
  rack (>= 1.0)
79
- rails (4.2.4)
80
- actionmailer (= 4.2.4)
81
- actionpack (= 4.2.4)
82
- actionview (= 4.2.4)
83
- activejob (= 4.2.4)
84
- activemodel (= 4.2.4)
85
- activerecord (= 4.2.4)
86
- activesupport (= 4.2.4)
80
+ rails (4.2.5)
81
+ actionmailer (= 4.2.5)
82
+ actionpack (= 4.2.5)
83
+ actionview (= 4.2.5)
84
+ activejob (= 4.2.5)
85
+ activemodel (= 4.2.5)
86
+ activerecord (= 4.2.5)
87
+ activesupport (= 4.2.5)
87
88
  bundler (>= 1.3.0, < 2.0)
88
- railties (= 4.2.4)
89
+ railties (= 4.2.5)
89
90
  sprockets-rails
90
91
  rails-deprecated_sanitizer (1.0.3)
91
92
  activesupport (>= 4.2.0.alpha)
@@ -95,9 +96,9 @@ GEM
95
96
  rails-deprecated_sanitizer (>= 1.0.1)
96
97
  rails-html-sanitizer (1.0.2)
97
98
  loofah (~> 2.0)
98
- railties (4.2.4)
99
- actionpack (= 4.2.4)
100
- activesupport (= 4.2.4)
99
+ railties (4.2.5)
100
+ actionpack (= 4.2.5)
101
+ activesupport (= 4.2.5)
101
102
  rake (>= 0.8.7)
102
103
  thor (>= 0.18.1, < 2.0)
103
104
  rake (10.4.2)
@@ -110,13 +111,13 @@ GEM
110
111
  json (~> 1.8)
111
112
  simplecov-html (~> 0.10.0)
112
113
  simplecov-html (0.10.0)
113
- sprockets (3.3.4)
114
- rack (~> 1.0)
114
+ sprockets (3.4.0)
115
+ rack (> 1, < 3)
115
116
  sprockets-rails (2.3.3)
116
117
  actionpack (>= 3.0)
117
118
  activesupport (>= 3.0)
118
119
  sprockets (>= 2.8, < 4.0)
119
- sqlite3 (1.3.10)
120
+ sqlite3 (1.3.11)
120
121
  term-ansicolor (1.3.2)
121
122
  tins (~> 1.0)
122
123
  thor (0.19.1)
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [fontawesomerails]: https://github.com/bokmann/font-awesome-rails
5
5
  [coveralls]: https://coveralls.io/r/blacktangent/tabs_for
6
6
  [rubygems]: https://rubygems.org/gems/tabs_for
7
+ [gemnasium]: https://gemnasium.com/blacktangent/tabs_for
7
8
 
8
9
  # TabsFor
9
10
 
@@ -11,6 +12,7 @@
11
12
  [![Code Climate](https://codeclimate.com/github/blacktangent/tabs_for/badges/gpa.svg)][codeclimate]
12
13
  [![Test Coverage](http://img.shields.io/coveralls/blacktangent/tabs_for/master.svg)][coveralls]
13
14
  [![Gem Version](http://img.shields.io/gem/v/tabs_for.svg)][rubygems]
15
+ [![Dependency Status](https://gemnasium.com/blacktangent/tabs_for.png)][gemnasium]
14
16
 
15
17
  ActiveView Helper for creating tabs with Bootstrap.
16
18
 
@@ -3,9 +3,9 @@ module TabsFor
3
3
  module TabsForHelper
4
4
 
5
5
  def tabs_for(object, &block)
6
- content_tag(:ul, :class => "nav nav-tabs", :role => "tablist") do
6
+ content_tag(:ul, class: 'nav nav-tabs', role: 'tablist') do
7
7
  capture TabBuilder.new(object, self), &block
8
- end + content_tag(:div, :class => "tab-content") do
8
+ end + content_tag(:div, class: 'tab-content') do
9
9
  capture PaneBuilder.new(object, self), &block
10
10
  end
11
11
  end
@@ -16,7 +16,8 @@ module TabsFor
16
16
  attr_accessor :object, :template, :output_buffer
17
17
 
18
18
  def initialize(object, template)
19
- @object, @template = object, template
19
+ @object = object
20
+ @template = template
20
21
  end
21
22
 
22
23
  private
@@ -32,40 +33,44 @@ module TabsFor
32
33
 
33
34
  def tab(attribute, options = {})
34
35
  content = if options[:label]
35
- options.delete(:label)
36
- elsif object.respond_to? attribute
37
- human_name attribute
38
- else
39
- attribute.to_s.titleize
40
- end
36
+ options.delete(:label)
37
+ elsif object.respond_to? attribute
38
+ human_name attribute
39
+ else
40
+ attribute.to_s.titleize
41
+ end
41
42
 
42
43
  options[:id] ||= identifier(attribute)
43
44
 
44
45
  if options[:size]
45
- content += " " + content_tag(:span, options[:size], :class => "badge")
46
+ content += ' ' + content_tag(:span, options[:size], class: 'badge')
46
47
  end
47
48
 
48
49
  content_tag(:li, apply_options(attribute, options)) do
49
- link_to "#" + identifier(attribute), apply_link_options(attribute, options) do
50
- options[:icon] ? wrap_with_icon(content.html_safe, options) : content.html_safe
50
+ link_to '#' + identifier(attribute), apply_link_options(attribute) do
51
+ if options[:icon]
52
+ wrap_with_icon(content.html_safe, options)
53
+ else
54
+ content.html_safe
55
+ end
51
56
  end
52
57
  end
53
58
  end
54
59
 
55
60
  private
56
61
 
57
- def apply_link_options(attribute, options)
62
+ def apply_link_options(attribute)
58
63
  {
59
- "aria-controls" => identifier(attribute),
60
- "data-toggle" => "tab",
61
- :role => "tab",
64
+ 'aria-controls' => identifier(attribute),
65
+ 'data-toggle' => 'tab',
66
+ role: 'tab'
62
67
  }
63
68
  end
64
69
 
65
70
  def apply_options(attribute, options)
66
71
  {
67
- :role => "presentation",
68
- :class => options[:active] ? "active" : nil,
72
+ role: 'presentation',
73
+ class: options[:active] ? 'active' : nil
69
74
  }
70
75
  end
71
76
 
@@ -82,12 +87,12 @@ module TabsFor
82
87
  class PaneBuilder < ViewBuilder
83
88
 
84
89
  def tab(attribute, options = {}, &block)
85
- content = "".html_safe
90
+ content = ''.html_safe
86
91
 
87
92
  if options[:help]
88
93
  content += tag(:br)
89
94
  content += content_tag(:p) do
90
- content_tag(:i, " #{options[:help]}".html_safe, class: "fa fa-info-circle")
95
+ content_tag(:i, " #{options[:help]}".html_safe, class: 'fa fa-info-circle')
91
96
  end
92
97
  end
93
98
 
@@ -100,9 +105,9 @@ module TabsFor
100
105
 
101
106
  def apply_options(attribute, options)
102
107
  {
103
- :role => "tabpanel",
104
- :class => "tab-pane" + (options[:active] ? " active" : ""),
105
- :id => options[:id] ? options[:id] : identifier(attribute),
108
+ role: 'tabpanel',
109
+ class: 'tab-pane' + (options[:active] ? ' active' : ''),
110
+ id: options[:id] ? options[:id] : identifier(attribute)
106
111
  }
107
112
  end
108
113
 
@@ -1,3 +1,3 @@
1
1
  module TabsFor
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabs_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ole J. Rosendahl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails