reactionview 0.1.3 → 0.1.5

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: 7e1a5390cd92d576fc8ec4b4baaa48a0cb5295cffaca784418ec813fb1df5cb5
4
- data.tar.gz: 5a0b9bc625badb41203e2db46bed4f356d14811dced90e63282db300c959eada
3
+ metadata.gz: c644cc29cb89b6a3c99cfdd0af5d068341aefb0ca0829d1f93d974372a8b7452
4
+ data.tar.gz: 1e7514f308c34416e30687c80995db9a3076273a4707ea9e35e1692268f4c465
5
5
  SHA512:
6
- metadata.gz: 462b5f1c1ab86c8d138980ef82792ab004144f8d1b7f12cb8afec72d61eedd5e51d9f06a8af75c8b000e720625f3f7b86010dd4afaa9c04fe27c2cc53344f38d
7
- data.tar.gz: a8e96b0cb994853857e04741043173149c40b7afdfb0f1a0fa12c031ea8f6c14bc073119a010c6687547e0f407be50c95ee1674acf79b61267b41cc388d41400
6
+ metadata.gz: bd8637092413b51ee333d7dd42e708adc08107cf53b35f637c9cde13f97b1bfbdd461b995c4e24fd140e1ebcd9c8295e8c316ae2ce61107af3bc400a8b47f1fd
7
+ data.tar.gz: 31c694de1a363be722e642e7171dea5df9997e2c6992c0d1c3b9b93ecdf6a5df7ed7d15f6600f8ba244b3c2edabe17a547f143293071fbd79ddc7c227fa27a22
@@ -9,21 +9,23 @@ module ReActionView
9
9
  class_attribute :erb_implementation, default: Handlers::Herb::Herb
10
10
 
11
11
  def call(template, source)
12
+ visitors = []
13
+
14
+ if ::ReActionView.config.debug_mode_enabled? && local_template?(template)
15
+ visitors << ::Herb::Engine::DebugVisitor.new(
16
+ file_path: template.identifier,
17
+ project_path: Rails.root.to_s
18
+ )
19
+ end
20
+
12
21
  config = {
13
22
  filename: template.identifier,
14
23
  project_path: Rails.root.to_s,
15
24
  validation_mode: :overlay,
16
25
  content_for_head: reactionview_dev_tools_markup(template),
17
- visitors: ReActionView.config.transform_visitors,
26
+ visitors: visitors + ReActionView.config.transform_visitors,
18
27
  }
19
28
 
20
- if ::ReActionView.config.debug_mode_enabled?
21
- config[:visitors] << ::Herb::Engine::DebugVisitor.new(
22
- file_path: template.identifier,
23
- project_path: Rails.root.to_s
24
- )
25
- end
26
-
27
29
  erb_implementation.new(source, config).src
28
30
  end
29
31
 
@@ -35,8 +37,15 @@ module ReActionView
35
37
  template.identifier.include?("/layouts/")
36
38
  end
37
39
 
40
+ def local_template?(template)
41
+ return true unless template.respond_to?(:identifier) && template.identifier
42
+
43
+ template.identifier.start_with?("#{Rails.root}/app/views")
44
+ end
45
+
38
46
  def reactionview_dev_tools_markup(template)
39
47
  return nil unless layout_template?(template) && ::ReActionView.config.debug_mode_enabled?
48
+ return nil unless local_template?(template)
40
49
 
41
50
  <<~HTML
42
51
  <meta name="herb-debug-mode" content="true">
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReActionView
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
data/reactionview.gemspec CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.version = ReActionView::VERSION
8
8
  spec.authors = ["Marco Roth"]
9
9
  spec.email = ["marco.roth@intergga.ch"]
10
+ spec.license = "MIT"
10
11
 
11
12
  spec.summary = "An ActionView-compatible ERB engine with modern DX - re-imagined with Herb."
12
13
  spec.description = spec.summary
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactionview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-07 00:00:00.000000000 Z
10
+ date: 2025-10-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: actionview
@@ -70,7 +70,8 @@ files:
70
70
  - reactionview.gemspec
71
71
  - sig/reactionview.rbs
72
72
  homepage: https://reactionview.dev
73
- licenses: []
73
+ licenses:
74
+ - MIT
74
75
  metadata:
75
76
  homepage_uri: https://reactionview.dev
76
77
  source_code_uri: https://github.com/marcoroth/reactionview