regolith 0.1.33 → 0.2.0

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: 050f832680d0ff4425e39f2c3446edb3eee7a3b1ff64ed5e1d0126ca6c2dc02c
4
- data.tar.gz: bfc0fb0f044a41b3ef2a3b122cdf2ff7ca32066a109fef5c8dda8b69897d56f5
3
+ metadata.gz: 8cf31d7589b33d2b6797a7759b0f560cf5c8d6f3a728961728afe8b3f7304f8a
4
+ data.tar.gz: f9d6637dd5a7e9d90ccc250bf42187ccf4bc0a383bbc6b2306950ea819bef940
5
5
  SHA512:
6
- metadata.gz: 3f95c074581514b952c6329c11d8eee00160941c09d6f0ddbf2003ff92b3dadede7cb0de2254949d01567f50f8288f27c1985a66ef60ed9f52690676404ecd18
7
- data.tar.gz: 2674a49555f44e8543ee469682d551faef389efe43dbaba48d248fc04b3df8319202908d4840a5a6c1092d3a7863d225c0edfc76735a2233bc7a082b8bb7e00a
6
+ metadata.gz: 15b100673243b41dee98edcdf6fdfba12b4231e5b634f218a256e9fdc191b2f813771b9ac9dbd8cf941550da8c80890edcbee351a6190a2bc1844d7f7330230a
7
+ data.tar.gz: 8430846023c4ae38edfbc18953342c2e99300a2f60b88bfad40849a3c4977630d0fdfd7ee4178557cf649b4b80cdf99b282364fc28b8de0e060f4dc064a6cd5f
data/lib/regolith/cli.rb CHANGED
@@ -315,6 +315,46 @@ module Regolith
315
315
  File.write(app_rb_path, app_rb_content)
316
316
  end
317
317
 
318
+ def patch_database_yml(service_dir, service_name)
319
+ database_yml_path = "#{service_dir}/config/database.yml"
320
+
321
+ database_config = <<~YAML
322
+ default: &default
323
+ adapter: postgresql
324
+ encoding: unicode
325
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
326
+ host: <%= ENV.fetch('POSTGRES_HOST', 'localhost') %>
327
+ port: <%= ENV.fetch('POSTGRES_PORT', 5432) %>
328
+ database: <%= ENV.fetch('POSTGRES_DB', '#{service_name}_development') %>
329
+ username: <%= ENV.fetch('POSTGRES_USER', 'postgres') %>
330
+ password: <%= ENV.fetch('POSTGRES_PASSWORD', 'password') %>
331
+
332
+ development:
333
+ <<: *default
334
+
335
+ test:
336
+ <<: *default
337
+ database: <%= ENV.fetch('POSTGRES_DB', '#{service_name}_development') %>_test
338
+
339
+ production:
340
+ <<: *default
341
+ url: <%= ENV['DATABASE_URL'] %>
342
+ YAML
343
+
344
+ File.write(database_yml_path, database_config)
345
+ puts "🔧 Updated database.yml for PostgreSQL"
346
+
347
+ # Also check if there are any environment-specific configs that might override this
348
+ dev_config_path = "#{service_dir}/config/environments/development.rb"
349
+ if File.exist?(dev_config_path)
350
+ dev_config = File.read(dev_config_path)
351
+ # Remove any SQLite references
352
+ dev_config.gsub!(/config\.active_record\.database_selector.*?\n/, '')
353
+ dev_config.gsub!(/config\.active_record\.database_resolver.*?\n/, '')
354
+ File.write(dev_config_path, dev_config)
355
+ end
356
+ end
357
+
318
358
  def start_server
319
359
  unless File.exist?('docker-compose.yml')
320
360
  puts "❌ Error: Not in a Regolith app directory"
@@ -1,4 +1,4 @@
1
1
  # lib/regolith/version.rb
2
2
  module Regolith
3
- VERSION = "0.1.33"
3
+ VERSION = "0.2.0"
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.33
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Regolith Team