homura-runtime 0.3.2 → 0.3.3
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/CHANGELOG.md +11 -0
- data/exe/compile-assets +2 -2
- data/exe/compile-erb +5 -7
- data/lib/homura/runtime/build_support.rb +19 -2
- data/lib/homura/runtime/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0560163955bb2302ec43a0942488960bbcd22b083bff564a88160ce3cdf3c3f0'
|
|
4
|
+
data.tar.gz: 27fa38a9b0a34bc406505c9cd1eb04076b2ea205d9dc761cc0fd54b209e411cf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb0bf570d2a2412cb4b5320b756a4f60798ee523efe6b47bf952b136844e44c82aebb54a0d1ef701e649621d7e90ac74e4a0721fdaeb0e42f2bffe7df9e8186f
|
|
7
|
+
data.tar.gz: 129eb1515972a777f3f511213f30c1abb458f5450c527a68a4a38e5bda9aff41151f90f72f29e8054008819b3c67edaa8740ef9e93e786811cc317a20efbf761
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 (2026-05-02)
|
|
4
|
+
|
|
5
|
+
- Make standalone Rack-only builds work without `sinatra-homura` in the
|
|
6
|
+
bundle. `BuildSupport.standalone_load_paths` now treats Sinatra load
|
|
7
|
+
paths as optional while keeping the existing Sinatra app path unchanged.
|
|
8
|
+
- Keep generated empty ERB registries Sinatra-free. Apps with no `.erb`
|
|
9
|
+
templates no longer emit the Sinatra ERB hook, so a Rack-only app can
|
|
10
|
+
compile with `homura-runtime` alone.
|
|
11
|
+
- Guard static-asset middleware auto-installation so the generated asset
|
|
12
|
+
bundle only calls `Sinatra::Base.use` when a real Sinatra app is loaded.
|
|
13
|
+
|
|
3
14
|
## 0.3.2 (2026-04-30)
|
|
4
15
|
|
|
5
16
|
- README: replace the leftover `require 'cloudflare_workers'` line and
|
data/exe/compile-assets
CHANGED
|
@@ -151,8 +151,8 @@ File.open(out_path, 'w') do |io|
|
|
|
151
151
|
|
|
152
152
|
io.puts <<~RUBY
|
|
153
153
|
|
|
154
|
-
# Auto-install the middleware on Sinatra::Base if Sinatra is loaded.
|
|
155
|
-
if defined?(::Sinatra::Base)
|
|
154
|
+
# Auto-install the middleware on Sinatra::Base if a real Sinatra app is loaded.
|
|
155
|
+
if defined?(::Sinatra::Base) && ::Sinatra::Base.respond_to?(:use)
|
|
156
156
|
::Sinatra::Base.use #{ns}::Middleware
|
|
157
157
|
end
|
|
158
158
|
RUBY
|
data/exe/compile-erb
CHANGED
|
@@ -515,11 +515,9 @@ template_root = positional.find { |a| File.directory?(a) } || options[:input_dir
|
|
|
515
515
|
write_file = !options[:stdout] && (positional.empty? || options[:output])
|
|
516
516
|
out_path = options[:output]
|
|
517
517
|
|
|
518
|
-
# An app with zero ERB templates
|
|
519
|
-
#
|
|
520
|
-
#
|
|
521
|
-
# at runtime instead of silently disappearing, and so the build
|
|
522
|
-
# pipeline doesn't fail when there is nothing to compile.
|
|
518
|
+
# An app with zero ERB templates is valid, including Rack-only apps
|
|
519
|
+
# that do not ship sinatra-homura at all. Emit the empty registry, but
|
|
520
|
+
# skip the Sinatra hook so `homura-runtime` remains Sinatra-free.
|
|
523
521
|
if inputs.empty?
|
|
524
522
|
warn "compile-erb: no .erb files under #{options[:input_dir]}/ — writing empty registry"
|
|
525
523
|
end
|
|
@@ -529,11 +527,11 @@ if write_file
|
|
|
529
527
|
File.open(out_path, 'w') do |io|
|
|
530
528
|
emit_header(io, namespace)
|
|
531
529
|
emit_templates(io, inputs, namespace, template_root)
|
|
532
|
-
emit_sinatra_patch(io, namespace)
|
|
530
|
+
emit_sinatra_patch(io, namespace) unless inputs.empty?
|
|
533
531
|
end
|
|
534
532
|
warn "compile-erb: wrote #{out_path} (#{inputs.size} templates)"
|
|
535
533
|
else
|
|
536
534
|
emit_header($stdout, namespace)
|
|
537
535
|
emit_templates($stdout, inputs, namespace, template_root)
|
|
538
|
-
emit_sinatra_patch($stdout, namespace)
|
|
536
|
+
emit_sinatra_patch($stdout, namespace) unless inputs.empty?
|
|
539
537
|
end
|
|
@@ -39,6 +39,23 @@ module HomuraRuntime
|
|
|
39
39
|
nil
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
def maybe_gem_lib(name, loaded_specs: Gem.loaded_specs)
|
|
43
|
+
spec = loaded_spec(name, loaded_specs: loaded_specs)
|
|
44
|
+
return nil unless spec
|
|
45
|
+
|
|
46
|
+
File.join(spec.full_gem_path, 'lib')
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def maybe_gem_vendor(name, loaded_specs: Gem.loaded_specs)
|
|
50
|
+
spec = loaded_spec(name, loaded_specs: loaded_specs)
|
|
51
|
+
return nil unless spec
|
|
52
|
+
|
|
53
|
+
vendor = File.join(spec.full_gem_path, 'vendor')
|
|
54
|
+
return vendor if Dir.exist?(vendor)
|
|
55
|
+
|
|
56
|
+
nil
|
|
57
|
+
end
|
|
58
|
+
|
|
42
59
|
def runtime_file(*names, current_file: __FILE__, loaded_specs: Gem.loaded_specs)
|
|
43
60
|
runtime_root(current_file: current_file, loaded_specs: loaded_specs).join('runtime', *names)
|
|
44
61
|
end
|
|
@@ -71,8 +88,8 @@ module HomuraRuntime
|
|
|
71
88
|
[
|
|
72
89
|
gem_lib(RUNTIME_GEM_NAME, loaded_specs: loaded_specs),
|
|
73
90
|
gem_vendor(RUNTIME_GEM_NAME, loaded_specs: loaded_specs),
|
|
74
|
-
|
|
75
|
-
|
|
91
|
+
maybe_gem_lib(SINATRA_GEM_NAME, loaded_specs: loaded_specs),
|
|
92
|
+
maybe_gem_vendor(SINATRA_GEM_NAME, loaded_specs: loaded_specs)
|
|
76
93
|
].compact.each do |path|
|
|
77
94
|
load_paths << path
|
|
78
95
|
end
|