regolith 0.1.27 → 0.1.28
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/regolith/cli.rb +9 -6
- data/lib/regolith/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: 0f69bb3b17c78b25057627158d7ff12fd6a6e13fae842bb0b0ac663614fffccd
|
4
|
+
data.tar.gz: d166ce29e11051e4ddbfbccf7c157ce76ebaf8ac773481db20015b74857ce427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 131432552c9bcfeab83d7a5e814dc27d2f8a819addccc168fa5c8b05e56f34ad9313923a98c1dafd7ccaa31d591847464164854e75b8b83b00d66f1c3e6a4264
|
7
|
+
data.tar.gz: 037d67f0cf5e6a24f50e24dc46599d9f006c1e8b0baf65ff35769487ff066863fa50ede63f51e3cff196b42d58e23f2d1626c6e6bf131bfd1e3a14d712a5d5e0
|
data/lib/regolith/cli.rb
CHANGED
@@ -244,6 +244,7 @@ module Regolith
|
|
244
244
|
app_rb_content = File.read(app_rb_path)
|
245
245
|
|
246
246
|
cors_config = <<~RUBY
|
247
|
+
|
247
248
|
# Regolith configuration
|
248
249
|
config.middleware.insert_before 0, Rack::Cors do
|
249
250
|
allow do
|
@@ -256,12 +257,14 @@ module Regolith
|
|
256
257
|
config.regolith_service_port = #{port}
|
257
258
|
RUBY
|
258
259
|
|
259
|
-
#
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
260
|
+
# More precise regex - find the Application class and its specific end
|
261
|
+
# This handles the case where there's both a class and module end
|
262
|
+
app_rb_content.gsub!(/(class\s+Application\s*<\s*Rails::Application.*?)(^\s*end$)/m) do |match|
|
263
|
+
class_content = $1
|
264
|
+
class_end = $2
|
265
|
+
|
266
|
+
# Insert the config before the class end
|
267
|
+
"#{class_content}#{cors_config}\n#{class_end}"
|
265
268
|
end
|
266
269
|
|
267
270
|
File.write(app_rb_path, app_rb_content)
|
data/lib/regolith/version.rb
CHANGED