bh 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/CHANGELOG.md +19 -0
- data/README.md +51 -18
- data/bh.gemspec +13 -9
- data/examples/middleman/.gitignore +18 -0
- data/examples/middleman/Gemfile +6 -0
- data/examples/middleman/config.rb +1 -0
- data/examples/middleman/source/index.html.erb +158 -0
- data/examples/padrino/Gemfile +9 -0
- data/examples/padrino/app/app.rb +16 -0
- data/examples/padrino/app/views/index.html.erb +155 -0
- data/examples/padrino/config.ru +5 -0
- data/examples/padrino/config/apps.rb +5 -0
- data/examples/padrino/config/boot.rb +8 -0
- data/examples/rails/.gitignore +12 -0
- data/examples/rails/Gemfile +5 -0
- data/examples/rails/app/controllers/application_controller.rb +6 -0
- data/examples/rails/app/controllers/users_controller.rb +2 -0
- data/examples/rails/app/models/user.rb +15 -0
- data/examples/rails/app/views/application/index.html.erb +160 -0
- data/examples/rails/bin/rails +4 -0
- data/examples/rails/config.ru +4 -0
- data/examples/rails/config/application.rb +12 -0
- data/examples/rails/config/boot.rb +3 -0
- data/examples/rails/config/environment.rb +5 -0
- data/examples/rails/config/environments/development.rb +7 -0
- data/examples/rails/config/routes.rb +4 -0
- data/examples/rails/config/secrets.yml +22 -0
- data/examples/rails/log/.keep +0 -0
- data/gemfiles/Gemfile.rails-3.x +2 -0
- data/gemfiles/Gemfile.rails-4.x +2 -0
- data/lib/bh.rb +15 -4
- data/lib/bh/classes/alert_box.rb +35 -0
- data/lib/bh/classes/base.rb +125 -0
- data/lib/bh/classes/button.rb +58 -0
- data/lib/bh/classes/button_to.rb +33 -0
- data/lib/bh/classes/cdn.rb +35 -0
- data/lib/bh/classes/dropdown.rb +56 -0
- data/lib/bh/classes/icon.rb +34 -0
- data/lib/bh/classes/link_to.rb +22 -0
- data/lib/bh/classes/modal.rb +68 -0
- data/lib/bh/classes/nav.rb +37 -0
- data/lib/bh/classes/navbar.rb +78 -0
- data/lib/bh/classes/panel.rb +72 -0
- data/lib/bh/classes/panel_row.rb +13 -0
- data/lib/bh/classes/progress_bar.rb +89 -0
- data/lib/bh/classes/stack.rb +19 -0
- data/lib/bh/classes/vertical.rb +27 -0
- data/lib/bh/core_ext/middleman.rb +24 -0
- data/lib/bh/core_ext/padrino.rb +25 -0
- data/lib/bh/core_ext/rails/base_helper.rb +21 -0
- data/lib/bh/{helpers → core_ext/rails}/form/base_helper.rb +3 -1
- data/lib/bh/{helpers → core_ext/rails}/form/check_box_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/field_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/fields_for_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/fieldset_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/file_field_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/legend_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/radio_button_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/select_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/static_control_helper.rb +1 -1
- data/lib/bh/{helpers → core_ext/rails}/form/submit_helper.rb +1 -1
- data/lib/bh/{form_builders → core_ext/rails}/form_builder.rb +11 -10
- data/lib/bh/core_ext/rails/form_for_helper.rb +32 -0
- data/lib/bh/core_ext/railtie.rb +27 -0
- data/lib/bh/helpers/alert_box_helper.rb +40 -0
- data/lib/bh/helpers/button_helper.rb +35 -58
- data/lib/bh/helpers/button_to_helper.rb +48 -10
- data/lib/bh/helpers/cdn_helper.rb +11 -35
- data/lib/bh/helpers/dropdown_helper.rb +29 -62
- data/lib/bh/helpers/glyphicon_helper.rb +7 -13
- data/lib/bh/helpers/horizontal_helper.rb +35 -0
- data/lib/bh/helpers/icon_helper.rb +15 -29
- data/lib/bh/helpers/link_to_helper.rb +52 -41
- data/lib/bh/helpers/modal_helper.rb +49 -79
- data/lib/bh/helpers/nav_helper.rb +25 -40
- data/lib/bh/helpers/navbar_helper.rb +36 -170
- data/lib/bh/helpers/panel_helper.rb +45 -72
- data/lib/bh/helpers/panel_row_helper.rb +20 -38
- data/lib/bh/helpers/progress_bar_helper.rb +48 -59
- data/lib/bh/helpers/vertical_helper.rb +33 -0
- data/lib/bh/version.rb +1 -1
- data/lib/bh/views/bh/_alert_dismiss_button.html +4 -0
- data/lib/bh/views/bh/_dropdown.html.erb +5 -5
- data/lib/bh/views/bh/_dropdown_split.html.erb +5 -5
- data/lib/bh/views/bh/_modal.html.erb +5 -8
- data/lib/bh/views/bh/_navbar.html.erb +5 -0
- data/spec/padrino/button_to_helper.rb +35 -0
- data/spec/padrino_spec.rb +28 -0
- data/spec/rails/button_to_helper.rb +31 -0
- data/spec/{helpers → rails}/form/check_box_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/field_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/fields_for_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/fieldset_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/file_field_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/legend_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/radio_button_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/select_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/static_control_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form/submit_helper_spec.rb +3 -3
- data/spec/{helpers → rails}/form_for_helper_spec.rb +3 -3
- data/spec/rails_helper.rb +25 -0
- data/spec/rails_spec.rb +28 -0
- data/spec/shared/alert_box_helper.rb +62 -0
- data/spec/shared/button_helper.rb +52 -0
- data/spec/shared/button_to_helper.rb +42 -0
- data/spec/shared/cdn_helper.rb +36 -0
- data/spec/shared/dropdown_helper.rb +112 -0
- data/spec/shared/glyphicon_helper.rb +21 -0
- data/spec/shared/horizontal_helper.rb +37 -0
- data/spec/shared/icon_helper.rb +31 -0
- data/spec/shared/link_to_helper.rb +62 -0
- data/spec/shared/modal_helper.rb +104 -0
- data/spec/shared/nav_helper.rb +49 -0
- data/spec/shared/navbar_helper.rb +63 -0
- data/spec/shared/panel_helper.rb +76 -0
- data/spec/shared/panel_row_helper.rb +21 -0
- data/spec/shared/progress_bar_helper.rb +103 -0
- data/spec/shared/vertical_helper.rb +43 -0
- data/spec/spec_helper.rb +6 -29
- data/spec/support/matchers.rb +38 -0
- data/spec/support/padrino.rb +33 -0
- data/spec/support/rails.rb +27 -0
- metadata +183 -94
- data/config.rb +0 -6
- data/lib/bh/helpers/alert_helper.rb +0 -77
- data/lib/bh/helpers/base_helper.rb +0 -39
- data/lib/bh/helpers/form_for_helper.rb +0 -30
- data/lib/bh/middleman.rb +0 -39
- data/lib/bh/railtie.rb +0 -42
- data/spec/dummy/index.html.erb +0 -60
- data/spec/dummy/layouts/default.erb +0 -17
- data/spec/helpers/alert_helper_spec.rb +0 -84
- data/spec/helpers/button_helper_spec.rb +0 -100
- data/spec/helpers/button_to_helper_spec.rb +0 -25
- data/spec/helpers/cdn_helper_spec.rb +0 -100
- data/spec/helpers/dropdown_helper_spec.rb +0 -146
- data/spec/helpers/glyphicon_helper_spec.rb +0 -21
- data/spec/helpers/icon_helper_spec.rb +0 -45
- data/spec/helpers/link_to_helper_spec.rb +0 -124
- data/spec/helpers/modal_helper_spec.rb +0 -133
- data/spec/helpers/nav_helper_spec.rb +0 -53
- data/spec/helpers/navbar_helper_spec.rb +0 -194
- data/spec/helpers/panel_helper_spec.rb +0 -95
- data/spec/helpers/panel_row_helper_spec.rb +0 -27
- data/spec/helpers/progress_bar_helper_spec.rb +0 -114
@@ -0,0 +1,21 @@
|
|
1
|
+
shared_examples_for 'the panel_row helper' do
|
2
|
+
all_tests_pass_with 'no panel_row options'
|
3
|
+
all_tests_pass_with 'extra panel_row options'
|
4
|
+
end
|
5
|
+
|
6
|
+
#--
|
7
|
+
|
8
|
+
shared_examples_for 'no panel_row options' do
|
9
|
+
specify 'displays an <div> with class="row"' do
|
10
|
+
html = '<div class="row">content</div>'
|
11
|
+
expect(:panel_row).to generate html
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
shared_examples_for 'extra panel_row options' do
|
16
|
+
specify 'passes the options to the <div>' do
|
17
|
+
options = {class: 'important', data: {value: 1}, id: 'my-panel-row'}
|
18
|
+
html = '<div class="important row" data-value="1" id="my-panel-row">content</div>'
|
19
|
+
expect(panel_row: options).to generate html
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
shared_examples_for 'the progress_bar helper' do
|
2
|
+
all_tests_pass_with 'no progress_bar options'
|
3
|
+
all_tests_pass_with 'extra progress_bar container options'
|
4
|
+
all_tests_pass_with 'extra progress_bar bar options'
|
5
|
+
all_tests_pass_with 'the :percentage progress_bar option'
|
6
|
+
all_tests_pass_with 'the :label progress_bar option'
|
7
|
+
all_tests_pass_with 'the :context progress_bar option'
|
8
|
+
all_tests_pass_with 'the :striped progress_bar option'
|
9
|
+
all_tests_pass_with 'the :animated progress_bar option'
|
10
|
+
all_tests_pass_with 'an array of progress_bar options'
|
11
|
+
end
|
12
|
+
|
13
|
+
#--
|
14
|
+
|
15
|
+
shared_examples_for 'no progress_bar options' do
|
16
|
+
specify 'displays an empty progress <div>' do
|
17
|
+
html = '<div class="progress"></div>'
|
18
|
+
expect(:progress_bar).to generate html
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
shared_examples_for 'extra progress_bar container options' do
|
23
|
+
specify 'passes the options to the <div>' do
|
24
|
+
options = {class: 'important', data: {value: 1}, id: 'my-progress-bars'}
|
25
|
+
html = '<div class="important progress" data-value="1" id="my-progress-bars"></div>'
|
26
|
+
expect(progress_bar: [nil, options]).to generate html
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
shared_examples_for 'extra progress_bar bar options' do
|
31
|
+
specify 'passes the options to the bar <div>' do
|
32
|
+
bar = {class: 'important', data: {value: 1}, id: 'my-progress-bar'}
|
33
|
+
html = %r{<div.*class="important progress-bar" data-value="1" id="my-progress-bar".*role="progressbar"}
|
34
|
+
expect(progress_bar: bar).to generate html
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
shared_examples_for 'the :percentage progress_bar option' do
|
39
|
+
specify 'displays one progress bar for the given value' do
|
40
|
+
html = '<div class="progress"><div aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" class="progress-bar" role="progressbar" style="width: 30%"><span class="sr-only">30%</span></div></div>'
|
41
|
+
expect(progress_bar: {percentage: 30}).to generate html
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
shared_examples_for 'the :label progress_bar option' do
|
46
|
+
specify 'set to false, hides the label' do
|
47
|
+
html = %r{<div.+><span class="sr-only">30%<\/span>}
|
48
|
+
expect(progress_bar: {percentage: 30, label: false}).to generate html
|
49
|
+
end
|
50
|
+
|
51
|
+
specify 'set to true, displays an auto-generated the label' do
|
52
|
+
html = %r{<div.+>30%<\/div>}
|
53
|
+
expect(progress_bar: {percentage: 30, label: true}).to generate html
|
54
|
+
end
|
55
|
+
|
56
|
+
specify 'set to a string, displays the string as the label' do
|
57
|
+
html = %r{<div.+>Thirty<\/div>}
|
58
|
+
expect(progress_bar: {percentage: 30, label: 'Thirty'}).to generate html
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
shared_examples_for 'the :context progress_bar option' do
|
63
|
+
Bh::ProgressBar.contexts.each do |context, context_class|
|
64
|
+
specify %Q{set to :#{context}, adds the class "#{context_class}"} do
|
65
|
+
html = %r{<div.+class="progress-bar #{context_class}"}
|
66
|
+
expect(progress_bar: {percentage: 30, context: context}).to generate html
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
shared_examples_for 'the :striped progress_bar option' do
|
72
|
+
specify 'set to false, displays a solid color bar' do
|
73
|
+
html = %r{<div.+class="progress-bar"}
|
74
|
+
expect(progress_bar: {percentage: 30, striped: false}).to generate html
|
75
|
+
end
|
76
|
+
|
77
|
+
specify 'set to true, displays a striped color bar' do
|
78
|
+
html = %r{<div.+class="progress-bar progress-bar-striped"}
|
79
|
+
expect(progress_bar: {percentage: 30, striped: true}).to generate html
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
shared_examples_for 'the :animated progress_bar option' do
|
84
|
+
specify 'set to false, displays a static bar' do
|
85
|
+
html = %r{<div.+class="progress-bar"}
|
86
|
+
expect(progress_bar: {percentage: 30, animated: false}).to generate html
|
87
|
+
end
|
88
|
+
|
89
|
+
specify 'set to true, displays an animated striped bar' do
|
90
|
+
html = %r{<div.+class="progress-bar progress-bar-striped active"}
|
91
|
+
expect(progress_bar: {percentage: 30, animated: true}).to generate html
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
shared_examples_for 'an array of progress_bar options' do
|
96
|
+
specify 'displays a group of stacked progress bars with their options' do
|
97
|
+
bar_1 = '<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="30" class="progress-bar" role="progressbar" style="width: 30%"><span class="sr-only">30%</span></div>'
|
98
|
+
bar_2 = '<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="40" class="progress-bar" role="progressbar" style="width: 40%"><span class="sr-only">40%</span></div>'
|
99
|
+
html = %Q{<div class="progress">#{bar_1}\n#{bar_2}</div>}
|
100
|
+
bars = [{percentage: 30}, {percentage: 40}]
|
101
|
+
expect(progress_bar: [bars, {}]).to generate html
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
shared_examples_for 'the vertical helper' do
|
2
|
+
all_tests_pass_with 'the vertical not wrapped in navbar'
|
3
|
+
all_tests_pass_with 'no vertical options'
|
4
|
+
all_tests_pass_with 'extra vertical options'
|
5
|
+
all_tests_pass_with 'the vertical wrapped in a navbar with :id'
|
6
|
+
end
|
7
|
+
|
8
|
+
#--
|
9
|
+
|
10
|
+
shared_examples_for 'the vertical not wrapped in navbar' do
|
11
|
+
specify 'returns nil' do
|
12
|
+
expect(:vertical).to generate nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
shared_examples_for 'no vertical options' do
|
17
|
+
specify 'creates a <div> element with the "navbar-header" class and toggle button' do
|
18
|
+
html = <<-EOT.strip_heredoc.strip
|
19
|
+
<div class="navbar-header"><button class="navbar-toggle" data-target="#(.+)" data-toggle="collapse" type="button"><span class="sr-only">Toggle navigation</span>
|
20
|
+
<span class="icon-bar"></span>
|
21
|
+
<span class="icon-bar"></span>
|
22
|
+
<span class="icon-bar"></span></button>
|
23
|
+
content</div>
|
24
|
+
EOT
|
25
|
+
bh.navbar { expect(:vertical).to generate %r{#{html}} }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
shared_examples_for 'extra vertical options' do
|
30
|
+
specify 'passes the options to the <div> element' do
|
31
|
+
options = {class: 'important', data: {value: 1}, id: 'my-navbar-header'}
|
32
|
+
html = %r{<div class="important navbar-header" data-value="1" id="my-navbar-header">}
|
33
|
+
bh.navbar { expect(vertical: options).to generate html }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
shared_examples_for 'the vertical wrapped in a navbar with :id' do
|
38
|
+
it 'uses the id from the navbar' do
|
39
|
+
id = 'my-navbar'
|
40
|
+
html = %r{button class="navbar-toggle" data-target="##{id}"}
|
41
|
+
bh.navbar(id: id) { expect(:vertical).to generate html}
|
42
|
+
end
|
43
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -7,37 +7,14 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
7
7
|
]
|
8
8
|
SimpleCov.start
|
9
9
|
|
10
|
+
require 'bh'
|
11
|
+
|
12
|
+
Dir['./spec/shared/**/*.rb'].each {|f| require f}
|
10
13
|
Dir['./spec/support/**/*.rb'].each {|f| require f}
|
11
14
|
|
12
15
|
RSpec.configure do |config|
|
13
16
|
config.order = 'random'
|
14
17
|
config.run_all_when_everything_filtered = false
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
require 'active_model'
|
19
|
-
require 'active_support/all'
|
20
|
-
|
21
|
-
include ActiveModel::Validations
|
22
|
-
include ActiveModel::Conversion
|
23
|
-
extend ActiveModel::Naming
|
24
|
-
|
25
|
-
attr_accessor :name
|
26
|
-
|
27
|
-
def initialize(attributes = {})
|
28
|
-
@name = attributes[:name]
|
29
|
-
end
|
30
|
-
|
31
|
-
def persisted?
|
32
|
-
false
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
require 'action_view'
|
37
|
-
include ActionView::Helpers::FormOptionsHelper
|
38
|
-
if defined?(ActionView::VERSION) # only defined in ActionView >=4
|
39
|
-
include ActionView::RecordIdentifier
|
40
|
-
else
|
41
|
-
include ActionController::RecordIdentifier
|
42
|
-
end
|
43
|
-
I18n.enforce_available_locales = true
|
18
|
+
config.alias_it_should_behave_like_to :all_tests_pass_for, ''
|
19
|
+
config.alias_it_should_behave_like_to :all_tests_pass_with, 'with'
|
20
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
RSpec::Matchers.define :generate do |html|
|
2
|
+
match do |helper, options = nil|
|
3
|
+
if helper.is_a?(Hash)
|
4
|
+
helper, options = helper.keys.first, helper.values.first
|
5
|
+
end
|
6
|
+
|
7
|
+
if helper == :link_to || helper == :button_to
|
8
|
+
@inline = bh.send helper, *['content', '/', options].compact
|
9
|
+
if bh.test_button_to_with_block
|
10
|
+
@block = bh.send(helper, *['/', options].compact) { 'content' }
|
11
|
+
else
|
12
|
+
@block = @inline
|
13
|
+
end
|
14
|
+
elsif helper == :dropdown
|
15
|
+
@block = bh.send(helper, *['caption', options].compact) { 'content' }
|
16
|
+
@inline = @block
|
17
|
+
elsif helper == :glyphicon || helper == :icon
|
18
|
+
@inline = bh.send helper, *['zoom-in', options].compact
|
19
|
+
@block = bh.send helper, *[:zoom_in, options].compact
|
20
|
+
elsif helper == :progress_bar
|
21
|
+
@inline = bh.send helper, *Array.wrap(options)
|
22
|
+
@block = @inline
|
23
|
+
elsif helper == :navbar || helper == :nav || helper == :panel_row
|
24
|
+
@block = bh.send(helper, *[options].compact) { 'content' }
|
25
|
+
@inline = @block
|
26
|
+
else
|
27
|
+
@inline = bh.send helper, *['content', options].compact
|
28
|
+
@block = bh.send(helper, *[options].compact) { 'content' }
|
29
|
+
end
|
30
|
+
|
31
|
+
case html
|
32
|
+
when Regexp then @inline.match(html) && @block.match(html)
|
33
|
+
else @inline.eql?(html) && @block.eql?(html)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
failure_message{|actual| "expected #{html}, got #{@inline} and #{@block}"}
|
38
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'tilt'
|
2
|
+
require 'padrino-helpers'
|
3
|
+
require 'padrino-routing'
|
4
|
+
|
5
|
+
# A view that behaves like a Padrino view
|
6
|
+
class PadrinoView
|
7
|
+
include Padrino::Helpers::OutputHelpers # for capture
|
8
|
+
include Padrino::Helpers::TagHelpers # for content_tag
|
9
|
+
include Padrino::Helpers::AssetTagHelpers # for link_to
|
10
|
+
include Padrino::Helpers::FormHelpers # for button_to
|
11
|
+
include Padrino::Routing::Helpers # for url_for
|
12
|
+
include Bh::Helpers
|
13
|
+
|
14
|
+
def self.app_name
|
15
|
+
'test'
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.named_paths
|
19
|
+
{[:test, "/"] => '/'}
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.uri_root
|
23
|
+
'/'
|
24
|
+
end
|
25
|
+
|
26
|
+
def request
|
27
|
+
Rack::Request.new 'REQUEST_METHOD' => 'GET'
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_button_to_with_block
|
31
|
+
false
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'action_dispatch'
|
2
|
+
require 'action_view'
|
3
|
+
|
4
|
+
# A view that behaves like a Rails/ActionView view
|
5
|
+
class RailsView
|
6
|
+
include ActionView::Context # for capture
|
7
|
+
include ActionView::Helpers::RenderingHelper # for render
|
8
|
+
include ActionView::Helpers::TagHelper # for content_tag
|
9
|
+
include ActionView::Helpers::UrlHelper # for link_to
|
10
|
+
|
11
|
+
include Bh::Helpers
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
end
|
15
|
+
|
16
|
+
def request
|
17
|
+
ActionDispatch::Request.new 'REQUEST_METHOD' => 'GET'
|
18
|
+
end
|
19
|
+
|
20
|
+
def protect_against_forgery?
|
21
|
+
false
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_button_to_with_block
|
25
|
+
true
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -42,72 +42,72 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '10.3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '10.3'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: yard
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.8.7
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.8.7
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: coveralls
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.7.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.7.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: activemodel
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,34 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: padrino-helpers
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.12.4
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.12.4
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: padrino-routing
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.5.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.5.0
|
139
167
|
description: Bh - Bootstrap Helpers
|
140
168
|
email:
|
141
169
|
- claudio@fullscreen.net
|
@@ -153,30 +181,74 @@ files:
|
|
153
181
|
- README.md
|
154
182
|
- Rakefile
|
155
183
|
- bh.gemspec
|
156
|
-
-
|
184
|
+
- examples/middleman/.gitignore
|
185
|
+
- examples/middleman/Gemfile
|
186
|
+
- examples/middleman/config.rb
|
187
|
+
- examples/middleman/source/index.html.erb
|
188
|
+
- examples/padrino/Gemfile
|
189
|
+
- examples/padrino/app/app.rb
|
190
|
+
- examples/padrino/app/views/index.html.erb
|
191
|
+
- examples/padrino/config.ru
|
192
|
+
- examples/padrino/config/apps.rb
|
193
|
+
- examples/padrino/config/boot.rb
|
194
|
+
- examples/rails/.gitignore
|
195
|
+
- examples/rails/Gemfile
|
196
|
+
- examples/rails/app/controllers/application_controller.rb
|
197
|
+
- examples/rails/app/controllers/users_controller.rb
|
198
|
+
- examples/rails/app/models/user.rb
|
199
|
+
- examples/rails/app/views/application/index.html.erb
|
200
|
+
- examples/rails/bin/rails
|
201
|
+
- examples/rails/config.ru
|
202
|
+
- examples/rails/config/application.rb
|
203
|
+
- examples/rails/config/boot.rb
|
204
|
+
- examples/rails/config/environment.rb
|
205
|
+
- examples/rails/config/environments/development.rb
|
206
|
+
- examples/rails/config/routes.rb
|
207
|
+
- examples/rails/config/secrets.yml
|
208
|
+
- examples/rails/log/.keep
|
157
209
|
- gemfiles/Gemfile.rails-3.x
|
158
210
|
- gemfiles/Gemfile.rails-4.x
|
159
211
|
- lib/bh.rb
|
160
|
-
- lib/bh/
|
161
|
-
- lib/bh/
|
162
|
-
- lib/bh/
|
212
|
+
- lib/bh/classes/alert_box.rb
|
213
|
+
- lib/bh/classes/base.rb
|
214
|
+
- lib/bh/classes/button.rb
|
215
|
+
- lib/bh/classes/button_to.rb
|
216
|
+
- lib/bh/classes/cdn.rb
|
217
|
+
- lib/bh/classes/dropdown.rb
|
218
|
+
- lib/bh/classes/icon.rb
|
219
|
+
- lib/bh/classes/link_to.rb
|
220
|
+
- lib/bh/classes/modal.rb
|
221
|
+
- lib/bh/classes/nav.rb
|
222
|
+
- lib/bh/classes/navbar.rb
|
223
|
+
- lib/bh/classes/panel.rb
|
224
|
+
- lib/bh/classes/panel_row.rb
|
225
|
+
- lib/bh/classes/progress_bar.rb
|
226
|
+
- lib/bh/classes/stack.rb
|
227
|
+
- lib/bh/classes/vertical.rb
|
228
|
+
- lib/bh/core_ext/middleman.rb
|
229
|
+
- lib/bh/core_ext/padrino.rb
|
230
|
+
- lib/bh/core_ext/rails/base_helper.rb
|
231
|
+
- lib/bh/core_ext/rails/form/base_helper.rb
|
232
|
+
- lib/bh/core_ext/rails/form/check_box_helper.rb
|
233
|
+
- lib/bh/core_ext/rails/form/field_helper.rb
|
234
|
+
- lib/bh/core_ext/rails/form/fields_for_helper.rb
|
235
|
+
- lib/bh/core_ext/rails/form/fieldset_helper.rb
|
236
|
+
- lib/bh/core_ext/rails/form/file_field_helper.rb
|
237
|
+
- lib/bh/core_ext/rails/form/legend_helper.rb
|
238
|
+
- lib/bh/core_ext/rails/form/radio_button_helper.rb
|
239
|
+
- lib/bh/core_ext/rails/form/select_helper.rb
|
240
|
+
- lib/bh/core_ext/rails/form/static_control_helper.rb
|
241
|
+
- lib/bh/core_ext/rails/form/submit_helper.rb
|
242
|
+
- lib/bh/core_ext/rails/form_builder.rb
|
243
|
+
- lib/bh/core_ext/rails/form_for_helper.rb
|
244
|
+
- lib/bh/core_ext/railtie.rb
|
245
|
+
- lib/bh/helpers/alert_box_helper.rb
|
163
246
|
- lib/bh/helpers/button_helper.rb
|
164
247
|
- lib/bh/helpers/button_to_helper.rb
|
165
248
|
- lib/bh/helpers/cdn_helper.rb
|
166
249
|
- lib/bh/helpers/dropdown_helper.rb
|
167
|
-
- lib/bh/helpers/form/base_helper.rb
|
168
|
-
- lib/bh/helpers/form/check_box_helper.rb
|
169
|
-
- lib/bh/helpers/form/field_helper.rb
|
170
|
-
- lib/bh/helpers/form/fields_for_helper.rb
|
171
|
-
- lib/bh/helpers/form/fieldset_helper.rb
|
172
|
-
- lib/bh/helpers/form/file_field_helper.rb
|
173
|
-
- lib/bh/helpers/form/legend_helper.rb
|
174
|
-
- lib/bh/helpers/form/radio_button_helper.rb
|
175
|
-
- lib/bh/helpers/form/select_helper.rb
|
176
|
-
- lib/bh/helpers/form/static_control_helper.rb
|
177
|
-
- lib/bh/helpers/form/submit_helper.rb
|
178
|
-
- lib/bh/helpers/form_for_helper.rb
|
179
250
|
- lib/bh/helpers/glyphicon_helper.rb
|
251
|
+
- lib/bh/helpers/horizontal_helper.rb
|
180
252
|
- lib/bh/helpers/icon_helper.rb
|
181
253
|
- lib/bh/helpers/link_to_helper.rb
|
182
254
|
- lib/bh/helpers/modal_helper.rb
|
@@ -185,40 +257,49 @@ files:
|
|
185
257
|
- lib/bh/helpers/panel_helper.rb
|
186
258
|
- lib/bh/helpers/panel_row_helper.rb
|
187
259
|
- lib/bh/helpers/progress_bar_helper.rb
|
188
|
-
- lib/bh/
|
189
|
-
- lib/bh/railtie.rb
|
260
|
+
- lib/bh/helpers/vertical_helper.rb
|
190
261
|
- lib/bh/version.rb
|
262
|
+
- lib/bh/views/bh/_alert_dismiss_button.html
|
191
263
|
- lib/bh/views/bh/_dropdown.html.erb
|
192
264
|
- lib/bh/views/bh/_dropdown_split.html.erb
|
193
265
|
- lib/bh/views/bh/_modal.html.erb
|
194
|
-
-
|
195
|
-
- spec/
|
196
|
-
- spec/
|
197
|
-
- spec/
|
198
|
-
- spec/
|
199
|
-
- spec/
|
200
|
-
- spec/
|
201
|
-
- spec/
|
202
|
-
- spec/
|
203
|
-
- spec/
|
204
|
-
- spec/
|
205
|
-
- spec/
|
206
|
-
- spec/
|
207
|
-
- spec/
|
208
|
-
- spec/
|
209
|
-
- spec/
|
210
|
-
- spec/
|
211
|
-
- spec/
|
212
|
-
- spec/
|
213
|
-
- spec/
|
214
|
-
- spec/
|
215
|
-
- spec/
|
216
|
-
- spec/
|
217
|
-
- spec/
|
218
|
-
- spec/
|
219
|
-
- spec/
|
220
|
-
- spec/
|
266
|
+
- lib/bh/views/bh/_navbar.html.erb
|
267
|
+
- spec/padrino/button_to_helper.rb
|
268
|
+
- spec/padrino_spec.rb
|
269
|
+
- spec/rails/button_to_helper.rb
|
270
|
+
- spec/rails/form/check_box_helper_spec.rb
|
271
|
+
- spec/rails/form/field_helper_spec.rb
|
272
|
+
- spec/rails/form/fields_for_helper_spec.rb
|
273
|
+
- spec/rails/form/fieldset_helper_spec.rb
|
274
|
+
- spec/rails/form/file_field_helper_spec.rb
|
275
|
+
- spec/rails/form/legend_helper_spec.rb
|
276
|
+
- spec/rails/form/radio_button_helper_spec.rb
|
277
|
+
- spec/rails/form/select_helper_spec.rb
|
278
|
+
- spec/rails/form/static_control_helper_spec.rb
|
279
|
+
- spec/rails/form/submit_helper_spec.rb
|
280
|
+
- spec/rails/form_for_helper_spec.rb
|
281
|
+
- spec/rails_helper.rb
|
282
|
+
- spec/rails_spec.rb
|
283
|
+
- spec/shared/alert_box_helper.rb
|
284
|
+
- spec/shared/button_helper.rb
|
285
|
+
- spec/shared/button_to_helper.rb
|
286
|
+
- spec/shared/cdn_helper.rb
|
287
|
+
- spec/shared/dropdown_helper.rb
|
288
|
+
- spec/shared/glyphicon_helper.rb
|
289
|
+
- spec/shared/horizontal_helper.rb
|
290
|
+
- spec/shared/icon_helper.rb
|
291
|
+
- spec/shared/link_to_helper.rb
|
292
|
+
- spec/shared/modal_helper.rb
|
293
|
+
- spec/shared/nav_helper.rb
|
294
|
+
- spec/shared/navbar_helper.rb
|
295
|
+
- spec/shared/panel_helper.rb
|
296
|
+
- spec/shared/panel_row_helper.rb
|
297
|
+
- spec/shared/progress_bar_helper.rb
|
298
|
+
- spec/shared/vertical_helper.rb
|
221
299
|
- spec/spec_helper.rb
|
300
|
+
- spec/support/matchers.rb
|
301
|
+
- spec/support/padrino.rb
|
302
|
+
- spec/support/rails.rb
|
222
303
|
homepage: http://github.com/Fullscreen/bh
|
223
304
|
licenses:
|
224
305
|
- MIT
|
@@ -245,32 +326,40 @@ specification_version: 4
|
|
245
326
|
summary: Bh provides a set of powerful helpers that streamlines the use of Bootstrap
|
246
327
|
components in Rails views.
|
247
328
|
test_files:
|
248
|
-
- spec/
|
249
|
-
- spec/
|
250
|
-
- spec/
|
251
|
-
- spec/
|
252
|
-
- spec/
|
253
|
-
- spec/
|
254
|
-
- spec/
|
255
|
-
- spec/
|
256
|
-
- spec/
|
257
|
-
- spec/
|
258
|
-
- spec/
|
259
|
-
- spec/
|
260
|
-
- spec/
|
261
|
-
- spec/
|
262
|
-
- spec/
|
263
|
-
- spec/
|
264
|
-
- spec/
|
265
|
-
- spec/
|
266
|
-
- spec/
|
267
|
-
- spec/
|
268
|
-
- spec/
|
269
|
-
- spec/
|
270
|
-
- spec/
|
271
|
-
- spec/
|
272
|
-
- spec/
|
273
|
-
- spec/
|
274
|
-
- spec/
|
329
|
+
- spec/padrino/button_to_helper.rb
|
330
|
+
- spec/padrino_spec.rb
|
331
|
+
- spec/rails/button_to_helper.rb
|
332
|
+
- spec/rails/form/check_box_helper_spec.rb
|
333
|
+
- spec/rails/form/field_helper_spec.rb
|
334
|
+
- spec/rails/form/fields_for_helper_spec.rb
|
335
|
+
- spec/rails/form/fieldset_helper_spec.rb
|
336
|
+
- spec/rails/form/file_field_helper_spec.rb
|
337
|
+
- spec/rails/form/legend_helper_spec.rb
|
338
|
+
- spec/rails/form/radio_button_helper_spec.rb
|
339
|
+
- spec/rails/form/select_helper_spec.rb
|
340
|
+
- spec/rails/form/static_control_helper_spec.rb
|
341
|
+
- spec/rails/form/submit_helper_spec.rb
|
342
|
+
- spec/rails/form_for_helper_spec.rb
|
343
|
+
- spec/rails_helper.rb
|
344
|
+
- spec/rails_spec.rb
|
345
|
+
- spec/shared/alert_box_helper.rb
|
346
|
+
- spec/shared/button_helper.rb
|
347
|
+
- spec/shared/button_to_helper.rb
|
348
|
+
- spec/shared/cdn_helper.rb
|
349
|
+
- spec/shared/dropdown_helper.rb
|
350
|
+
- spec/shared/glyphicon_helper.rb
|
351
|
+
- spec/shared/horizontal_helper.rb
|
352
|
+
- spec/shared/icon_helper.rb
|
353
|
+
- spec/shared/link_to_helper.rb
|
354
|
+
- spec/shared/modal_helper.rb
|
355
|
+
- spec/shared/nav_helper.rb
|
356
|
+
- spec/shared/navbar_helper.rb
|
357
|
+
- spec/shared/panel_helper.rb
|
358
|
+
- spec/shared/panel_row_helper.rb
|
359
|
+
- spec/shared/progress_bar_helper.rb
|
360
|
+
- spec/shared/vertical_helper.rb
|
275
361
|
- spec/spec_helper.rb
|
362
|
+
- spec/support/matchers.rb
|
363
|
+
- spec/support/padrino.rb
|
364
|
+
- spec/support/rails.rb
|
276
365
|
has_rdoc:
|