vident-view_component 0.1.0 → 0.2.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: 5590c317d217331de001e42e69cf50f15b0423fb7d3e82ae2a504cc9c3432222
4
- data.tar.gz: 6e402b5447b169422a2a4f545a03153f978cc6af6ebd3b839c1aee07e4f4e5e9
3
+ metadata.gz: 531cb753af8f2fe3ed02ae071bdd3f170cb79b37c5a970f5b23401c17ebd1ffb
4
+ data.tar.gz: 6318503f767428d22fc646bd45039faefbe3ec395ad68d384ce6d9e3dd923f07
5
5
  SHA512:
6
- metadata.gz: d6a127daebc5279eae2c0e956463a41c044b45b9d70befbcb22081f942bc0ef45f727b30bb0b8bcb00dcc68304d847477629641925d78859dad0493abaa695f0
7
- data.tar.gz: 63fd79022fec01b0ab59c62fa95097acd17ed97ba0a6a23f65c55ef25d2678876cf03e3e6089ddfd0fd7fa53909f3eadc4b12b975da73bd40ae63716b7f4e7e6
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))
@@ -1,5 +1,5 @@
1
1
  module Vident
2
2
  module ViewComponent
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.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-04-01 00:00:00.000000000 Z
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.8.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.8.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.6
110
+ rubygems_version: 3.4.10
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Vident with ViewComponent