view_component_helper 0.2.0 → 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 +4 -4
- data/Gemfile.lock +4 -1
- data/lib/view_component_helper/version.rb +1 -1
- data/lib/view_component_helper/view_helper.rb +13 -11
- data/lib/view_component_helper.rb +1 -0
- metadata +2 -3
- data/lib/view_component_helper/engine.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5700792f76cf0eb8f5b00e1815da1351a31287f8b90067626e403dbc95944a4
|
4
|
+
data.tar.gz: e1bb57a7290fcb4f7fe2cdc5850e96775bcbb0e75f8e9b7c58e53fa880fc8a4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f96c4ec3ce5ffee83bad8cc15352b4099c0ff1fef31d647d145b7aab6284b940cfd0be0d3ae76a1307aea3aad3bf22168bf9675ce5ac992e3ea952906448174
|
7
|
+
data.tar.gz: 24ae36f1e8b1c63f159705aba31a529150f0f5a84f12fdc9f2aa16545fc35d4cdd789907b582f1a00a45edb21aa4b3e0256737ac38784e519a43e3446495046a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
view_component_helper (0.
|
4
|
+
view_component_helper (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -187,6 +187,9 @@ GEM
|
|
187
187
|
websocket-extensions (0.1.5)
|
188
188
|
zeitwerk (2.6.8)
|
189
189
|
|
190
|
+
PLATFORMS
|
191
|
+
x86_64-darwin-21
|
192
|
+
|
190
193
|
DEPENDENCIES
|
191
194
|
rails
|
192
195
|
rake (~> 13.0)
|
@@ -1,18 +1,20 @@
|
|
1
1
|
module ViewComponentHelper
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
end
|
2
|
+
def render_view_component(path, *args, **kwargs, &)
|
3
|
+
render component_class_for(path).new(*args, **kwargs, &)
|
4
|
+
end
|
6
5
|
|
7
|
-
|
6
|
+
alias render_vc render_view_component
|
8
7
|
|
9
|
-
|
8
|
+
private
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def component_class_for(path)
|
11
|
+
class_names = path.to_s.split("/")
|
12
|
+
component_name = class_names.map(&:capitalize).join("::")
|
14
13
|
|
15
|
-
|
16
|
-
end
|
14
|
+
component_name.constantize
|
17
15
|
end
|
16
|
+
end
|
17
|
+
|
18
|
+
ActiveSupport.on_load :action_view do
|
19
|
+
include ViewComponentHelper
|
18
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yamitake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'The ''view_component_helper'' gem streamlines View helper method invocation
|
14
14
|
for view_component. Simplify integration and boost productivity. '
|
@@ -27,7 +27,6 @@ files:
|
|
27
27
|
- README.md
|
28
28
|
- Rakefile
|
29
29
|
- lib/view_component_helper.rb
|
30
|
-
- lib/view_component_helper/engine.rb
|
31
30
|
- lib/view_component_helper/version.rb
|
32
31
|
- lib/view_component_helper/view_helper.rb
|
33
32
|
- sig/view_component_helper.rbs
|
@@ -1,9 +0,0 @@
|
|
1
|
-
require 'view_component_helper/view_helper'
|
2
|
-
module ViewComponentHelper
|
3
|
-
class Engine < ::Rails::Engine
|
4
|
-
isolate_namespace ViewComponentHelper
|
5
|
-
initializer 'view_component_helper.action_view_helpers' do
|
6
|
-
ActiveSupport.on_load(:action_view) { include ViewComponentHelper::ViewHelper }
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|