Skip to content

Commit c459753

Browse files
authored
Introduce Herb::Engine (#472)
1 parent 285cbe3 commit c459753

File tree

162 files changed

+13307
-2578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+13307
-2578
lines changed

.rubocop.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,22 @@ Metrics/CyclomaticComplexity:
4848
Exclude:
4949
- lib/herb/project.rb
5050
- lib/herb/ast/nodes.rb
51+
- lib/herb/cli.rb
52+
- lib/herb/engine.rb
53+
- lib/herb/engine/**/*.rb
5154

5255
Metrics/MethodLength:
5356
Max: 20
5457
Exclude:
5558
- lib/herb/ast/nodes.rb
5659
- lib/herb/cli.rb
5760
- lib/herb/project.rb
61+
- lib/herb/engine.rb
62+
- lib/herb/engine/**/*.rb
5863
- templates/template.rb
5964
- test/fork_helper.rb
6065
- test/snapshot_utils.rb
66+
- bin/**/*
6167

6268
Metrics/AbcSize:
6369
Exclude:
@@ -66,44 +72,64 @@ Metrics/AbcSize:
6672
- lib/herb/cli.rb
6773
- lib/herb/errors.rb
6874
- lib/herb/project.rb
75+
- lib/herb/engine.rb
76+
- lib/herb/engine/**/*.rb
6977
- templates/template.rb
7078
- test/fork_helper.rb
7179
- test/snapshot_utils.rb
80+
- bin/**/*
7281

7382
Metrics/ClassLength:
7483
Exclude:
7584
- lib/herb/cli.rb
7685
- lib/herb/project.rb
7786
- lib/herb/visitor.rb
87+
- lib/herb/engine.rb
88+
- lib/herb/engine/**/*.rb
89+
- bin/**/*
7890
- test/**/*_test.rb
7991

92+
Metrics/ModuleLength:
93+
Exclude:
94+
- test/**/*.rb
95+
8096
Metrics/BlockLength:
8197
Max: 30
8298
Exclude:
8399
- Rakefile
84100
- "*.gemspec"
85101
- "**/*.rake"
102+
- lib/herb/cli.rb
86103
- lib/herb/project.rb
87104
- test/**/*_test.rb
105+
- bin/**/*
88106

89107
Metrics/ParameterLists:
90108
Exclude:
91109
- lib/herb/ast/nodes.rb
92110
- lib/herb/errors.rb
111+
- lib/herb/engine/validators/security_validator.rb
93112

94113
Metrics/PerceivedComplexity:
95114
Exclude:
96115
- lib/herb/ast/nodes.rb
97116
- lib/herb/cli.rb
98117
- lib/herb/project.rb
99-
- test/snapshot_utils.rb
118+
- lib/herb/engine.rb
119+
- lib/herb/engine/**/*.rb
120+
- test/**/*.rb
121+
- bin/**/*
100122

101123
Layout/LineLength:
102124
Max: 120
103125
Exclude:
104126
- test/**/*_test.rb
105127
- lib/herb/token.rb
106128
- lib/herb/ast/nodes.rb
129+
- lib/herb/engine/error_formatter.rb
130+
- lib/herb/engine/debug_visitor.rb
131+
- lib/herb/engine/parser_error_overlay.rb
132+
- lib/herb/engine/validation_error_overlay.rb
107133

108134
Layout/EmptyLines:
109135
Exclude:
@@ -128,7 +154,14 @@ Layout/LeadingCommentSpace:
128154
Security/Eval:
129155
Exclude:
130156
- Rakefile
157+
- lib/herb/cli.rb
158+
- test/**/*.rb
159+
- bin/erubi-render
131160

132161
Security/MarshalLoad:
133162
Exclude:
134163
- test/fork_helper.rb
164+
165+
Lint/UnderscorePrefixedVariableName:
166+
Exclude:
167+
- test/engine/secure_compiler_test.rb

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gemspec
66

77
gem "prism", github: "ruby/prism", tag: "v1.4.0"
88

9+
gem "actionview", "~> 8.0"
910
gem "lz_string"
1011
gem "maxitest"
1112
gem "minitest-difftastic", "~> 0.2"

Gemfile.lock

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ PATH
2222
GEM
2323
remote: https://rubygems.org/
2424
specs:
25-
activesupport (8.0.2)
25+
actionview (8.0.2.1)
26+
activesupport (= 8.0.2.1)
27+
builder (~> 3.1)
28+
erubi (~> 1.11)
29+
rails-dom-testing (~> 2.2)
30+
rails-html-sanitizer (~> 1.6)
31+
activesupport (8.0.2.1)
2632
base64
2733
benchmark (>= 0.3)
2834
bigdecimal
@@ -39,8 +45,10 @@ GEM
3945
base64 (0.3.0)
4046
benchmark (0.4.1)
4147
bigdecimal (3.2.2)
48+
builder (3.3.0)
4249
concurrent-ruby (1.3.5)
4350
connection_pool (2.5.3)
51+
crass (1.0.6)
4452
csv (3.3.5)
4553
difftastic (0.7.0)
4654
pretty_please
@@ -53,6 +61,7 @@ GEM
5361
dispersion (0.2.0)
5462
prism
5563
drb (2.2.3)
64+
erubi (1.13.1)
5665
ffi (1.17.2-aarch64-linux-gnu)
5766
ffi (1.17.2-aarch64-linux-musl)
5867
ffi (1.17.2-arm64-darwin)
@@ -62,28 +71,50 @@ GEM
6271
fileutils (1.7.3)
6372
i18n (1.14.7)
6473
concurrent-ruby (~> 1.0)
65-
io-console (0.8.0)
66-
json (2.12.2)
74+
io-console (0.8.1)
75+
json (2.13.2)
6776
language_server-protocol (3.17.0.5)
6877
lint_roller (1.1.0)
6978
listen (3.9.0)
7079
rb-fsevent (~> 0.10, >= 0.10.3)
7180
rb-inotify (~> 0.9, >= 0.9.10)
7281
logger (1.7.0)
82+
loofah (2.24.1)
83+
crass (~> 1.0.2)
84+
nokogiri (>= 1.12.0)
7385
lz_string (0.3.0)
7486
maxitest (6.0.0)
7587
minitest (>= 5.20.0, < 5.26.0)
7688
minitest (5.25.5)
7789
minitest-difftastic (0.2.1)
7890
difftastic (~> 0.6)
7991
mutex_m (0.3.0)
92+
nokogiri (1.18.9-aarch64-linux-gnu)
93+
racc (~> 1.4)
94+
nokogiri (1.18.9-aarch64-linux-musl)
95+
racc (~> 1.4)
96+
nokogiri (1.18.9-arm64-darwin)
97+
racc (~> 1.4)
98+
nokogiri (1.18.9-x86_64-darwin)
99+
racc (~> 1.4)
100+
nokogiri (1.18.9-x86_64-linux-gnu)
101+
racc (~> 1.4)
102+
nokogiri (1.18.9-x86_64-linux-musl)
103+
racc (~> 1.4)
80104
parallel (1.27.0)
81-
parser (3.3.8.0)
105+
parser (3.3.9.0)
82106
ast (~> 2.4.1)
83107
racc
84108
pretty_please (0.2.0)
85109
dispersion (~> 0.2)
86110
racc (1.8.1)
111+
rails-dom-testing (2.3.0)
112+
activesupport (>= 5.0.0)
113+
minitest
114+
nokogiri (>= 1.6)
115+
rails-html-sanitizer (1.6.2)
116+
loofah (~> 2.21)
117+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
87118
rainbow (3.1.1)
88119
rake (13.3.0)
89120
rake-compiler (1.3.0)
@@ -94,30 +125,30 @@ GEM
94125
ffi (~> 1.0)
95126
rbs (3.9.4)
96127
logger
97-
regexp_parser (2.10.0)
98-
reline (0.6.1)
128+
regexp_parser (2.11.2)
129+
reline (0.6.2)
99130
io-console (~> 0.5)
100-
rubocop (1.77.0)
131+
rubocop (1.80.1)
101132
json (~> 2.3)
102133
language_server-protocol (~> 3.17.0.2)
103134
lint_roller (~> 1.1.0)
104135
parallel (~> 1.10)
105136
parser (>= 3.3.0.2)
106137
rainbow (>= 2.2.2, < 4.0)
107138
regexp_parser (>= 2.9.3, < 3.0)
108-
rubocop-ast (>= 1.45.1, < 2.0)
139+
rubocop-ast (>= 1.46.0, < 2.0)
109140
ruby-progressbar (~> 1.7)
110141
unicode-display_width (>= 2.4.0, < 4.0)
111-
rubocop-ast (1.45.1)
142+
rubocop-ast (1.46.0)
112143
parser (>= 3.3.7.2)
113144
prism (~> 1.4)
114145
ruby-progressbar (1.13.0)
115146
securerandom (0.4.1)
116-
sorbet (0.5.12214)
117-
sorbet-static (= 0.5.12214)
118-
sorbet-static (0.5.12214-aarch64-linux)
119-
sorbet-static (0.5.12214-universal-darwin)
120-
sorbet-static (0.5.12214-x86_64-linux)
147+
sorbet (0.6.12473)
148+
sorbet-static (= 0.6.12473)
149+
sorbet-static (0.6.12473-aarch64-linux)
150+
sorbet-static (0.6.12473-universal-darwin)
151+
sorbet-static (0.6.12473-x86_64-linux)
121152
steep (1.10.0)
122153
activesupport (>= 5.1)
123154
concurrent-ruby (>= 1.1.10)
@@ -140,21 +171,24 @@ GEM
140171
unicode-display_width (>= 1.1.1, < 4)
141172
tzinfo (2.0.6)
142173
concurrent-ruby (~> 1.0)
143-
unicode-display_width (3.1.4)
174+
unicode-display_width (3.1.5)
144175
unicode-emoji (~> 4.0, >= 4.0.4)
145176
unicode-emoji (4.0.4)
146177
uri (1.0.3)
147178

148179
PLATFORMS
180+
aarch64-linux
149181
aarch64-linux-gnu
150182
aarch64-linux-musl
151183
arm64-darwin
184+
universal-darwin
152185
x86_64-darwin
153186
x86_64-linux
154187
x86_64-linux-gnu
155188
x86_64-linux-musl
156189

157190
DEPENDENCIES
191+
actionview (~> 8.0)
158192
herb!
159193
lz_string
160194
maxitest
@@ -170,4 +204,4 @@ DEPENDENCIES
170204
steep (~> 1.10)
171205

172206
BUNDLED WITH
173-
2.6.3
207+
2.7.1

Steepfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ target :lib do
77

88
library "delegate"
99
library "json"
10+
library "tempfile"
11+
library "pathname"
1012

1113
ignore "lib/herb/cli.rb"
1214
ignore "lib/herb/libherb.rb"
1315
ignore "lib/herb/libherb"
1416
ignore "lib/herb/project.rb"
17+
ignore "lib/herb/engine/error_formatter.rb"
1518
end

0 commit comments

Comments
 (0)