bh 1.3.4 → 1.3.5
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 +7 -1
- data/CHANGELOG.md +9 -5
- data/README.md +1 -1
- data/bh.gemspec +8 -5
- data/gemfiles/Gemfile.rails-3.x +1 -0
- data/gemfiles/Gemfile.rails-4.x +3 -3
- data/gemfiles/Gemfile.rails-5.x +7 -0
- data/lib/bh/core_ext/rails/form/base_helper.rb +1 -1
- data/lib/bh/version.rb +1 -1
- data/spec/padrino_spec.rb +1 -1
- data/spec/rails/button_to_helper.rb +1 -1
- data/spec/rails/form/field_helper_spec.rb +3 -3
- data/spec/rails/form/submit_helper_spec.rb +2 -2
- data/spec/rails_helper.rb +0 -1
- data/spec/spec_helper.rb +3 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dbec09a6678b044a06696b74f7c18c46f1c9070
|
4
|
+
data.tar.gz: 3a436df4e36cf008209893a402edf43d6183f555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ca0661cd8f9edfd02f43d8370b6935aba98dd5d2335d4aa9e0e072cb348a5dd289fd08625c0d0caaa75096ef3c16929f72556ff3175f4bc3f5796c7883175f9
|
7
|
+
data.tar.gz: 0d094eccbaa4acd9f58f67d5fbb7fba6c2e4cc8a33452b2dbc53fb9f826f29191e550bd588a787ba1988c736f744c3a18be7216d32aca3f16deb0fd3dd603e5f
|
data/.travis.yml
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
notifications:
|
3
3
|
email: true
|
4
|
+
sudo: false
|
4
5
|
matrix:
|
5
6
|
include:
|
6
7
|
- rvm: 1.9.3
|
7
8
|
gemfile: gemfiles/Gemfile.rails-3.x
|
9
|
+
before_install:
|
10
|
+
- gem update --system 2.4.8
|
8
11
|
- rvm: 2.0.0
|
9
|
-
gemfile: gemfiles/Gemfile.rails-4.x
|
12
|
+
gemfile: gemfiles/Gemfile.rails-4.x
|
13
|
+
- rvm: 2.2.4
|
14
|
+
gemfile: gemfiles/Gemfile.rails-5.x
|
15
|
+
env: ONLY_RAILS=true
|
data/CHANGELOG.md
CHANGED
@@ -6,7 +6,11 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
-
## 1.3.
|
9
|
+
## 1.3.5 - 2015-12-18
|
10
|
+
|
11
|
+
* [ENHANCEMENT] Replace `errors.get(:field)` with `errors[:field]` since the former is deprecated in Rails 5.
|
12
|
+
|
13
|
+
## 1.3.4 - 2015-06-23
|
10
14
|
|
11
15
|
* [BUGFIX] Security: don’t always assume that the content of `link_to` is safe
|
12
16
|
|
@@ -18,21 +22,21 @@ link `link_to '<img src="logo.png">', '/'`, then the image will not display
|
|
18
22
|
anymore, since Bh now correctly escapes the HTML content (as Rails and Padrino
|
19
23
|
do). In this case, you should use `link_to image_tag('logo.png'), '/'` instead.
|
20
24
|
|
21
|
-
## 1.3.3 -
|
25
|
+
## 1.3.3 - 2015-03-11
|
22
26
|
|
23
27
|
* [BUGFIX] Correctly align the "X" icon at the right of the field in basic forms
|
24
28
|
|
25
|
-
## 1.3.2 -
|
29
|
+
## 1.3.2 - 2015-03-05
|
26
30
|
|
27
31
|
* [BUGFIX] Respect the original behavior of Padrino/Rails when calling `link_to` with `nil` as the name
|
28
32
|
|
29
|
-
## 1.3.1 -
|
33
|
+
## 1.3.1 - 2015-02-03
|
30
34
|
|
31
35
|
* [BUGFIX] Do not render the `:offset` option of the field helpers in the DOM
|
32
36
|
* [BUGFIX] Do not render the `:label` option of the field helpers in the DOM
|
33
37
|
* [ENHANCEMENT] Add `:label_options` option to customize the wrapping label of a field
|
34
38
|
|
35
|
-
## 1.3.0 -
|
39
|
+
## 1.3.0 - 2015-02-02
|
36
40
|
|
37
41
|
* [FEATURE] Extend `form_for` to be wrapped in <li> when inside a `nav`, just like `link_to`
|
38
42
|
* [FEATURE] Extend `button_to` to be wrapped in <li> when inside a `nav`, just like `link_to`
|
data/README.md
CHANGED
@@ -48,7 +48,7 @@ Bh is compatible with **Rails 3.2**, **Rails 4**, **Padrino** and **Middleman**.
|
|
48
48
|
|
49
49
|
To include the Bh gem in your project:
|
50
50
|
|
51
|
-
1. Add `gem 'bh', '~> 1.
|
51
|
+
1. Add `gem 'bh', '~> 1.3'` to the `Gemfile` file of your Rails, Padrino or Middleman project.
|
52
52
|
2. *Only if you are using Middleman*: open `config.rb` and add `activate :bh`.
|
53
53
|
3. *Only if you are using Padrino*: open `app.rb` and add `register Bh`.
|
54
54
|
|
data/bh.gemspec
CHANGED
@@ -30,12 +30,15 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency 'rake', '~> 10.3'
|
31
31
|
spec.add_development_dependency 'yard', '~> 0.8.7'
|
32
32
|
spec.add_development_dependency 'coveralls', '~> 0.7.1'
|
33
|
+
spec.add_development_dependency 'tins', '~> 1.5.4'
|
33
34
|
spec.add_development_dependency 'activemodel' # versioned in gemfiles/
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
unless ENV['ONLY_RAILS']
|
37
|
+
# For spec/dummy
|
38
|
+
spec.add_development_dependency 'middleman-core' # versioned in gemfiles/
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
-
|
40
|
+
# For Middleman/Padrino tests
|
41
|
+
spec.add_development_dependency 'padrino-helpers', '~> 0.12.4'
|
42
|
+
spec.add_development_dependency 'padrino-routing', '~> 0.5.0'
|
43
|
+
end
|
41
44
|
end
|
data/gemfiles/Gemfile.rails-3.x
CHANGED
data/gemfiles/Gemfile.rails-4.x
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem 'activesupport', '
|
4
|
-
gem 'actionpack', '
|
5
|
-
gem 'activemodel', '
|
3
|
+
gem 'activesupport', '>= 4.0', '< 4.2'
|
4
|
+
gem 'actionpack', '>= 4.0', '< 4.2'
|
5
|
+
gem 'activemodel', '>= 4.0', '< 4.2'
|
6
6
|
gem 'middleman-core', '~> 3.3.0'
|
7
7
|
|
8
8
|
gemspec path: '../'
|
@@ -10,7 +10,7 @@ module Bh
|
|
10
10
|
private
|
11
11
|
|
12
12
|
def base_field(method, field_type, options = {}, &block)
|
13
|
-
errors = (object.errors
|
13
|
+
errors = (object.errors[method] if object) || {}
|
14
14
|
label = label_for method, errors, field_type, options
|
15
15
|
field = field_container(options) do
|
16
16
|
field_tags errors, field_type, options, &block
|
data/lib/bh/version.rb
CHANGED
data/spec/padrino_spec.rb
CHANGED
@@ -9,7 +9,7 @@ end
|
|
9
9
|
|
10
10
|
shared_examples_for 'no button_to options (Rails)' do
|
11
11
|
specify 'uses the original button_to helper' do
|
12
|
-
html = %r{^<form action="/" class="button_to" method="post"
|
12
|
+
html = %r{^<form(?:| action="/") class="button_to" method="post"(?:| action="/")>(?:|<div>)<(input|button) type="submit"(>| value=")content(" />|</button>)(?:|</div>)</form>$}
|
13
13
|
expect(:button_to).to generate html
|
14
14
|
end
|
15
15
|
end
|
@@ -101,21 +101,21 @@ field_helpers_to_test.each do |form_field|
|
|
101
101
|
describe 'given a basic layout' do
|
102
102
|
let(:layout) { :basic }
|
103
103
|
specify 'applies form-group to the container, form-control to the input' do
|
104
|
-
expect(form).to match %r{<div class="form-group"><label.+?>Name</label><(input|textarea) class="form-control"}
|
104
|
+
expect(form).to match %r{<div class="form-group"><label.+?>Name</label><(input|textarea)(?:| placeholder="Name") class="form-control"}
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
108
|
describe 'given a horizontal layout' do
|
109
109
|
let(:layout) { :horizontal }
|
110
110
|
specify 'applies form-group to the container, form-control to the input, col-sm-3.control-label to the label and col-sm-9 to the field container' do
|
111
|
-
expect(form).to match %r{<div class="form-group"><label class="col-sm-3 control-label".+?>Name</label><div class="col-sm-9"><(input|textarea) class="form-control"}
|
111
|
+
expect(form).to match %r{<div class="form-group"><label class="col-sm-3 control-label".+?>Name</label><div class="col-sm-9"><(input|textarea)(?:| placeholder="Name") class="form-control"}
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
115
|
describe 'given an inline layout' do
|
116
116
|
let(:layout) { :inline }
|
117
117
|
specify 'applies form-group to the container, form-control to the input, sr-only to the label' do
|
118
|
-
expect(form).to match %r{<div class="form-group"><label class="sr-only".+?>Name</label><(input|textarea) class="form-control"}
|
118
|
+
expect(form).to match %r{<div class="form-group"><label class="sr-only".+?>Name</label><(input|textarea)(?:| placeholder="Name") class="form-control"}
|
119
119
|
end
|
120
120
|
|
121
121
|
context 'given a help message' do
|
@@ -12,12 +12,12 @@ describe 'submit' do
|
|
12
12
|
let(:layout) { :whatever }
|
13
13
|
|
14
14
|
specify 'applies .btn.btn-primary to the button' do
|
15
|
-
expect(form).to
|
15
|
+
expect(form).to match %r{input.+? class="btn btn-primary"}
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'given a context option, applies the context class' do
|
19
19
|
let(:options) { {context: :info} }
|
20
|
-
it { expect(form).to
|
20
|
+
it { expect(form).to match %r{input.+? class="btn btn-info"} }
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
data/spec/rails_helper.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -10,7 +10,9 @@ SimpleCov.start
|
|
10
10
|
require 'bh'
|
11
11
|
|
12
12
|
Dir['./spec/shared/**/*.rb'].each {|f| require f}
|
13
|
-
|
13
|
+
require './spec/support/matchers.rb'
|
14
|
+
require './spec/support/padrino.rb' unless ENV['ONLY_RAILS']
|
15
|
+
require './spec/support/rails.rb'
|
14
16
|
|
15
17
|
RSpec.configure do |config|
|
16
18
|
config.order = 'random'
|
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.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.7.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: tins
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.5.4
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.5.4
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: activemodel
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,6 +222,7 @@ files:
|
|
208
222
|
- examples/rails/log/.keep
|
209
223
|
- gemfiles/Gemfile.rails-3.x
|
210
224
|
- gemfiles/Gemfile.rails-4.x
|
225
|
+
- gemfiles/Gemfile.rails-5.x
|
211
226
|
- lib/bh.rb
|
212
227
|
- lib/bh/classes/alert_box.rb
|
213
228
|
- lib/bh/classes/base.rb
|
@@ -322,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
337
|
version: '0'
|
323
338
|
requirements: []
|
324
339
|
rubyforge_project:
|
325
|
-
rubygems_version: 2.
|
340
|
+
rubygems_version: 2.5.1
|
326
341
|
signing_key:
|
327
342
|
specification_version: 4
|
328
343
|
summary: Bh provides a set of powerful helpers that streamlines the use of Bootstrap
|