lib/language_pack/helpers/rails_runner.rb
# This class is used to help pull configuration values
# from a rails application. It takes in a configuration key
# and a reference to the parent RailsRunner object which
# allows it obtain the `rails runner` output and success
# status of the operation.
#
# For example:
#
#    config = RailsConfig.new("active_storage.service", rails_runner)
#    config.to_command # => "puts %Q{heroku.detecting.config.for.active_storage.service=Rails.application.config.try(:active_storage).try(:service)}; "
#
This class is used to help pull configuration values
from a rails application. It takes in a configuration key
and a reference to the parent RailsRunner object which
allows it obtain the `rails runner` output and success
status of the operation.

For example.


This class is used to help pull configuration values from a rails application . It takes in a configuration key and a reference to the parent RailsRunner object which allows it obtain the ` rails runner ` output and success status of the operation . For example .
def execute_command!
      process = ProcessSpawn.new(command,
        user_env: true,
        timeout:  @timeout_val,
        file:     "./.heroku/ruby/config_detect/rails.txt"
      )
      @success      = process.success?
      @did_time_out = process.timeout?
      out           = process.output
      if timeout?
        message = String.new("Detecting rails configuration timeout\n")
        message << "set HEROKU_DEBUG_RAILS_RUNNER=1 to debug" unless @debug
        warn(message)
        mcount("warn.rails.runner.timeout")
      elsif !@success
        message = String.new("Detecting rails configuration failed\n")
        message << "set HEROKU_DEBUG_RAILS_RUNNER=1 to debug" unless @debug
        warn(message)
        mcount("warn.rails.runner.fail")
      end
      return out
    end
def execute_command! process = ProcessSpawn . new ( command , user_env : true , timeout : @timeout_val , file : "./.heroku/ruby/config_detect/rails.txt" ) @success = process . success? @did_time_out = process . timeout? out = process . output if timeout? message = String . new ( "Detecting rails configuration timeout\n" ) message << "set HEROKU_DEBUG_RAILS_RUNNER=1 to debug" unless @debug warn ( message ) mcount ( "warn.rails.runner.timeout" ) elsif ! @success message = String . new ( "Detecting rails configuration failed\n" ) message << "set HEROKU_DEBUG_RAILS_RUNNER=1 to debug" unless @debug warn ( message ) mcount ( "warn.rails.runner.fail" ) end return out end
This class is used to help pull configuration values
from a rails application.
This class is used to help pull configuration values from a rails application .