lib/jets/commands/import/rail.rb
# We add jets-rails gem even though it's only activated within the megamode
# rackup wrapper script so user can check run bundle install and determine early
# if dependencies are met. The jets-rails gem is also added as part of the deploy
# process but we add it here also so the user gets earlier possible errors and
# can fix before they hit the deploy phase.
We add jets-rails gem even though it's only activated within the megamode
rackup wrapper script so user can check run bundle install and determine early
if dependencies are met. The jets-rails gem is also added as part of the deploy
process but we add it here also so the user gets earlier possible errors and
can fix before they hit the deploy phase.
We add jets - rails gem even though it ' s only activated within the megamode rackup wrapper script so user can check run bundle install and determine early if dependencies are met . The jets - rails gem is also added as part of the deploy process but we add it here also so the user gets earlier possible errors and can fix before they hit the deploy phase .
def reconfigure_database_yml
      current_yaml = "#{Jets.root}rack/config/database.yml"
      return unless File.exist?(current_yaml)
      vars = {}
      current_database = YAML.load_file(current_yaml)
      database_names = infer_database_name(current_database)
      vars.merge!(database_names)
      vars['adapter'] = current_database['development']['adapter']
      path = File.expand_path("templates/config/database.yml", File.dirname(__FILE__))
      content = Jets::Erb.result(path, vars)
      IO.write(current_yaml, content)
      puts "Reconfigured #{current_yaml}"
    rescue Exception
    end
def reconfigure_database_yml current_yaml = "#{Jets.root}rack/config/database.yml" return unless File . exist? ( current_yaml ) vars = { } current_database = YAML . load_file ( current_yaml ) database_names = infer_database_name ( current_database ) vars . merge! ( database_names ) vars [ 'adapter' ] = current_database [ 'development' ] [ 'adapter' ] path = File . expand_path ( "templates/config/database.yml" , File . dirname ( __FILE__ ) ) content = Jets :: Erb . result ( path , vars ) IO . write ( current_yaml , content ) puts "Reconfigured #{current_yaml}" rescue Exception end
We add jets-rails gem even though it's only activated within the megamode
rackup wrapper script so user can check run bundle install and determine early
if dependencies are met.
We add jets - rails gem even though it ' s only activated within the megamode rackup wrapper script so user can check run bundle install and determine early if dependencies are met .
# If unable to copy the database.yml settings just slightly fail. # Do this because really unsure what is in the current database.yml