module GitVersionHeaderControllerExtension def self.included(base) base.send(:include, InstanceMethods) base.before_filter :add_git_version_header end module InstanceMethods def add_git_version_header response.headers['X-Version'] = ENV['GIT_VERSION'] end end end