Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor instance_eval into instance method

  • Loading branch information...
commit e2b8ef9892217040a038acd3153495ec71978360 1 parent db8bbe6
Larry Marburger lmarburger authored
Showing with 10 additions and 12 deletions.
  1. +10 −12 lib/configuration.rb
22 lib/configuration.rb
View
@@ -3,8 +3,16 @@
module Configuration
- def self.inject(subject)
- Configurer.new(subject).instance_eval do
+ def self.registered(subject)
+ Configurer.new(subject).inject
+ end
+
+ class Configurer
+ def initialize(subject)
+ @subject = subject
+ end
+
+ def inject
add_new_relic_instrumentation
catch_errors_with_hoptoad
handle_requests_using_fiber_pool
@@ -13,16 +21,6 @@ def self.inject(subject)
serve_public_assets
vary_all_responses_on_accept_header
end
- end
-
- class << self
- alias_method :registered, :inject
- end
-
- class Configurer
- def initialize(subject)
- @subject = subject
- end
def add_new_relic_instrumentation
@subject.configure :production do
Please sign in to comment.
Something went wrong with that request. Please try again.