You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
596 B

2 months ago
3 weeks ago
2 months ago
  1. # useful methods for figuring out which kind of process is running
  2. module CommandDetection
  3. def server? = Rails.const_defined?('Server')
  4. def console? = !server? && defined?(Rails::Console) == 'constant'
  5. def rake? = !server? && !console? && Rails.const_defined?('Rake')
  6. def tailwind_watcher? = rake? && Rake.application.top_level_tasks.first == 'tailwindcss:watch'
  7. def procfile_server?
  8. Rails.env.development? && Rails.application.server? && File.exist?(File.join(Rails.root,
  9. 'Procfile.dev'))
  10. end
  11. end