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 +4 -4
- data/lib/reactionview/template/handlers/herb.rb +20 -2
- data/lib/reactionview/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9ee1ff2149791b83d72bae4971072283d8842089ad0a693cafa82f91468ec68
|
|
4
|
+
data.tar.gz: e9ff25dcd09cc2ed81754721b8a8087ed7026a999a8aa5e6b73435ab1165cd4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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-
|
|
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
|
data/lib/reactionview/version.rb
CHANGED
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
|
+
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
|
+
date: 2025-11-03 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: actionview
|