view_component_helper 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a181c3cf10f982308ec54d811c0252ca343b05a9ac843f4c13cfda732afb237
4
- data.tar.gz: ba82e95eae2d5e27205514364f581cc2cfac5344a7aa1ab7af2b1596d5f5dc4c
3
+ metadata.gz: e5700792f76cf0eb8f5b00e1815da1351a31287f8b90067626e403dbc95944a4
4
+ data.tar.gz: e1bb57a7290fcb4f7fe2cdc5850e96775bcbb0e75f8e9b7c58e53fa880fc8a4c
5
5
  SHA512:
6
- metadata.gz: 8a846d1d9ab0c176bfa09c71044122f2fd0103231b94e918559e930c405724b245b6ae75fb4675a8b19601e839747743106ee8202d4a4ee38feb24c40354ce4c
7
- data.tar.gz: 4785a6ba4652646aea49f1f8f964fc36ccd38796d23dd5ea70472c0ea101ddbb60913e0b1d5f278a652c5383c9046ceb4114f1a41475f9c40a915cdaab9aab04
6
+ metadata.gz: 8f96c4ec3ce5ffee83bad8cc15352b4099c0ff1fef31d647d145b7aab6284b940cfd0be0d3ae76a1307aea3aad3bf22168bf9675ce5ac992e3ea952906448174
7
+ data.tar.gz: 24ae36f1e8b1c63f159705aba31a529150f0f5a84f12fdc9f2aa16545fc35d4cdd789907b582f1a00a45edb21aa4b3e0256737ac38784e519a43e3446495046a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2023-07-30
4
+
5
+ - Add Readme
6
+
3
7
  ## [0.1.0] - 2023-07-30
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- view_component_helper (0.1.0)
4
+ view_component_helper (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -16,7 +16,21 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
16
 
17
17
  ## Usage
18
18
 
19
- TODO: Write usage instructions here
19
+ ##### Please refer to ViewComponent website for more details.
20
+
21
+ To use ViewComponent, you'll need to follow the example below. By utilizing this gem, you can make calls like the following:
22
+
23
+ ```
24
+ # Before
25
+ <%= render(MessageComponent.new(name: "World")) %>
26
+
27
+ # After
28
+ <%= render_rc("messageComponent", name: "World") %>
29
+ ```
30
+
31
+ Make sure to incorporate ViewComponent as described in the reference link to enhance your application's functionality.
32
+
33
+
20
34
 
21
35
  ## Development
22
36
 
@@ -26,7 +40,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
26
40
 
27
41
  ## Contributing
28
42
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/view_component_helper.
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yapr/view_component_helper.
30
44
 
31
45
  ## License
32
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViewComponentHelper
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -1,18 +1,20 @@
1
1
  module ViewComponentHelper
2
- module ViewHelper
3
- def render_view_component(path, *args, **kwargs, &)
4
- render component_class_for(path).new(*args, **kwargs, &)
5
- end
2
+ def render_view_component(path, *args, **kwargs, &)
3
+ render component_class_for(path).new(*args, **kwargs, &)
4
+ end
6
5
 
7
- alias render_vc render_view_component
6
+ alias render_vc render_view_component
8
7
 
9
- private
8
+ private
10
9
 
11
- def component_class_for(path)
12
- class_names = path.to_s.split("/")
13
- component_name = class_names.map(&:capitalize).join("::")
10
+ def component_class_for(path)
11
+ class_names = path.to_s.split("/")
12
+ component_name = class_names.map(&:capitalize).join("::")
14
13
 
15
- component_name.constantize
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
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "view_component_helper/view_component_helper"
3
4
  require_relative "view_component_helper/version"
4
5
 
5
6
  module ViewComponentHelper
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.1.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-07-30 00:00:00.000000000 Z
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