reactionview 0.1.4 → 0.1.6

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: 759c72b49aa6f260c5fe480829b691ad1f18a9d0cf2d009e91d63a64e72ccf46
4
- data.tar.gz: d9f91b3cac05b87187c4ff49c9983a929d82b14848423e1370534675c73ef45a
3
+ metadata.gz: a9ee1ff2149791b83d72bae4971072283d8842089ad0a693cafa82f91468ec68
4
+ data.tar.gz: e9ff25dcd09cc2ed81754721b8a8087ed7026a999a8aa5e6b73435ab1165cd4f
5
5
  SHA512:
6
- metadata.gz: de2c78c653976d81ad8031c47b10637ee320167cc74a51a7f311bc0e21dc9f2cc086f6ccc192563dce6be9aa7993b4414df83c443a894070f307485559810528
7
- data.tar.gz: b0e4b6bdfde0ac204ae0557755b5f4b1f8b7f0b4a20102af94a016cfb647d9d083569d3aae1f43efe899d7d73e32827401dafccc349e1f69beed70145655b69b
6
+ metadata.gz: 0ce297c60ee88c3e386fede727cc2eb11f2e9fcf8c7c85ed7dd887c05fe640e23648040346a3c54c46c0825d4032837bc37444b7d033f55154d4910d2924137e
7
+ data.tar.gz: 2f45e3e9da625e7c0ad3d3dec260f74976f83040db423a00f12a943a50816c21574466ebf7a2f92bdedaafca35e68b728de8890990854759088153a0de63c6c5
@@ -11,7 +11,7 @@ module ReActionView
11
11
  def call(template, source)
12
12
  visitors = []
13
13
 
14
- if ::ReActionView.config.debug_mode_enabled?
14
+ if ::ReActionView.config.debug_mode_enabled? && local_template?(template)
15
15
  visitors << ::Herb::Engine::DebugVisitor.new(
16
16
  file_path: template.identifier,
17
17
  project_path: Rails.root.to_s
@@ -37,12 +37,37 @@ module ReActionView
37
37
  template.identifier.include?("/layouts/")
38
38
  end
39
39
 
40
+ def local_template?(template)
41
+ return true unless template.respond_to?(:identifier) && template.identifier
42
+
43
+ ActionController::Base.view_paths
44
+ .select { |view_path| view_path.path.start_with?(Rails.root.to_s) }
45
+ .any? { |view_path| template.identifier.start_with?(view_path.path) }
46
+ end
47
+
48
+ def active_support_editor
49
+ return unless defined?(ActiveSupport::Editor)
50
+ return if ActiveSupport::Editor.current.blank?
51
+
52
+ ActiveSupport::Editor.current.instance_variable_get(:@url_pattern).split("://").first
53
+ end
54
+
55
+ def editor_meta_tag
56
+ editor_name = active_support_editor || ENV["RAILS_EDITOR"] || ENV.fetch("EDITOR", nil)
57
+
58
+ return if editor_name.blank?
59
+
60
+ %(<meta name="herb-default-editor" content="#{editor_name}">)
61
+ end
62
+
40
63
  def reactionview_dev_tools_markup(template)
41
64
  return nil unless layout_template?(template) && ::ReActionView.config.debug_mode_enabled?
65
+ return nil unless local_template?(template)
42
66
 
43
67
  <<~HTML
44
68
  <meta name="herb-debug-mode" content="true">
45
- <meta name="herb-rails-root" content="#{Rails.root}">
69
+ <meta name="herb-project-path" content="#{Rails.root}">
70
+ #{editor_meta_tag}
46
71
 
47
72
  #{ActionController::Base.new.view_context.javascript_include_tag "reactionview-dev-tools.umd.js", defer: true}
48
73
  HTML
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReActionView
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.6"
5
5
  end
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.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-12 00:00:00.000000000 Z
10
+ date: 2025-11-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: actionview