foundation_rails_helper 2.0.0 → 4.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: eaf080baa48830a883681c55c892a30b366deabc
4
- data.tar.gz: 84a7e2dd8b70cbbe2b622a41bc9d3500bae8f396
2
+ SHA256:
3
+ metadata.gz: c5962c4414ac022cb6a63fb5434372336432cf09de65ab351cd70e9c14c58aba
4
+ data.tar.gz: f50f71a68f51ce4bb94ba4ed11a826460b4fc6de56555cfb9c8bbe8806798fd2
5
5
  SHA512:
6
- metadata.gz: b578327401357039bf3ec51d10c45c86f36183f86f682ea0b303c181da14278a7a3f4de4223c92c7c451d7dccba539eec8e7799c490c855bc7a9eabd7b70cfbc
7
- data.tar.gz: b8d41f62ad350069855247e1bdc1672c6ae08d549424768123dd67500e79eb5e1bcea1dbe820ef4e79822ec04a251f6eddf67cdde003c40bbc28e3fb725fbdbf
6
+ metadata.gz: 856f10ab7f85bb7890215c1904458aa929d560f7fea557e9a18fb0d0ec7aa9564beae795f4e443cbec7746923db2687df16b270b1dcb6a8b4fac92fd0385dfb6
7
+ data.tar.gz: 9df3bef01064d042534444257f31723367742fec84d41265bd7a40bf7d5a974475fb1a7475b7e45e859b2840d3c360aa3cd69d8d5c8f4d29d471f0daed3fda29
@@ -9,11 +9,8 @@ AllCops:
9
9
  Exclude:
10
10
  - 'vendor/**/*'
11
11
 
12
- # A quick fix for not having magic comments at the top of each file
13
- # # frozen_string_literal: true
14
- # https://github.com/bbatsov/rubocop/issues/3284
15
- FrozenStringLiteralComment:
16
- Enabled: false
17
-
18
12
  Documentation:
19
13
  Enabled: false
14
+
15
+ Style/VariableNumber:
16
+ EnforcedStyle: 'snake_case'
@@ -1,67 +1,25 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-09-14 16:08:41 -0700 using RuboCop version 0.42.0.
3
+ # on 2017-01-13 13:27:28 -0800 using RuboCop version 0.44.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
10
- Lint/NestedMethodDefinition:
11
- Exclude:
12
- - 'spec/support/mock_rails.rb'
13
-
14
- # Offense count: 3
9
+ # Offense count: 1
15
10
  Metrics/AbcSize:
16
- Max: 179
11
+ Max: 17
17
12
 
18
13
  # Offense count: 1
19
14
  # Configuration parameters: CountComments.
20
15
  Metrics/ClassLength:
21
- Max: 186
16
+ Max: 183
22
17
 
23
18
  # Offense count: 1
24
19
  Metrics/CyclomaticComplexity:
25
20
  Max: 7
26
21
 
27
- # Offense count: 157
28
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
29
- # URISchemes: http, https
30
- Metrics/LineLength:
31
- Max: 163
32
-
33
- # Offense count: 5
34
- # Configuration parameters: CountComments.
35
- Metrics/MethodLength:
36
- Max: 55
37
-
38
22
  # Offense count: 1
39
23
  # Configuration parameters: CountComments.
40
- Metrics/ModuleLength:
41
- Max: 102
42
-
43
- # Offense count: 2
44
- # Configuration parameters: CountKeywordArgs.
45
- Metrics/ParameterLists:
46
- Max: 8
47
-
48
- # Offense count: 1
49
- Metrics/PerceivedComplexity:
50
- Max: 8
51
-
52
- # Offense count: 3
53
- # Configuration parameters: EnforcedStyle, SupportedStyles.
54
- # SupportedStyles: nested, compact
55
- Style/ClassAndModuleChildren:
56
- Exclude:
57
- - 'spec/support/mock_rails.rb'
58
-
59
- # Offense count: 1
60
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
61
- # NamePrefix: is_, has_, have_
62
- # NamePrefixBlacklist: is_, has_, have_
63
- # NameWhitelist: is_a?
64
- Style/PredicateName:
65
- Exclude:
66
- - 'spec/**/*'
67
- - 'lib/foundation_rails_helper/form_builder.rb'
24
+ Metrics/MethodLength:
25
+ Max: 13
@@ -3,20 +3,38 @@ branches:
3
3
  only:
4
4
  - master
5
5
  rvm:
6
- - 2.1.9
7
- - 2.2.5
8
- - 2.3.1
9
- - 2.4.0-preview1
6
+ - 2.3.8
7
+ - 2.4.10
8
+ - 2.5.8
9
+ - 2.6.6
10
+ - 2.7.2
10
11
  env:
11
- - "RAILS_VERSION=4.1.0"
12
12
  - "RAILS_VERSION=4.2.0"
13
13
  - "RAILS_VERSION=5.0.0"
14
- matrix:
14
+ - "RAILS_VERSION=5.2.0"
15
+ - "RAILS_VERSION=6.0.0"
16
+ - "RAILS_VERSION=6.1.0"
17
+ jobs:
15
18
  exclude:
16
- - rvm: 2.1.9
19
+ - rvm: 2.4.10
20
+ env: "RAILS_VERSION=6.1.0"
21
+ - rvm: 2.3.8
22
+ env: "RAILS_VERSION=6.1.0"
23
+ - rvm: 2.7.2
24
+ env: "RAILS_VERSION=6.0.0"
25
+ - rvm: 2.4.10
26
+ env: "RAILS_VERSION=6.0.0"
27
+ - rvm: 2.3.8
28
+ env: "RAILS_VERSION=6.0.0"
29
+ - rvm: 2.7.2
30
+ env: "RAILS_VERSION=5.2.0"
31
+ - rvm: 2.7.2
17
32
  env: "RAILS_VERSION=5.0.0"
18
- - rvm: 2.4.0-preview1
19
- env: "RAILS_VERSION=4.1.0"
20
- - rvm: 2.4.0-preview1
33
+ - rvm: 2.7.2
34
+ env: "RAILS_VERSION=4.2.0"
35
+ - rvm: 2.6.6
36
+ env: "RAILS_VERSION=4.2.0"
37
+ - rvm: 2.5.8
38
+ env: "RAILS_VERSION=4.2.0"
39
+ - rvm: 2.4.10
21
40
  env: "RAILS_VERSION=4.2.0"
22
- sudo: false
@@ -1,8 +1,13 @@
1
+ ## Version 3.0.0
2
+ * Added Foundation 6 support
3
+ * Added auto_labels config
4
+
1
5
  ## Version 2.0
2
6
  This will be used for Foundation 5 support
3
7
 
4
8
  ### Breaking changes:
5
9
  * Dropped support for Ruby 1.9.3
10
+ * display_flash_messages now requires the key_matching hash to be prefixed with the keyword argument :key_matching
6
11
 
7
12
  ### Features:
8
13
  * Add Rubocop code style linting
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  # Specify your gem's dependencies in foundation_rails_helper.gemspec
data/README.md CHANGED
@@ -1,23 +1,34 @@
1
1
  # Foundation Rails Helper [![Build Status](https://secure.travis-ci.org/sgruhier/foundation_rails_helper.png)](http://travis-ci.org/sgruhier/foundation_rails_helper)
2
2
 
3
- Gem for Rails 4.1+ applications that use the excellent Zurb Foundation framework.
3
+ Gem for Rails 4.1+ applications that use the excellent [Zurb Foundation framework](https://github.com/zurb/foundation-rails).
4
4
 
5
- * [Zurb Foundation](https://github.com/zurb/foundation)
6
- * [Zurb Foundation Rails](https://github.com/zurb/foundation-rails)
7
-
8
- So far it includes:
5
+ Includes:
9
6
 
10
7
  * A custom FormBuilder that generates a form using the Foundation framework classes. It replaces the current `form_for`, so there is no need to change your Rails code. Error messages are properly displayed.
11
8
 
12
- * A `display_flash_messages` helper method that uses Zurb Foundation Alerts UI.
9
+ * A `display_flash_messages` helper method that uses Zurb Foundation Callout UI.
13
10
 
14
- #### Compatibility
11
+ ## Installation
15
12
 
16
- * Only Rails 4.1/4.2/5 and Foundation 5 are fully supported
17
- * Some features may work with Foundation 4 and older, but results may vary, and markup which exists only for those versions will be gradually removed
18
- * Legacy branches exist for Rails 3 and 4.0 (see the rails3 and rails4.0 branches). These are not actively supported, and fixes are not retroactively applied, but pull requests are welcome.
19
- * We test against ruby versions 2.1 and up. This gem may still work fine on
20
- 1.9.3, but your mileage may vary
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'foundation-rails', '~> 6.0' # required
17
+ gem 'foundation_rails_helper', '~> 3.0'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ ```bash
23
+ $ bundle
24
+ ```
25
+
26
+ ## Compatibility
27
+
28
+ * Only Rails 4.1/4.2/5/6, and Foundation 6 are fully supported
29
+ * Some features may work with Foundation 5 and older, but results may vary, and markup which exists only for those versions will be gradually removed
30
+ * Legacy branches exist for Rails 3, 4.0, and Foundation 5 (see the rails3, rails4.0, and foundation-5 branches). These are not actively supported, and fixes are not retroactively applied, but pull requests are welcome.
31
+ * We test against ruby versions 2.1 and up. This gem may still work fine on 1.9.3, but your mileage may vary
21
32
 
22
33
 
23
34
  ## Screenshots
@@ -27,7 +38,7 @@ A classic devise sign up view will look like this:
27
38
 
28
39
  ```erb
29
40
  <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
30
- <%= f.email_field :email, label: 'E-mail' %>
41
+ <%= f.email_field :email %>
31
42
  <%= f.password_field :password %>
32
43
  <%= f.password_field :password_confirmation %>
33
44
 
@@ -45,10 +56,10 @@ A classic devise sign up view will look like this:
45
56
  <tbody>
46
57
  <tr>
47
58
  <td valign='top'>
48
- <img src="https://cloud.githubusercontent.com/assets/1400414/5994195/d9b467ce-aa1e-11e4-914c-f696724b53ed.png"/>
59
+ <img src="https://cloud.githubusercontent.com/assets/1400414/18522106/8b981524-7a63-11e6-8450-0605cc310205.png"/>
49
60
  </td>
50
61
  <td valign='top'>
51
- <img src="https://cloud.githubusercontent.com/assets/1400414/5994196/dbf4bc0a-aa1e-11e4-8c18-b7d3b1b370dc.png"/>
62
+ <img src="https://cloud.githubusercontent.com/assets/1400414/18522107/8d0bfa24-7a63-11e6-8c0a-12757528b9ee.png"/>
52
63
  </td>
53
64
  </tr>
54
65
  </tbody>
@@ -56,29 +67,14 @@ A classic devise sign up view will look like this:
56
67
 
57
68
  ### Flash messages
58
69
 
59
- ![Flash-message](https://cloud.githubusercontent.com/assets/393167/5845238/563dc094-a1b2-11e4-8548-2dd2950a60be.png "Flash-message")
60
-
61
- ## Installation
62
-
63
- Add this line to your application's Gemfile:
70
+ ![Flash-message](https://cloud.githubusercontent.com/assets/1400414/18522256/3d13c97e-7a64-11e6-9ee2-33adc93cd573.png "Flash-message")
64
71
 
65
- ```ruby
66
- gem 'foundation-rails'
67
- gem 'foundation_rails_helper', '~> 1.2.0'
68
- ```
69
-
70
- And then execute:
71
-
72
- ```bash
73
- $ bundle
74
- ```
72
+ ## Usage
75
73
 
76
74
  ### Flash Messages
77
75
 
78
76
  To use the built in flash helper, add `<%= display_flash_messages %>` to your layout file (eg. *app/views/layouts/application.html.erb*).
79
77
 
80
- ## Usage
81
-
82
78
  ### form_for
83
79
 
84
80
  Form_for wraps the standard rails form_for helper.
@@ -112,11 +108,11 @@ generates:
112
108
  <input id="user_name" name="user[name]" type="text">
113
109
  ```
114
110
 
115
- Preventing the generation of labels can be accomplished two ways. To disable on a form element:
111
+ Preventing the generation of labels can be accomplished three ways. To disable on a form element:
116
112
  ```ruby
117
113
  f.text_field :name, label: false
118
114
  ```
119
- For all form elements, add the option: `auto_labels: false` to the form helper.
115
+ For all form elements, add the option: `auto_labels: false` to the form helper. To disable for all forms in you project, use the `auto_labels` config option, see the Configuration section for more information.
120
116
 
121
117
  Change the label text and add a class on the label:
122
118
 
@@ -124,21 +120,21 @@ Change the label text and add a class on the label:
124
120
  f.text_field :name, label: 'Nombre', label_options: { class: 'large' }
125
121
  ```
126
122
 
127
- If the hint option is specified
123
+ If the help_text option is specified
128
124
 
129
125
  ```ruby
130
- f.text_field :name, hint: "I'm a text field"
126
+ f.text_field :name, help_text: "I'm a text field"
131
127
  ```
132
128
 
133
- an additional span element will be added after the input element:
129
+ an additional p element will be added after the input element:
134
130
 
135
131
  ```html
136
- <span class="hint">I'm a text field</span>
132
+ <p class="help-text">I'm a text field</p>
137
133
  ```
138
134
 
139
135
  ### Submit Button
140
136
 
141
- The 'submit' helper wraps the rails helper and sets the class attribute to "small radius success button" by default.
137
+ The 'submit' helper wraps the rails helper and sets the class attribute to "success button" by default.
142
138
 
143
139
  ```ruby
144
140
  f.submit
@@ -147,7 +143,7 @@ f.submit
147
143
  generates:
148
144
 
149
145
  ```html
150
- <input class="small radius success button" name="commit" type="submit" value="Create User">
146
+ <input class="success button" name="commit" type="submit" value="Create User">
151
147
  ```
152
148
 
153
149
  Specify the class option to override the default classes.
@@ -163,9 +159,9 @@ f.email_field :email
163
159
  generates:
164
160
 
165
161
  ```html
166
- <label class="error" for="user_email">Email</label>
167
- <input class="error" id="user_email" name="user[email]" type="email" value="">
168
- <small class="error">can't be blank</small>
162
+ <label class="is-invalid-label" for="user_email">Email</label>
163
+ <input class="is-invalid-input" id="user_email" name="user[email]" type="email" value="">
164
+ <small class="form-error is-visible">can't be blank</small>
169
165
  ```
170
166
 
171
167
  The class attribute of the 'small' element will mirror the class attribute of the 'input' element.
@@ -200,13 +196,11 @@ FoundationRailsHelper.configure do |config|
200
196
  end
201
197
  ```
202
198
 
203
- Currently supported options:
204
-
205
199
  ### Submit Button Class
206
200
  To use a different class for the [submit button](https://github.com/sgruhier/foundation_rails_helper#submit-button) used in `form_for`, add a config named **button_class**:
207
201
  ```ruby
208
- # Default: 'small radius success button'
209
- config.button_class = 'large secondary button'
202
+ # Default: 'success button'
203
+ config.button_class = 'large hollow secondary button'
210
204
  ```
211
205
 
212
206
  Please note, the button class can still be overridden by an options hash.
@@ -221,12 +215,17 @@ you can specify a blacklist of keys to ignore with the **ignored_flash_keys** co
221
215
  config.ignored_flash_keys = [:timedout]
222
216
  ```
223
217
 
218
+ ### Auto Labels
219
+ If you prefer to not have the form builder automatically generate labels, set `auto_labels` to false.
220
+ ```ruby
221
+ # Default: true
222
+ config.auto_labels = false
223
+ ```
224
+
224
225
  ## Contributing
225
226
 
226
227
  See the [CONTRIBUTING](CONTRIBUTING.md) file.
227
228
 
228
229
  ## Copyright
229
230
 
230
- Sébastien Gruhier (http://xilinus.com, http://v2.maptimize.com) - MIT LICENSE - 2015
231
-
232
- [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/sgruhier/foundation_rails_helper/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
231
+ Sébastien Gruhier (http://xilinus.com) - MIT LICENSE
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env rake
2
+ # frozen_string_literal: true
2
3
  require 'bundler/gem_tasks'
3
4
  require 'rspec/core/rake_task'
4
5
  require 'rubocop/rake_task'
@@ -1,39 +1,38 @@
1
- # -*- encoding: utf-8 -*-
1
+ # frozen_string_literal: true
2
2
  require File.expand_path('../lib/foundation_rails_helper/version', __FILE__)
3
3
 
4
- Gem::Specification.new do |gem|
5
- gem.authors = ['Sebastien Gruhier']
6
- gem.email = ['sebastien.gruhier@xilinus.com']
7
- gem.description = 'Rails for zurb foundation CSS framework. Form builder, flash message, ...'
8
- gem.summary = 'Rails helpers for zurb foundation CSS framework'
9
- gem.homepage = 'http://github.com/sgruhier/foundation_rails_helper'
10
-
11
- gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
12
- gem.files = `git ls-files`.split("\n")
13
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
- gem.name = 'foundation_rails_helper'
15
- gem.require_paths = ['lib']
16
- gem.version = FoundationRailsHelper::VERSION
17
- gem.license = 'MIT'
4
+ class Gem::Specification # rubocop:disable ClassAndModuleChildren
5
+ def self.rails_gem_version
6
+ # Allow different versions of the rails gems to be specified, for testing
7
+ @rails_gem_version ||=
8
+ ENV['RAILS_VERSION'] ? "~> #{ENV['RAILS_VERSION']}" : ['>= 4.1', '< 7.0']
9
+ end
10
+ end
18
11
 
19
- # Allow different versions of the rails gems to be specified, for testing:
20
- rails_version = ENV['RAILS_VERSION'] || 'default'
12
+ Gem::Specification.new do |gem|
13
+ gem.authors = ['Sebastien Gruhier']
14
+ gem.email = ['sebastien.gruhier@xilinus.com']
15
+ gem.description =
16
+ 'Rails for zurb foundation CSS framework. Form builder, flash message, ...'
17
+ gem.summary = 'Rails helpers for zurb foundation CSS framework'
18
+ gem.homepage = 'http://github.com/sgruhier/foundation_rails_helper'
21
19
 
22
- rails = case rails_version
23
- when 'default'
24
- '>= 4.1'
25
- else
26
- "~> #{rails_version}"
27
- end
20
+ gem.executables =
21
+ `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
22
+ gem.files = `git ls-files`.split("\n")
23
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
+ gem.name = 'foundation_rails_helper'
25
+ gem.require_paths = %w(lib)
26
+ gem.version = FoundationRailsHelper::VERSION
27
+ gem.license = 'MIT'
28
28
 
29
- gem.add_dependency 'railties', rails
30
- gem.add_dependency 'actionpack', rails
31
- gem.add_dependency 'activemodel', rails
32
- gem.add_dependency 'activesupport', rails
33
- gem.add_dependency 'tzinfo', '~> 1.2', '>= 1.2.2'
29
+ gem.add_dependency 'railties', Gem::Specification.rails_gem_version
30
+ gem.add_dependency 'actionpack', Gem::Specification.rails_gem_version
31
+ gem.add_dependency 'activemodel', Gem::Specification.rails_gem_version
32
+ gem.add_dependency 'activesupport', Gem::Specification.rails_gem_version
34
33
 
35
- gem.add_development_dependency 'rspec-rails', '>= 3.1'
36
- gem.add_development_dependency 'mime-types', '~> 2'
37
- gem.add_development_dependency 'capybara', '~> 2.7'
38
- gem.add_development_dependency 'rubocop', '> 0.41'
34
+ gem.add_development_dependency 'rspec-rails', '~> 3.1'
35
+ gem.add_development_dependency 'mime-types', '~> 2'
36
+ gem.add_development_dependency 'capybara', '~> 2.7'
37
+ gem.add_development_dependency 'rubocop', '~> 0.44.1'
39
38
  end