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
12 lines
596 B
# useful methods for figuring out which kind of process is running
|
|
module CommandDetection
|
|
def server? = Rails.const_defined?('Server')
|
|
def console? = !server? && defined?(Rails::Console) == 'constant'
|
|
def rake? = !server? && !console? && Rails.const_defined?('Rake')
|
|
def tailwind_watcher? = rake? && Rake.application.top_level_tasks.first == 'tailwindcss:watch'
|
|
|
|
def procfile_server?
|
|
Rails.env.development? && Rails.application.server? && File.exist?(File.join(Rails.root,
|
|
'Procfile.dev'))
|
|
end
|
|
end
|