Class: Suspenders::Staging::PullRequestsGenerator

Inherits:
Generators::Base
  • Object
show all
Defined in:
lib/suspenders/generators/staging/pull_requests_generator.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Instance Method Details

#configure_heroku_staging_pr_pipeline_hostObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/suspenders/generators/staging/pull_requests_generator.rb', line 6

def configure_heroku_staging_pr_pipeline_host
  config = "\n  if ENV.fetch('HEROKU_APP_NAME', '').include?('staging-pr-')\n    ENV['APPLICATION_HOST'] = ENV['HEROKU_APP_NAME'] + '.herokuapp.com'\n    ENV['ASSET_HOST'] = ENV['HEROKU_APP_NAME'] + '.herokuapp.com'\n  end\n  RUBY\n\n  inject_into_file(\n    \"config/environments/production.rb\",\n    config,\n    after: \"Rails.application.configure do\\n\",\n  )\nend\n"

#create_review_apps_setup_scriptObject



22
23
24
25
26
27
28
29
30
# File 'lib/suspenders/generators/staging/pull_requests_generator.rb', line 22

def create_review_apps_setup_script
  template(
    "bin_setup_review_app.erb",
    "bin/setup_review_app",
    force: true,
  )

  run "chmod a+x bin/setup_review_app"
end