reactionview 0.1.2 → 0.1.4

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.
@@ -22,6 +22,11 @@ module ReActionView
22
22
 
23
23
  # Enable debug mode in development (adds debug attributes to HTML)
24
24
  config.debug_mode = Rails.env.development?
25
+
26
+ # Add custom transform visitors to process templates before compilation
27
+ # config.transform_visitors = [
28
+ # Herb::Visitor::new
29
+ # ]
25
30
  end
26
31
  RUBY
27
32
  end
@@ -30,8 +35,8 @@ module ReActionView
30
35
  say "\nReActionView has been successfully installed! 🎉", :green
31
36
  say "\nNext steps:", :blue
32
37
  say " 1. Review config/initializers/reactionview.rb"
33
- say " 2. Enable `config.intercept_erb = true` to process all .html.erb templates using `Herb::Engine`."
34
- say " 3. Create .html.herb templates for explicit Herb usage."
38
+ say " 2. Enable `config.intercept_erb = true` to process all `*.html.erb` templates using `Herb::Engine`."
39
+ say " 3. Create `*.html.herb` templates for explicit Herb usage."
35
40
 
36
41
  say "\nLearn more:", :yellow
37
42
  say " GitHub: https://github.com/marcoroth/reactionview"
@@ -4,10 +4,12 @@ module ReActionView
4
4
  class Config
5
5
  attr_accessor :intercept_erb
6
6
  attr_accessor :debug_mode
7
+ attr_accessor :transform_visitors
7
8
 
8
9
  def initialize
9
10
  @intercept_erb = false
10
11
  @debug_mode = nil
12
+ @transform_visitors = []
11
13
  end
12
14
 
13
15
  def development?
@@ -31,7 +31,7 @@ module ReActionView
31
31
 
32
32
  config.after_initialize do
33
33
  ActiveSupport.on_load(:action_view) do
34
- ActionView::Template.register_template_handler :erb, ReActionView::Template::Handlers::Herb if ReActionView.config.intercept_erb
34
+ ActionView::Template.register_template_handler :erb, ReActionView::Template::Handlers::ERB if ReActionView.config.intercept_erb
35
35
  end
36
36
  end
37
37
  end
@@ -9,12 +9,21 @@ 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?
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
- debug: ::ReActionView.config.debug_mode_enabled?,
17
25
  content_for_head: reactionview_dev_tools_markup(template),
26
+ visitors: visitors + ReActionView.config.transform_visitors,
18
27
  }
19
28
 
20
29
  erb_implementation.new(source, config).src
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReActionView
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
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
@@ -35,5 +36,5 @@ Gem::Specification.new do |spec|
35
36
  spec.require_paths = ["lib"]
36
37
 
37
38
  spec.add_dependency "actionview", ">= 7.0"
38
- spec.add_dependency "herb", ">= 0.7.0", "< 1.0.0"
39
+ spec.add_dependency "herb", ">= 0.7.5", "< 1.0.0"
39
40
  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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Roth
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-09-09 00:00:00.000000000 Z
10
+ date: 2025-10-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: actionview
@@ -29,7 +29,7 @@ dependencies:
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.7.0
32
+ version: 0.7.5
33
33
  - - "<"
34
34
  - !ruby/object:Gem::Version
35
35
  version: 1.0.0
@@ -39,7 +39,7 @@ dependencies:
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 0.7.0
42
+ version: 0.7.5
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.0.0
@@ -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