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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 973264713948f2e5db2ff16f9e3b8c1d3a8655658315965fd40ddd4e977d9a6e
4
- data.tar.gz: 5643b91bcf2e95c3f2e47851409e28c2c0993a72fea4f7ab42d18911fa0314a9
3
+ metadata.gz: 0f69bb3b17c78b25057627158d7ff12fd6a6e13fae842bb0b0ac663614fffccd
4
+ data.tar.gz: d166ce29e11051e4ddbfbccf7c157ce76ebaf8ac773481db20015b74857ce427
5
5
  SHA512:
6
- metadata.gz: e934b3a272665af2195a4a0987705605477f2a0ff0fc53f38406c19ccbb50d94fef8696df638272d31cf0f18431d1207445a4d894d797c1b77abd5708c6d5b26
7
- data.tar.gz: f6d5df82730c20811d366b100aa9d666cd1662e060aa71387c2b571014d36105952ee5d7d90bf8afd3b1e2cf844070e0dcf7b4d2214339b76d600e9d6407c900
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
- # Find the end of the Application class and insert before it
260
- if app_rb_content =~ /^(\s*)end\s*$/
261
- app_rb_content.gsub!(/^(\s*)end\s*$/) do |match|
262
- indent = $1
263
- "#{cors_config}\n#{indent}end"
264
- end
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)
@@ -1,4 +1,4 @@
1
1
  # lib/regolith/version.rb
2
2
  module Regolith
3
- VERSION = "0.1.27"
3
+ VERSION = "0.1.28"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regolith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Regolith Team