diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..311baaf --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +1.9.3-p374 diff --git a/Gemfile.lock b/Gemfile.lock index 813badc..9b8faab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,12 +93,12 @@ GEM polyglot (0.3.3) powder (0.1.6) thor (>= 0.11.5) - rack (1.3.8) + rack (1.3.9) rack-cache (1.2) rack (>= 0.4) rack-mount (0.8.3) rack (>= 1.0.0) - rack-ssl (1.3.2) + rack-ssl (1.3.3) rack rack-test (0.6.2) rack (>= 1.0) diff --git a/app/middleware/heartbeat.rb b/app/middleware/heartbeat.rb new file mode 100644 index 0000000..56afdcd --- /dev/null +++ b/app/middleware/heartbeat.rb @@ -0,0 +1,17 @@ +class Heartbeat + def initialize(app) + @app = app + end + + def call(env) + if env['PATH_INFO'] == '/heartbeat' + [ + 200, + {"Content-Type" => "text/plain"}, + ["OK"] + ] + else + @app.call(env) + end + end +end diff --git a/config/application.rb b/config/application.rb index 6475e16..868b900 100644 --- a/config/application.rb +++ b/config/application.rb @@ -44,14 +44,17 @@ module DanBarberPhoto # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' - + # Prefer SASS syntax for stylesheets config.sass.preferred_syntax = :sass + # Heartbeat + config.middleware.insert_before 0, 'Heartbeat' + # Rack Middleware config.middleware.use ::ExceptionNotifier, :email_prefix => "[DanBarberPhoto] ", :sender_address => %{"Exception Notification" }, :exception_recipients => %w{dan@danbarberphoto.com} - + end end