reactionview 0.1.5 → 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: c644cc29cb89b6a3c99cfdd0af5d068341aefb0ca0829d1f93d974372a8b7452
4
- data.tar.gz: 1e7514f308c34416e30687c80995db9a3076273a4707ea9e35e1692268f4c465
3
+ metadata.gz: a9ee1ff2149791b83d72bae4971072283d8842089ad0a693cafa82f91468ec68
4
+ data.tar.gz: e9ff25dcd09cc2ed81754721b8a8087ed7026a999a8aa5e6b73435ab1165cd4f
5
5
  SHA512:
6
- metadata.gz: bd8637092413b51ee333d7dd42e708adc08107cf53b35f637c9cde13f97b1bfbdd461b995c4e24fd140e1ebcd9c8295e8c316ae2ce61107af3bc400a8b47f1fd
7
- data.tar.gz: 31c694de1a363be722e642e7171dea5df9997e2c6992c0d1c3b9b93ecdf6a5df7ed7d15f6600f8ba244b3c2edabe17a547f143293071fbd79ddc7c227fa27a22
6
+ metadata.gz: 0ce297c60ee88c3e386fede727cc2eb11f2e9fcf8c7c85ed7dd887c05fe640e23648040346a3c54c46c0825d4032837bc37444b7d033f55154d4910d2924137e
7
+ data.tar.gz: 2f45e3e9da625e7c0ad3d3dec260f74976f83040db423a00f12a943a50816c21574466ebf7a2f92bdedaafca35e68b728de8890990854759088153a0de63c6c5
@@ -40,7 +40,24 @@ module ReActionView
40
40
  def local_template?(template)
41
41
  return true unless template.respond_to?(:identifier) && template.identifier
42
42
 
43
- template.identifier.start_with?("#{Rails.root}/app/views")
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}">)
44
61
  end
45
62
 
46
63
  def reactionview_dev_tools_markup(template)
@@ -49,7 +66,8 @@ module ReActionView
49
66
 
50
67
  <<~HTML
51
68
  <meta name="herb-debug-mode" content="true">
52
- <meta name="herb-rails-root" content="#{Rails.root}">
69
+ <meta name="herb-project-path" content="#{Rails.root}">
70
+ #{editor_meta_tag}
53
71
 
54
72
  #{ActionController::Base.new.view_context.javascript_include_tag "reactionview-dev-tools.umd.js", defer: true}
55
73
  HTML
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReActionView
4
- VERSION = "0.1.5"
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.5
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-19 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