stable-cli-rails 0.6.2 → 0.6.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stable/cli.rb +8 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df1dff802e1adf63c1f0dd70227d09a33a32fb2678a06867a260208344cce9fe
4
- data.tar.gz: 1da4b5ca121d014c248cf3bad353cfc2176a03c85c8a5fb0ba23a15d437a7c65
3
+ metadata.gz: 3218e61a2bbc965b952621aadbd8eefdbe1c3d982b4a7467de087700201f7823
4
+ data.tar.gz: 1a401494bec7fd015c4dd21d019b39cdec1cbbd369c6cac0087f27ebf3320b70
5
5
  SHA512:
6
- metadata.gz: 96df4f8ef2eda56be3d7749436315bb1108969adc30c94daaf5d1c9fded4f83d027347dd228b587d7a821f63e27fdc36be85322523491bf5507af270e441253f
7
- data.tar.gz: 701bde4cfbfac53a7646cc3c480540608074918e8df00642961f683a81c29a380a264fe77015504fb92d4f53bd7b624f4c49fca0cba19bb84ac64af6c9c4e7e7
6
+ metadata.gz: b7b529c7cb295c17b48104fc192af9925f1539c69a587195a3963747822f6a903846a2603242834c762ca496638b2d9f2755ca1152038d29353fb282833bd7c1
7
+ data.tar.gz: edcd4067681759d297021c6b845ca679c39c64af782ccfcbb290c33a4d61e4d9c23d825d3d5d8cc694d01b265e1d90c0cf4435bc32e0b83dedafe3f18d767018
data/lib/stable/cli.rb CHANGED
@@ -71,14 +71,17 @@ module Stable
71
71
  ensure_caddy_running!
72
72
  caddy_reload
73
73
 
74
+ puts 'Preparing database...'
75
+ system("bash -lc 'rvm #{ruby}@#{name} do cd #{app_path} && bundle exec rails db:prepare'")
76
+
74
77
  # --- Start Rails server ---
75
78
  puts "Starting Rails server for #{name} on port #{port}..."
76
79
  log_file = File.join(app_path, 'log', 'stable.log')
77
80
  FileUtils.mkdir_p(File.dirname(log_file))
78
- pid = spawn("bash -lc 'rvm #{ruby}@#{name} do cd #{app_path} && bundle exec rails s -p #{port} >> #{log_file} 2>&1'")
81
+ pid = spawn("bash -lc 'rvm #{ruby}@#{name} do cd #{app_path} && RAILS_ENV=development bundle exec rails s -p #{port} >> #{log_file} 2>&1'")
79
82
  Process.detach(pid)
80
83
 
81
- wait_for_port(port, timeout: 45)
84
+ wait_for_port(port, timeout: 15)
82
85
  puts "✔ #{name} running at https://#{domain}"
83
86
  end
84
87
 
@@ -174,7 +177,7 @@ module Stable
174
177
 
175
178
  cmd = <<~CMD
176
179
  cd #{app[:path]} &&
177
- #{ruby_exec} bundle exec rails s -p #{port}
180
+ #{ruby_exec} RAILS_ENV=development bundle exec rails s -p #{port}
178
181
  CMD
179
182
 
180
183
  pid = spawn(
@@ -189,7 +192,7 @@ module Stable
189
192
 
190
193
  generate_cert(app[:domain])
191
194
  update_caddyfile(app[:domain], port)
192
- wait_for_port(port, timeout: 45)
195
+ wait_for_port(port, timeout: 15)
193
196
  caddy_reload
194
197
 
195
198
  puts "#{name} started on https://#{app[:domain]}"
@@ -476,7 +479,7 @@ module Stable
476
479
  end
477
480
  end
478
481
 
479
- def wait_for_port(port, timeout: 45)
482
+ def wait_for_port(port, timeout: 15)
480
483
  require 'socket'
481
484
  start = Time.now
482
485
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stable-cli-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Simfukwe