bemer 0.4.0 → 0.5.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: 8d14fafeea2e51e9af1a6302e7b2c2615442c329edf9d02710363d760fa9b81c
4
- data.tar.gz: 486f4bca3457d1b287f4dfe3b88a2d6443f025a6a7aa2e141e2c71f9a5732622
3
+ metadata.gz: 84098253bdd2d8a9d177fddcf79e6a98af7c76af3e7fab7c717e380a799d12e1
4
+ data.tar.gz: 673f538a9fe0f1e34c649527cd1d8a3d08940601b18d16223308ebf9ef22dfcf
5
5
  SHA512:
6
- metadata.gz: 4734a3841499b7c912640b62cc73bfb912b649d3aa283e2b98d6800c311d2b51e93e1a08296994b9db47c6b57dc4e4064db8a2fd12ee4b693cf59dfad9c95200
7
- data.tar.gz: e75023ee5ced51f2063f4b022e6d932a4841396390556b15318677ab1e3b3fbd1d415de8cfd087891cd06d76ae83f246960c0eac872a7a528e9535da012e98a0
6
+ metadata.gz: 9a3fb72c68982a9d558192541b7de078d6ec98df923ddf048a2074742b62b553852d7f8486e1fd4786f690c6cf0ec392c33d15d82bbded151ccbec14168ed999
7
+ data.tar.gz: 6a9d7821d738c7a4137438708b8c4b5c9c707aa726cf4619647f2a69fd2c76d33d5c66a82b21a9cf059520f1dcae733b799fc318b96f75216db3379e47e53977
data/LICENSE-RU.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  Лицензия MIT
2
2
 
3
- Copyright (c) 2017-2020 Александр Григорьев
3
+ Copyright (c) 2017-2023 Александр Григорьев
4
4
 
5
5
  Данная лицензия разрешает лицам, получившим копию данного программного
6
6
  обеспечения и сопутствующей документации (в дальнейшем именуемыми
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2020 Alexander Grigorev
3
+ Copyright (c) 2017-2023 Alexander Grigorev
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,34 +1,35 @@
1
1
  # Bemer
2
2
 
3
- **ВАЖНО**. *Для работы с UI компонентами не обязательно использовать методологию БЭМ.*
3
+ 1. Build reusable UI components for Ruby on Rails applications.
4
+ 1. Develop Ruby on Rails applications using the `BEM` methodology.
4
5
 
5
- 1. Позволяет создавать переиспользуемые UI компоненты для приложений на Ruby on Rails.
6
- 1. Предоставляет функционал для разработки приложений на Ruby on Rails с использованием методологии БЭМ.
6
+ **IMPORTANT**. *Using the `BEM` methodology is optional.*
7
7
 
8
- ## Дополнительно
8
+ Additional resources:
9
9
 
10
- 1. Статья на Хабре - [Переиспользуемые UI компоненты в приложениях на Ruby on Rails](https://habrahabr.ru/post/352938/).
11
- 1. [`bemer-simple_form`](https://github.com/vill/bemer-simple_form) - Использование соглашений из БЭМ методологии в формах `SimpleForm`.
12
- 1. [`bemer-bootstrap`](https://github.com/vill/bemer-bootstrap) - переиспользуемые компоненты Bootstrap v3.
13
- 1. [Пример приложения](https://github.com/vill/bemer-example) с использованием `bemer` и [`bemer-bootstrap`](https://github.com/vill/bemer-bootstrap).
10
+ 1. Habr article in Russian - [Переиспользуемые UI компоненты в приложениях на Ruby on Rails](https://habrahabr.ru/post/352938/).
11
+ 1. [`bemer-simple_form`](https://github.com/vill/bemer-simple_form) - Add the `BEM` methodology to your `SimpleForm` forms.
12
+ 1. [`bemer-bootstrap`](https://github.com/vill/bemer-bootstrap) - Reusable UI components of `Bootstrap`.
13
+ 1. [Ruby on Rails application](https://github.com/vill/bemer-example) using `bemer` and [`bemer-bootstrap`](https://github.com/vill/bemer-bootstrap).
14
14
 
15
- ## Установка
15
+ *Please refer to the [README.ru.md](README.ru.md) file for instructions in Russian.*
16
16
 
17
- Добавить в `Gemfile`:
17
+
18
+ ## Installation
19
+
20
+ Add it to your Gemfile:
18
21
 
19
22
  ```ruby
20
23
  gem 'bemer'
21
24
  ```
22
25
 
23
- Выполнить в терминале команду:
26
+ Run the following command to install it:
24
27
 
25
28
  $ bundle
26
29
 
27
- ## Использование
28
-
29
- ### Конфигурация
30
+ ## Configuration
30
31
 
31
- [Конфигурация](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) для `Bemer`:
32
+ See [configuration documentation](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) for details.
32
33
 
33
34
  ```ruby
34
35
  # config/initializers/bemer.rb
@@ -36,14 +37,15 @@ gem 'bemer'
36
37
  Bemer.setup do |config|
37
38
  config.bem = true
38
39
  config.modifier_name_separator = '--'
39
- config.path = 'app/frontend/components' # или Webpacker.config.source_path
40
+ config.path = 'app/frontend/components' # or Webpacker.config.source_path
40
41
  # config.default_path_prefix = lambda { |path, view|
41
42
  # view.controller.class.name.split('::')[0].underscore
42
43
  # }
43
44
  end
44
45
  ```
45
46
 
46
- Если используется [`Webpacker`](https://github.com/rails/webpacker):
47
+ ## Integrations
48
+ ### Webpacker
47
49
 
48
50
  ```yml
49
51
  # config/webpacker.yml
@@ -66,36 +68,11 @@ production:
66
68
  <<: *default
67
69
  # ...
68
70
  ```
71
+ #### File naming and folder structure
72
+ See [file naming and folder structure documentation](docs/%D0%A4%D0%B0%D0%B8%CC%86%D0%BB%D0%BE%D0%B2%D0%B0%D1%8F-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0.md) for details.
69
73
 
70
- ### Файловая структура
71
-
72
- Пример [файловой структуры](docs/%D0%A4%D0%B0%D0%B8%CC%86%D0%BB%D0%BE%D0%B2%D0%B0%D1%8F-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0.md) при использовании [`Sprockets`](https://github.com/rails/sprockets-rails):
73
74
  ```
74
75
  app/
75
- ├── assets/
76
- | ├── javascripts/
77
- | | ├── admin_panel/
78
- | | | ├── application.js
79
- | | | └── ...
80
- | | ├── landing/
81
- | | | ├── application.js
82
- | | | └── ...
83
- | | ├── user_panel/
84
- | | | ├── application.js
85
- | | | └── ...
86
- | | └── ...
87
- | ├── stylesheets/
88
- | | ├── admin_panel/
89
- | | | ├── application.scss
90
- | | | └── ...
91
- | | ├── landing/
92
- | | | ├── application.scss
93
- | | | └── ...
94
- | | ├── user_panel/
95
- | | | ├── application.scss
96
- | | | └── ...
97
- | | └── ...
98
- | └── ...
99
76
  ├── frontend/
100
77
  | ├── components/
101
78
  | | ├── common/
@@ -127,12 +104,62 @@ app/
127
104
  | | ├── user_panel/
128
105
  | | | └── ...
129
106
  | | └── ...
107
+ | ├── packs/
108
+ | | ├── admin_panel/
109
+ | | | ├── application.js
110
+ | | | └── ...
111
+ | | ├── landing/
112
+ | | | ├── application.js
113
+ | | | └── ...
114
+ | | ├── user_panel/
115
+ | | | ├── application.js
116
+ | | | └── ...
117
+ | | └── ...
130
118
  | └── ...
131
119
  └── ...
132
120
  ```
133
- Пример [файловой структуры](docs/%D0%A4%D0%B0%D0%B8%CC%86%D0%BB%D0%BE%D0%B2%D0%B0%D1%8F-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0.md) при использовании [`Webpacker`](https://github.com/rails/webpacker):
121
+
122
+ ### Sprockets
123
+
124
+ You do not need to do anything, but add additional assets to the asset load path if necessary:
125
+
126
+ ```ruby
127
+ # config/initializers/bemer.rb
128
+
129
+ Bemer.setup do |config|
130
+ config.asset_paths << Rails.root.join('some/asset/path')
131
+ end
132
+ ```
133
+
134
+ ### File naming and folder structure
135
+ See [file naming and folder structure documentation](docs/%D0%A4%D0%B0%D0%B8%CC%86%D0%BB%D0%BE%D0%B2%D0%B0%D1%8F-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0.md) for details.
136
+
134
137
  ```
135
138
  app/
139
+ ├── assets/
140
+ | ├── javascripts/
141
+ | | ├── admin_panel/
142
+ | | | ├── application.js
143
+ | | | └── ...
144
+ | | ├── landing/
145
+ | | | ├── application.js
146
+ | | | └── ...
147
+ | | ├── user_panel/
148
+ | | | ├── application.js
149
+ | | | └── ...
150
+ | | └── ...
151
+ | ├── stylesheets/
152
+ | | ├── admin_panel/
153
+ | | | ├── application.scss
154
+ | | | └── ...
155
+ | | ├── landing/
156
+ | | | ├── application.scss
157
+ | | | └── ...
158
+ | | ├── user_panel/
159
+ | | | ├── application.scss
160
+ | | | └── ...
161
+ | | └── ...
162
+ | └── ...
136
163
  ├── frontend/
137
164
  | ├── components/
138
165
  | | ├── common/
@@ -164,24 +191,15 @@ app/
164
191
  | | ├── user_panel/
165
192
  | | | └── ...
166
193
  | | └── ...
167
- | ├── packs/
168
- | | ├── admin_panel/
169
- | | | ├── application.js
170
- | | | └── ...
171
- | | ├── landing/
172
- | | | ├── application.js
173
- | | | └── ...
174
- | | ├── user_panel/
175
- | | | ├── application.js
176
- | | | └── ...
177
- | | └── ...
178
194
  | └── ...
179
195
  └── ...
180
196
  ```
181
- ### Создание `HTML` структуры компонента
182
197
 
183
- #### Простой компонент
184
- Структура компонента [Сarousel из Bootstrap](https://getbootstrap.com/docs/4.3/components/carousel/#with-indicators):
198
+ ## Usage
199
+
200
+ ### Component to which `BEMHTML` templates cannot be applied
201
+
202
+ HTML structure of the [Carousel component from Bootstrap](https://getbootstrap.com/docs/4.3/components/carousel/#with-indicators):
185
203
 
186
204
  ```slim
187
205
  / app/frontend/components/common/carousel/index.slim
@@ -196,19 +214,19 @@ app/
196
214
  = image_tag image_url, class: 'd-block w-100'
197
215
  a.carousel-control-prev data-slide="prev" data-target='.carousel' role="button"
198
216
  span.carousel-control-prev-icon aria-hidden="true"
199
- span.sr-only Предыдущий
217
+ span.sr-only Previous
200
218
  a.carousel-control-next data-slide="next" data-target='.carousel' role="button"
201
219
  span.carousel-control-next-icon aria-hidden="true"
202
- span.sr-only Следующий
220
+ span.sr-only Next
203
221
  ```
204
- [Вызов компонента](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-render_component.md) `carousel` в любом представлении или в [других компонентах](docs/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B8-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-UI-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82.md):
222
+ [Rendering](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-render_component.md) the `carousel` component in any view or [other UI components](docs/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B8-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-UI-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82.md):
205
223
  ```slim
206
224
  = render_component :carousel, prefix: :common, image_urls: image_urls, cls: 'carousel-fade'
207
225
  ```
208
226
 
209
- #### Компонент к которому можно применять `BEMHTML` шаблоны
227
+ ### Component to which `BEMHTML` templates can be applied
210
228
 
211
- Структура компонента [Сarousel из Bootstrap](https://getbootstrap.com/docs/4.3/components/carousel/#with-indicators):
229
+ Tree structure of the [Carousel component from Bootstrap](https://getbootstrap.com/docs/4.3/components/carousel/#with-indicators):
212
230
 
213
231
  ```slim
214
232
  / app/frontend/components/common/carousel/index.slim
@@ -224,13 +242,13 @@ app/
224
242
  = carousel.elem :image, tag: :img, cls: 'd-block w-100', src: image_url
225
243
  = carousel.elem :control_prev, tag: :a, cls: 'carousel-control-prev', 'data-slide': :prev, role: :button, 'data-target': '.carousel'
226
244
  span.carousel-control-prev-icon aria-hidden="true"
227
- span.sr-only Предыдущий
245
+ span.sr-only Previous
228
246
  = carousel.elem :control_next, tag: :a, cls: 'carousel-control-next', 'data-slide': :next, role: :button, 'data-target': '.carousel'
229
247
  span.carousel-control-next-icon aria-hidden="true"
230
- span.sr-only Следующий
248
+ span.sr-only Next
231
249
  ```
232
250
 
233
- [Шаблон по умолчанию](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-define_templates.md):
251
+ [Default template](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-define_templates.md):
234
252
  ```slim
235
253
  / app/frontend/components/common/carousel/index.bemhtml.slim
236
254
 
@@ -238,18 +256,18 @@ app/
238
256
  = template.elem(mods: :active).add_cls :active
239
257
  ```
240
258
 
241
- [Вызов компонента](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-render_component.md) `carousel` в любом представлении или в [других компонентах](docs/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B8-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-UI-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82.md) с применением [`BEMHTML`](docs/BEMHTML.md) [шаблонов](docs/%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B.md):
259
+ [Rendering](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-render_component.md) the `carousel` component in any view or [other UI components](docs/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B8-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-UI-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82.md) using [`BEMHTML`](docs/BEMHTML.md) [templates](docs/%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B.md):
242
260
  ```slim
243
261
  = render_component :carousel, prefix: :common, image_urls: image_urls do |template|
244
262
  = template.block(:carousel).add_mix :carousel_fade
245
263
  ```
246
264
 
247
- ## Документация
265
+ ## Documentation in Russian
248
266
 
249
- 1. [Файловая структура](docs/%D0%A4%D0%B0%D0%B8%CC%86%D0%BB%D0%BE%D0%B2%D0%B0%D1%8F-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0.md)
250
- 1. [Конфигурация](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)
251
- 1. [Создание и использование UI компонент](docs/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B8-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-UI-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82.md)
252
- 1. Хелперы для работы с компонентами
267
+ 1. [File naming and folder structure](docs/%D0%A4%D0%B0%D0%B8%CC%86%D0%BB%D0%BE%D0%B2%D0%B0%D1%8F-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0.md)
268
+ 1. [Configuration](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)
269
+ 1. [Creating and using UI components](docs/%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B8-%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5-UI-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BE%D0%BD%D0%B5%D0%BD%D1%82.md)
270
+ 1. Helpers for UI components
253
271
  1. [`define_component`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-define_component.md)
254
272
  1. [`define_templates`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-define_templates.md)
255
273
  1. [`render_component`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-render_component.md)
@@ -257,25 +275,25 @@ app/
257
275
  1. [`component_pack`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-component_pack.md)
258
276
  1. [`component_asset_path`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-component_asset_path.md)
259
277
  1. [`component_partial_path`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-component_partial_path.md)
260
- 1. Дополнительные хелперы для БЭМ методологии
278
+ 1. Additional helpers for the BEM methodology
261
279
  1. [`bem_attrs_for`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-bem_attrs_for.md)
262
280
  1. [`bem_mix`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-bem_mix.md)
263
281
  1. [`bem_mods`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-bem_mods.md)
264
282
  1. [`block_tag`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-block_tag.md)
265
283
  1. [`elem_tag`](docs/%D0%A5%D0%B5%D0%BB%D0%BF%D0%B5%D1%80-elem_tag.md)
266
284
  1. [BEMHTML](docs/BEMHTML.md)
267
- 1. [Шаблоны](docs/%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B.md)
268
- 1. [Контекст узла](docs/%D0%9A%D0%BE%D0%BD%D1%82%D0%B5%D0%BA%D1%81%D1%82-%D1%83%D0%B7%D0%BB%D0%B0.md)
269
- 1. [Предикаты](docs/%D0%9F%D1%80%D0%B5%D0%B4%D0%B8%D0%BA%D0%B0%D1%82%D1%8B.md)
270
- 1. [Режимы](docs/%D0%A0%D0%B5%D0%B6%D0%B8%D0%BC%D1%8B.md)
285
+ 1. [Templates](docs/%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%8B.md)
286
+ 1. [Node](docs/%D0%9A%D0%BE%D0%BD%D1%82%D0%B5%D0%BA%D1%81%D1%82-%D1%83%D0%B7%D0%BB%D0%B0.md)
287
+ 1. [Predicates](docs/%D0%9F%D1%80%D0%B5%D0%B4%D0%B8%D0%BA%D0%B0%D1%82%D1%8B.md)
288
+ 1. [Modes](docs/%D0%A0%D0%B5%D0%B6%D0%B8%D0%BC%D1%8B.md)
271
289
 
272
- ## Ссылки
290
+ ## Links
273
291
 
274
292
  1. BEM methodology - https://bem.info/methodology/
275
293
  1. Minimal stack for coding client-side JavaScript and templating - https://github.com/bem/bem-core
276
294
  1. Declarative template engine for the browser and server with regular JS syntax - https://github.com/bem/bem-xjst
277
295
  1. BEM Forum - https://bem.info/forum/
278
296
 
279
- ## Лицензия
297
+ ## License
280
298
 
281
- Copyright (c) 2017 - 2020 Александр Григорьев. Более подробную информацию о лицензии можно получить в файле [LICENSE.txt](LICENSE.txt).
299
+ Copyright (c) 2017-2023 Alexander Grigorev. See [LICENSE.txt](LICENSE.txt) for further details.
@@ -18,6 +18,7 @@ module Bemer
18
18
  def initialize # rubocop:disable Metrics/MethodLength
19
19
  @asset_paths = []
20
20
  @bem = false
21
+ # https://github.com/brainspec/enumerize/blob/9dd68ca36d1efed6bc4cec8557a359f34f408d47/lib/enumerize/activerecord.rb#L24
21
22
  # https://github.com/heartcombo/devise/blob/b52e642c0131f7b0d9f2dd24d8607a186f18223e/lib/devise.rb#L301
22
23
  # Gem::Version.new('0.4.1') > Gem::Version.new('0.10.1')
23
24
  # Здесь вроде также используют https://github.com/rspec/rspec-rails/blob/9b7ab39c027a8cb25e2ebe9e0e985756025b0549/Gemfile#L45
data/lib/bemer/railtie.rb CHANGED
@@ -9,10 +9,7 @@ module Bemer
9
9
  class Railtie < ::Rails::Railtie
10
10
  class << self
11
11
  def assets_path_initializer
12
- case ::Rails::VERSION::MAJOR
13
- when 5..6 then :append_assets_path
14
- when 3..4 then :load_config_initializers
15
- end
12
+ ::Rails::VERSION::MAJOR < 5 ? :load_config_initializers : :append_assets_path
16
13
  end
17
14
  end
18
15
 
data/lib/bemer/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bemer
4
- VERSION = '0.4.0'.freeze
4
+ VERSION = '0.5.0'.freeze
5
5
  end
@@ -38,7 +38,7 @@ RSpec.describe Bemer::Railtie do
38
38
  describe 'bemer.helpers initializer' do
39
39
  subject(:initializer) { find_initializer('bemer.helpers') }
40
40
 
41
- let(:action_view) { ActionView::Base.new }
41
+ let(:action_view) { ActionView::Base.respond_to?(:empty) ? ActionView::Base.empty : ActionView::Base.new }
42
42
 
43
43
  helper_methods = %i[
44
44
  block_tag elem_tag bem_mix bem_mods render_component
metadata CHANGED
@@ -1,197 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bemer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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-10 00:00:00.000000000 Z
11
+ date: 2023-03-14 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.7.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.7.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: overcommit
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 0.47.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 0.47.0
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 12.3.3
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 12.3.3
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
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: rspec-html-matchers
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 0.9.2
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 0.9.2
125
- - !ruby/object:Gem::Dependency
126
- name: rspec-rails
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 3.9.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 3.9.0
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 0.68.1
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 0.68.1
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop-performance
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: 1.3.0
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: 1.3.0
167
- - !ruby/object:Gem::Dependency
168
- name: rubocop-rspec
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: 1.38.1
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: 1.38.1
181
- - !ruby/object:Gem::Dependency
182
- name: wwtd
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: 1.4.0
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: 1.4.0
195
13
  - !ruby/object:Gem::Dependency
196
14
  name: railties
197
15
  requirement: !ruby/object:Gem::Requirement
@@ -342,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
160
  - !ruby/object:Gem::Version
343
161
  version: 2.2.0
344
162
  requirements: []
345
- rubygems_version: 3.0.3
163
+ rubygems_version: 3.4.3
346
164
  signing_key:
347
165
  specification_version: 4
348
166
  summary: Build reusable UI components for Rails applications with the ability to use