Class: Hephaestus::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/hephaestus/engine.rb

Constant Summary collapse

GIT_SHA =
case Rails.env
when "production", "staging"
  ENV["GIT_SHA"] || ""
when "development"
  %x(git rev-parse HEAD)
when "test"
  "deadbeef"
end.chomp

Class Method Summary collapse

Class Method Details

.insert_routesObject



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/hephaestus/engine.rb', line 44

def insert_routes
  Rails.application.routes.draw do
    # Staff pages
    get("staff", to: "staff#index")

    constraints(->(request) { StaffController.staff_request?(request) }) do
      mount(MissionControl::Jobs::Engine, at: "staff/jobs", as: :staff_jobs)
    end

    #############################################
    # error pages -- these MUST be at the end! ##
    #############################################

    get("/500", to: "application#render500") if Rails.env.production? || Rails.env.staging?

    match("/", to: "application#not_found", via: :all)
    match("/*unmatched_route", to: "application#not_found", via: :all)
  end
end