bemer-simple_form 0.2.1 → 0.3.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
2
  SHA256:
3
- metadata.gz: 2593c0ef8783cc1217324657e384d4ad287d9d0fa2437b526b1c22a66dd000dc
4
- data.tar.gz: 12415d8531d13d2c8a1d0e5cad63395ce13a5eb26a73ef8653801fcf95a012e1
3
+ metadata.gz: 32d8bf8cde8bc372c2200e46dad5b8178b0f8159b192e0f3afb05c52fbbfd9fa
4
+ data.tar.gz: 04d9703bd706d8153834a3fca6bd6d3d95068bdc6dc00132dd993f56c35906f9
5
5
  SHA512:
6
- metadata.gz: 532f7d5687ebcdc8808cb64df4b1231cc7f8db55b01eb35d01c94e1112505bc9873b6200516587f263f010c6feea31627c1d89eff73a6c12232992518b978eb6
7
- data.tar.gz: 5394c4273000ee0089f387bb7129d0804e8415e840cc139572deaae8e8828735ca012c73d9dda8c797bebbafb3dfa930094a592bd2e1849ae46c242b7c23a568
6
+ metadata.gz: 23cace5052b10051a2e71d984dc2f8f554961318443c49093a0081ba78ed3da427d9d06b83ae6ca87567b95fad2103542dc40fb8559ab0f7b2ee2daf34400d6e
7
+ data.tar.gz: 7c5e5963511fca6d977862f2ae6cb5748dc6677bfd93983d3a26958c6f7e2dd29f4e28c07a233cf50c05e330178bb1044d20181a8c5f8ae629121da894b5d806
data/README.md CHANGED
@@ -1,20 +1,24 @@
1
- # Использование соглашений из БЭМ методологии в формах Simple Form
1
+ # Bemer Simple Form
2
2
 
3
- ## Установка
3
+ Using conventions from the `BEM` methodology in `SimpleForm` forms.
4
4
 
5
- Добавить в `Gemfile`:
5
+ *Please refer to the [README.ru.md](README.ru.md) file for instructions in Russian.*
6
+
7
+ ## Installation
8
+
9
+ Add it to your Gemfile:
6
10
 
7
11
  ```ruby
8
12
  gem 'bemer-simple_form'
9
13
  ```
10
14
 
11
- Выполнить в терминале команду:
15
+ Run the following command to install it:
12
16
 
13
17
  $ bundle
14
18
 
15
- ## Настройки
16
- ### Конфигурация `bemer-simple_form`
17
- Параметры конфигурации по умолчанию:
19
+ ## Configuration
20
+ ### `bemer-simple_form` configuration
21
+ Default configuration:
18
22
  ```ruby
19
23
  # config/initializers/bemer_simple_form.rb
20
24
  Bemer::SimpleForm.setup do |config|
@@ -24,8 +28,8 @@ Bemer::SimpleForm.setup do |config|
24
28
  end
25
29
  ```
26
30
 
27
- ### Конфигурация `bemer`
28
- Все параметры конфигурации использующие по умолчанию досутпны [здесь](https://github.com/vill/bemer/blob/master/docs/%D0%9A%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%86%D0%B8%D1%8F.md).
31
+ ### `bemer` configuration
32
+ The default configuration is available [here](https://github.com/vill/bemer/blob/master/docs/%D0%9A%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%86%D0%B8%D1%8F.md).
29
33
  ```ruby
30
34
  # config/initializers/bemer.rb
31
35
  Bemer.setup do |config|
@@ -36,8 +40,9 @@ Bemer.setup do |config|
36
40
  end
37
41
  ```
38
42
 
39
- ### Конфигурация `simple_form`
40
- Для того, чтобы отключить генерацию ненужных CSS классов от Simple Form, достаточно изменить следующие параметры конфигурации:
43
+ ### `simple_form` configuration
44
+
45
+ To disable the creation of unnecessary `CSS` classes from `SimpleForm`, just change the following configuration parameters:
41
46
  ```ruby
42
47
  # config/initializers/simple_form.rb
43
48
  SimpleForm.setup do |config|
@@ -74,18 +79,19 @@ SimpleForm.setup do |config|
74
79
  # ...
75
80
  end
76
81
  ```
77
- Дополнительно при вызове можно указать `class: nil`:
82
+
83
+ Additionally, you can specify `class: nil`:
78
84
  ```slim
79
85
  = simple_form_for resource, url: registration_path(resource_name), html: { class: nil } do |f|
80
86
  / ...
81
87
  ```
82
- ## Использование
88
+ ## Usage
83
89
 
84
- Для `simple_form_for` доступны такие же параметры как и для [хелпера `block_tag`](https://github.com/vill/bemer/blob/master/docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-block_tag.md).
90
+ For `simple_form_for`, the same parameters are available as for [the `block_tag` helper](https://github.com/vill/bemer/blob/master/docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-block_tag.md).
85
91
 
86
- Для элементов формы доступны такие же параметры как и для элементов [хелпера `block_tag`](https://github.com/vill/bemer/blob/master/docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-block_tag.md#%D0%BF%D0%B0%D1%80%D0%B0%D0%BC%D0%B5%D1%82%D1%80-content) создаваемых с помощью `content`, переданного в виде Ruby `&block`.
92
+ The same parameters are available for form elements as for [`block_tag` helper](https://github.com/vill/bemer/blob/master/docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-block_tag.md#%D0%BF%D0%B0%D1%80%D0%B0%D0%BC%D0%B5%D1%82%D1%80-content) elements created using `content` passed as Ruby `&block`.
87
93
 
88
- Создание формы с параметрами по умолчанию:
94
+ Creating a form with default parameters:
89
95
 
90
96
  ```slim
91
97
  = simple_form_for resource, url: registration_path(resource_name), html: { class: nil } do |f|
@@ -95,7 +101,7 @@ end
95
101
  => f.button :submit, t('.sign_up')
96
102
  ```
97
103
 
98
- Название блока передается через параметр `as`:
104
+ The name of the block is passed through the `as` parameter:
99
105
  ```slim
100
106
  = simple_form_for resource, as: :user, url: registration_path(resource_name), html: { class: nil } do |f|
101
107
  = f.input :email, required: true, autofocus: true
@@ -104,7 +110,7 @@ end
104
110
  = f.button :submit, t('.sign_up')
105
111
  ```
106
112
 
107
- Название блока передается через параметр `block`:
113
+ The name of the block is passed through the `block` parameter:
108
114
  ```slim
109
115
  = simple_form_for resource, block: :user, url: registration_path(resource_name), html: { class: nil } do |f|
110
116
  = f.input :email, required: true, autofocus: true
@@ -113,7 +119,7 @@ end
113
119
  = f.button :submit, t('.sign_up')
114
120
  ```
115
121
 
116
- Добавить модификатор `enabled` в элемент `email`:
122
+ Add the `enabled` modifier to the `email` element:
117
123
  ```slim
118
124
  = simple_form_for resource, block: :user, url: registration_path(resource_name), html: { class: nil } do |f|
119
125
  = f.input :email, required: true, autofocus: true, input_html: { mods: :enabled }
@@ -122,7 +128,7 @@ end
122
128
  = f.button :submit, t('.sign_up')
123
129
  ```
124
130
 
125
- Результат рендеринга формы с параметрами по умолчанию:
131
+ The result of rendering a form with default parameters:
126
132
  ```html
127
133
  <form id="new_admin_user" novalidate="novalidate" class="admin-user" action="/user" accept-charset="UTF-8" method="post">
128
134
  <input type="hidden" name="authenticity_token" value="dXgQo5PvtM5g01pFiQmpMDTb8BYVxsMvzS8n+6YN/UhjFR/tCf4ym7bZzMgs/E/ECxvXZcbr9uzMPcUUIj43jA==">
@@ -150,7 +156,7 @@ end
150
156
  <input type="submit" name="commit" value="Зарегистрироваться" class="admin-user__submit" data-disable-with="Зарегистрироваться">
151
157
  </form>
152
158
  ```
153
- Результат рендеринга формы содержащей ошибки валидации:
159
+ The result of rendering a form containing validation errors:
154
160
  ```html
155
161
  <form novalidate="novalidate" class="admin-user" action="/user" accept-charset="UTF-8" method="post">
156
162
  <input type="hidden" name="authenticity_token" value="5GJ9rIPD1XVg8BDKy2ZBpDt3qYlBuAh/z7u00qw8bzfyD3LiGdJTILb6hkduk6dQBLeO+pKVPbzOqVY9KA+l8w==">
@@ -180,12 +186,12 @@ end
180
186
  <input type="submit" name="commit" value="Зарегистрироваться" class="admin-user__submit" data-disable-with="Зарегистрироваться">
181
187
  </form>
182
188
  ```
183
- ## Ссылки
189
+ ## Links
184
190
 
185
- 1. https://ru.bem.info/methodology/
186
- 1. https://github.com/bem/bem-xjst
187
- 1. https://github.com/bem/bem-core
191
+ 1. BEM methodology - https://en.bem.info/methodology
192
+ 1. Minimal stack for coding client-side JavaScript and templating - https://github.com/bem/bem-core
193
+ 1. Declarative template engine for the browser and server with regular JS syntax - https://github.com/bem/bem-xjst
188
194
 
189
- ## Лицензия
195
+ ## License
190
196
 
191
- Copyright (c) 2019 - 2020 Александр Григорьев. Более подробную информацию о лицензии можно получить в файле [LICENSE-RU.txt](LICENSE-RU.txt).
197
+ Copyright (c) 2019-2020 Alexander Grigorev. See [LICENSE.txt](LICENSE.txt) for further details.
@@ -15,7 +15,7 @@ module Bemer
15
15
  options = args.extract_options!
16
16
  elem = extract_name_for!(:elem, type, options)
17
17
  elem = Bemer::SimpleForm.transform_element_name(nil, block_entity.block, elem, elem)
18
- entity = Bemer::EntityBuilder.new(block_entity.block, elem, extract_bem_options!(options))
18
+ entity = Bemer::EntityBuilder.new(block_entity.block, elem, **extract_bem_options!(options))
19
19
 
20
20
  options.delete(:block)
21
21
 
@@ -39,7 +39,7 @@ module Bemer
39
39
 
40
40
  options.delete(:elem)
41
41
 
42
- @defaults[:block_entity] = Bemer::EntityBuilder.new(block, extract_bem_options!(options))
42
+ @defaults[:block_entity] = Bemer::EntityBuilder.new(block, **extract_bem_options!(options))
43
43
 
44
44
  options[:html].merge!(block_entity.attrs)
45
45
  end
@@ -29,7 +29,7 @@ module Bemer
29
29
 
30
30
  add_input_type_modifiers!(namespace, options)
31
31
 
32
- elem_entity = ::Bemer::EntityBuilder.new(block_entity.block, elem, options)
32
+ elem_entity = ::Bemer::EntityBuilder.new(block_entity.block, elem, **options)
33
33
 
34
34
  bem_options_for(namespace).merge!(elem_entity.attrs).delete(:block)
35
35
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bemer
4
4
  module SimpleForm
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,169 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bemer-simple_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Grigorev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: appraisal
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 2.2.0
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 2.2.0
27
- - !ruby/object:Gem::Dependency
28
- name: bundler-audit
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 0.6.1
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 0.6.1
41
- - !ruby/object:Gem::Dependency
42
- name: fasterer
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 0.5.1
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 0.5.1
55
- - !ruby/object:Gem::Dependency
56
- name: fuubar
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 2.5.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 2.5.0
69
- - !ruby/object:Gem::Dependency
70
- name: rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 12.3.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 12.3.0
83
- - !ruby/object:Gem::Dependency
84
- name: rspec-html-matchers
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.9.2
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.9.2
97
- - !ruby/object:Gem::Dependency
98
- name: rspec-rails
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 3.9.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 3.9.0
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 0.70.0
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 0.70.0
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-performance
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 1.3.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 1.3.0
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 1.33.0
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 1.33.0
153
- - !ruby/object:Gem::Dependency
154
- name: wwtd
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: 1.4.1
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: 1.4.1
167
13
  - !ruby/object:Gem::Dependency
168
14
  name: activesupport
169
15
  requirement: !ruby/object:Gem::Requirement
@@ -277,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
123
  - !ruby/object:Gem::Version
278
124
  version: 2.2.0
279
125
  requirements: []
280
- rubygems_version: 3.0.3
126
+ rubygems_version: 3.4.12
281
127
  signing_key:
282
128
  specification_version: 4
283
129
  summary: Add the BEM methodology to your SimpleForm forms.
@@ -288,6 +134,7 @@ test_files:
288
134
  - spec/action_view/simple_form_for_as_a_block_builder_spec.rb
289
135
  - spec/action_view/simple_form_for_with_a_symbolic_name_as_a_passed_object_spec.rb
290
136
  - spec/bemer/simple_form/configuration_spec.rb
137
+ - spec/dummy/Rakefile
291
138
  - spec/dummy/app/forms/search_form.rb
292
139
  - spec/dummy/app/models/article.rb
293
140
  - spec/dummy/bin/rails
@@ -302,7 +149,6 @@ test_files:
302
149
  - spec/dummy/config.ru
303
150
  - spec/dummy/db/migrate/20191215094046_create_articles.rb
304
151
  - spec/dummy/db/schema.rb
305
- - spec/dummy/Rakefile
306
152
  - spec/rails_helper.rb
307
153
  - spec/spec_helper.rb
308
154
  - spec/support/active_record.rb