bemer-actionview_form 0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ca48d04273184697117c7b24583a22dd0927d68d881ace82557b5fab9e18e870
4
+ data.tar.gz: 6007cc370615d720959f338e4c58e804bd5b789bdd4f23538bf50cee4af9e04b
5
+ SHA512:
6
+ metadata.gz: ed0cadca274dea00813cd6992c5877ed40d1e6b718ff40dad97840aa8ab7ebb7c83e21e69492972b17fa02ffd3d5efd503cc6a2a95ee7b5f3c0c5b415c565fd9
7
+ data.tar.gz: 1eb940bb0f82254bd4d4b80c144e9f63a86c337d1a8519a25ed47346c99a1e405df76ef4711682aeb2910b281108f5a99b8d9470a0c27ca10156c322b0d03fdd
@@ -0,0 +1,23 @@
1
+ Лицензия MIT
2
+
3
+ Copyright (c) 2019 Александр Григорьев
4
+
5
+ Данная лицензия разрешает лицам, получившим копию данного программного
6
+ обеспечения и сопутствующей документации (в дальнейшем именуемыми
7
+ «Программное Обеспечение»), безвозмездно использовать Программное
8
+ Обеспечение без ограничений, включая неограниченное право на использование,
9
+ копирование, изменение, слияние, публикацию, распространение, сублицензирование
10
+ и/или продажу копий Программного Обеспечения, а также лицам, которым
11
+ предоставляется данное Программное Обеспечение, при соблюдении следующих условий:
12
+
13
+ Указанное выше уведомление об авторском праве и данные условия должны быть включены
14
+ во все копии или значимые части данного Программного Обеспечения.
15
+
16
+ ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ,
17
+ ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ ГАРАНТИИ ТОВАРНОЙ ПРИГОДНОСТИ,
18
+ СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ,
19
+ НО НЕ ОГРАНИЧИВАЯСЬ ИМИ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ
20
+ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО КАКИМ-ЛИБО ИСКАМ, ЗА УЩЕРБ ИЛИ ПО ИНЫМ ТРЕБОВАНИЯМ,
21
+ В ТОМ ЧИСЛЕ, ПРИ ДЕЙСТВИИ КОНТРАКТА, ДЕЛИКТЕ ИЛИ ИНОЙ СИТУАЦИИ,
22
+ ВОЗНИКШИМ ИЗ-ЗА ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ
23
+ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Alexander Grigorev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,31 @@
1
+ # Bemer::ActionviewForm
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'bemer-actionview_form'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install bemer-actionview_form
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## License
30
+
31
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bemer/action_view/form'
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bemer'
4
+ require 'active_support/dependencies/autoload'
5
+ require 'active_support/lazy_load_hooks'
6
+ require 'action_view/helpers/form_helper'
7
+ require 'action_view/helpers/tags/base'
8
+
9
+ # module Bemer
10
+ # module ActionView
11
+ # module Form
12
+ # extend ActiveSupport::Autoload
13
+
14
+ # autoload :Builder
15
+ # autoload :Tags
16
+ # end
17
+ # end
18
+ # end
19
+
20
+ # ActiveSupport.on_load :action_view do
21
+ # ::ActionView::Helpers::FormBuilder.send :prepend, Bemer::ActionView::Form::Builder
22
+ # ::ActionView::Helpers::Tags::Base.send :prepend, Bemer::ActionView::Form::Tags
23
+ # end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # module Bemer
4
+ # module ActionView
5
+ # module Form
6
+ # module Builder
7
+ # def initialize(object_name, object, template, options)
8
+ # extract_block_options!(object_name, options)
9
+
10
+ # super(object_name, object, template, options)
11
+ # end
12
+
13
+ # protected
14
+
15
+ # attr_reader :block_entity
16
+
17
+ # def extract_block_options!(object_name, options)
18
+ # options ||= {}
19
+
20
+ # block = block_name!(object_name, options)
21
+
22
+ # options.delete(:elem)
23
+
24
+ # @block_entity = Bemer::EntityBuilder.new(block, extract_bem_options!(options))
25
+
26
+ # options[:block_entity] = block_entity
27
+
28
+ # options[:html].merge!(block_entity.attrs)
29
+ # end
30
+
31
+ # def extract_bem_options!(options)
32
+ # options[:html] ||= {}
33
+
34
+ # bem = options.delete(:bem)
35
+ # bem_cascade = options.delete(:bem_cascade)
36
+ # css_classes = [options.delete(:class), options.delete(:cls), options[:html][:class]]
37
+ # js = options.delete(:js)
38
+ # mix = options.delete(:mix)
39
+ # mods = options.delete(:mods)
40
+
41
+ # { bem: bem, js: js, mods: mods, mix: mix, bem_cascade: bem_cascade, cls: css_classes }
42
+ # end
43
+
44
+ # def block_name!(object_name, options)
45
+ # block = options.delete(:block)
46
+
47
+ # block.nil? ? object_name : block
48
+ # end
49
+
50
+ # private
51
+
52
+ # def objectify_options(options)
53
+ # @default_options.merge(options.merge(object: @object, block_entity: block_entity))
54
+ # end
55
+ # end
56
+ # end
57
+ # end
58
+ # end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # module Bemer
4
+ # module ActionView
5
+ # module Form
6
+ # module Tags
7
+ # def initialize(object_name, method_name, template_object, options = {})
8
+ # extract_elem_options!(method_name, options)
9
+
10
+ # super
11
+ # end
12
+
13
+ # protected
14
+
15
+ # def extract_elem_options!(method_name, options)
16
+ # elem = elem_name!(method_name, options)
17
+ # block_entity = options.delete(:block_entity)
18
+ # bem_options = extract_bem_options!(block_entity, options)
19
+ # elem_entity = Bemer::EntityBuilder.new(block_entity.block, elem, bem_options)
20
+
21
+ # options.merge!(elem_entity.attrs)
22
+ # end
23
+
24
+ # def extract_bem_options!(block_entity, options)
25
+ # bem = options.delete(:bem)
26
+ # bem_cascade = extract_bem_cascade!(block_entity, options)
27
+ # css_classes = [options.delete(:class), options.delete(:cls)]
28
+ # js = options.delete(:js)
29
+ # mix = options.delete(:mix)
30
+ # mods = options.delete(:mods)
31
+
32
+ # { bem: bem, js: js, mods: mods, mix: mix, bem_cascade: bem_cascade, cls: css_classes }
33
+ # end
34
+
35
+ # def extract_bem_cascade!(block_entity, options)
36
+ # bem_cascade = options.delete(:bem_cascade)
37
+
38
+ # bem_cascade.nil? ? block_entity.bem_cascade : bem_cascade
39
+ # end
40
+
41
+ # def elem_name!(method_name, options)
42
+ # elem = options.delete(:elem)
43
+
44
+ # elem.nil? ? method_name : elem
45
+ # end
46
+ # end
47
+ # end
48
+ # end
49
+ # end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bemer
4
+ module ActionView
5
+ module Form
6
+ VERSION = '0.0.0'
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,207 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bemer-actionview_form
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Grigorev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-05-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
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: overcommit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.48.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.48.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: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.70.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.70.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-performance
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.3.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.3.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.33.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.33.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: actionview
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: 4.1.0
132
+ - - "<"
133
+ - !ruby/object:Gem::Version
134
+ version: '6.1'
135
+ type: :runtime
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: 4.1.0
142
+ - - "<"
143
+ - !ruby/object:Gem::Version
144
+ version: '6.1'
145
+ - !ruby/object:Gem::Dependency
146
+ name: bemer
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: 0.1.0
152
+ - - "<"
153
+ - !ruby/object:Gem::Version
154
+ version: '1.0'
155
+ type: :runtime
156
+ prerelease: false
157
+ version_requirements: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: 0.1.0
162
+ - - "<"
163
+ - !ruby/object:Gem::Version
164
+ version: '1.0'
165
+ description: Add the BEM methodology to your ActionView forms.
166
+ email: vill@rubyinventory.org
167
+ executables: []
168
+ extensions: []
169
+ extra_rdoc_files:
170
+ - README.md
171
+ files:
172
+ - LICENSE-RU.txt
173
+ - LICENSE.txt
174
+ - README.md
175
+ - lib/bemer-actionview_form.rb
176
+ - lib/bemer/action_view/form.rb
177
+ - lib/bemer/action_view/form/builder.rb
178
+ - lib/bemer/action_view/form/tags.rb
179
+ - lib/bemer/action_view/form/version.rb
180
+ homepage:
181
+ licenses:
182
+ - MIT
183
+ metadata:
184
+ bug_tracker_uri: https://github.com/vill/bemer-actionview_form/issues
185
+ homepage_uri: https://github.com/vill/bemer-actionview_form
186
+ source_code_uri: https://github.com/vill/bemer-actionview_form
187
+ post_install_message:
188
+ rdoc_options: []
189
+ require_paths:
190
+ - lib
191
+ required_ruby_version: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: 2.3.0
196
+ required_rubygems_version: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: 2.2.0
201
+ requirements: []
202
+ rubyforge_project:
203
+ rubygems_version: 2.7.7
204
+ signing_key:
205
+ specification_version: 4
206
+ summary: Add the BEM methodology to your ActionView forms.
207
+ test_files: []