vident-view_component 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vident/view_component/base.rb +26 -0
- data/lib/vident/view_component/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 531cb753af8f2fe3ed02ae071bdd3f170cb79b37c5a970f5b23401c17ebd1ffb
|
4
|
+
data.tar.gz: 6318503f767428d22fc646bd45039faefbe3ec395ad68d384ce6d9e3dd923f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d97303c3d10624e0fb7436c0ef7e90fea4ae1f0870929a07c3029f461b5771b08472ffb5b10e4148080e4d15fcfce63a7c20ebe61f4e4c48b936b024fda0f03
|
7
|
+
data.tar.gz: ac764eab2b7ca18370f087fefd4d6de96e2ac419359c50873c789ef6ee62d47eb4edfa609281931fbe8106183cfcc2d83aae42a697627b5bbd0a98d80cc2c65f
|
@@ -3,6 +3,32 @@ module Vident
|
|
3
3
|
class Base < ::ViewComponent::Base
|
4
4
|
include ::Vident::Component
|
5
5
|
|
6
|
+
class << self
|
7
|
+
def current_component_modified_time
|
8
|
+
sidecar_view_modified_time + rb_component_modified_time
|
9
|
+
end
|
10
|
+
|
11
|
+
def sidecar_view_modified_time
|
12
|
+
::File.exist?(template_path) ? ::File.mtime(template_path).to_i.to_s : ""
|
13
|
+
end
|
14
|
+
|
15
|
+
def rb_component_modified_time
|
16
|
+
::File.exist?(component_path) ? ::File.mtime(component_path).to_i.to_s : ""
|
17
|
+
end
|
18
|
+
|
19
|
+
def template_path
|
20
|
+
File.join components_base_path, "#{virtual_path}.html.erb"
|
21
|
+
end
|
22
|
+
|
23
|
+
def component_path
|
24
|
+
File.join components_base_path, "#{virtual_path}.rb"
|
25
|
+
end
|
26
|
+
|
27
|
+
def components_base_path
|
28
|
+
::Rails.configuration.view_component.view_component_path || "app/components"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
6
32
|
# Helper to create the main element
|
7
33
|
def parent_element(**options)
|
8
34
|
@parent_element ||= RootComponent.new(**parent_element_attributes(options))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vident-view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Ierodiaconou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
39
|
+
version: 0.9.0
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '1'
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.9.0
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '1'
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.4.
|
110
|
+
rubygems_version: 3.4.10
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Vident with ViewComponent
|