superview 1.0.0 → 1.0.1

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: 76c8014ae40d2045b7ad8f93e8005aa7f3af1cfc7568579e2dea783c16c94840
4
- data.tar.gz: db2d98cf482c7c8055a58758b3c409f6f48694fd6b114fe5045803cbac53cf96
3
+ metadata.gz: bf2d8ead19d68999eccbddbbfa0ea8b93ef447588c28f202d326d74044658168
4
+ data.tar.gz: 6812b0c74b9940484b547439da76a7bba4b7286ada32bd9a5144a1f71bace544
5
5
  SHA512:
6
- metadata.gz: 92697e127638e7ca678b97ca776131a9e4ca1ccae741b62bab41deea80e6e6d268fb7d37abff2dc0dbae9004e0a6973ff56c51fa1bbb6a7a40d1cd1f7c82d4ba
7
- data.tar.gz: a806923fbf0f9048b9deafe38a8eb1f5f2ed933acb0095c38c222f17c01e0378c6518931018ece0d41b41d70659e519dae641d467f6f6d04bebc041c0ea23bcf
6
+ metadata.gz: 8c9582849a4511fc9b23f049adee0f04a9a3b53837cdaf4621475d27e8757f2e1158482318871269c6b74684faf75778ef11f478830bd5a172de290586601308
7
+ data.tar.gz: 659e0d17f9ac6c335438fb42040c24817ba0313b29f9a0610cb83e0f2daf44d7c01b50ff90f2f29292229fb35d6e6ae6b23f521714a3c8c9d909c32dc65e9ade
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superview (1.0.0)
4
+ superview (1.0.1)
5
5
  zeitwerk (~> 2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -9,7 +9,7 @@ class PostsController < ApplicationController
9
9
 
10
10
  before_action :load_post
11
11
 
12
- class Show < ApplicationComponent
12
+ class Show < Components::Base
13
13
  attr_accessor :post
14
14
 
15
15
  def view_template(&)
@@ -78,7 +78,7 @@ class PostsController < ApplicationController
78
78
 
79
79
  before_action :load_post
80
80
 
81
- class Show < ApplicationComponent
81
+ class Show < Components::Base
82
82
  attr_accessor :post
83
83
 
84
84
  def view_template(&)
@@ -120,7 +120,7 @@ class PostsController < ApplicationController
120
120
 
121
121
  # Your code...
122
122
 
123
- class Show < ApplicationComponent
123
+ class Show < Components::Base
124
124
  attr_accessor :post
125
125
 
126
126
  def view_template(&)
@@ -186,7 +186,7 @@ First let's extract the `Show` class into `./app/views/posts/show.rb`
186
186
  ```ruby
187
187
  # ./app/views/posts/show.rb
188
188
  module Posts
189
- class Show < ApplicationComponent
189
+ class Show < Components::Base
190
190
  attr_accessor :post
191
191
 
192
192
  def view_template(&)
@@ -13,7 +13,7 @@ module Superview
13
13
  #
14
14
  # before_action :load_post
15
15
  #
16
- # class Show < ApplicationComponent
16
+ # class Show < Phlex::HTML
17
17
  # attr_accessor :post
18
18
  #
19
19
  # def view_template(&)
@@ -90,9 +90,18 @@ module Superview
90
90
  # If it resolves a Phlex class in the controller, it will render that. If it's
91
91
  # not found it continues with Rails method of resolving action names.
92
92
  def method_for_action(action_name)
93
- super || if component_action_exists? action_name
94
- "default_component_render"
95
- end
93
+ # Yep. `super` calls this, but we have to call it here to cover the
94
+ # situation where the person uas a `./app/views/users/*.rb` file with a Ruby
95
+ # class in it that might be included in the controller via `include Views::Users`.
96
+ # If we call super first, it will tink that `./app/views/users/show.rb` is a template
97
+ # and raise an error that it doesn't have a format.
98
+ if action_method?(action_name)
99
+ action_name
100
+ elsif component_action_exists? action_name
101
+ "default_component_render"
102
+ else
103
+ super
104
+ end
96
105
  end
97
106
 
98
107
  # Renders a Phlex view for the given action, if it's present.
@@ -20,7 +20,7 @@ module Superview::Components
20
20
  # end
21
21
  # ```
22
22
 
23
- class TableComponent < ApplicationComponent
23
+ class TableComponent < Phlex::HTML
24
24
  if Phlex.const_defined?(:DeferredRender)
25
25
  # Phlex 1.0
26
26
  include Phlex::DeferredRender
@@ -2,7 +2,7 @@ module Superview
2
2
  module Helpers
3
3
  module Turbo
4
4
  # Renders the metatags for setting up Turbo Drive.
5
- class MetaTags < ApplicationComponent
5
+ class MetaTags < Phlex::HTML
6
6
  attr_accessor \
7
7
  :method,
8
8
  :scroll,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Superview
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superview
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-01-29 00:00:00.000000000 Z
10
+ date: 2025-10-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: zeitwerk
@@ -91,7 +90,6 @@ metadata:
91
90
  homepage_uri: https://github.com/rubymonolith/superview
92
91
  source_code_uri: https://github.com/rubymonolith/superview
93
92
  changelog_uri: https://github.com/rubymonolith/superview
94
- post_install_message:
95
93
  rdoc_options: []
96
94
  require_paths:
97
95
  - lib
@@ -106,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
104
  - !ruby/object:Gem::Version
107
105
  version: '0'
108
106
  requirements: []
109
- rubygems_version: 3.5.22
110
- signing_key:
107
+ rubygems_version: 3.6.2
111
108
  specification_version: 4
112
109
  summary: Build Rails applications entirely from Phlex, ViewComponents, or any object
113
110
  that responds to `#render_in`