Skip to content

Commit

Permalink
Make RuboCop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Aug 3, 2015
1 parent d8e50e7 commit 5353f01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Metrics/BlockNesting:
# Offense count: 4
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 246
Max: 252

# Offense count: 23
Metrics/CyclomaticComplexity:
Expand Down
2 changes: 1 addition & 1 deletion lib/grape/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def equals?(e)
protected

def run(env)
instrument("run.grape", endpoint: self, env: env) do
instrument('run.grape', endpoint: self, env: env) do
@env = env
@header = {}

Expand Down
14 changes: 4 additions & 10 deletions lib/grape/instrumentable.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
module Grape
module Instrumentable
@@instrumenter = nil

def self.instrumenter
@@instrumenter
end

def self.instrumenter=(val)
@@instrumenter = val
class << self
attr_accessor :instrumenter
end

def instrument(name, payload={})
def instrument(name, payload = {})
if Instrumentable.instrumenter
Instrumentable.instrumenter(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
end
end
end
end

0 comments on commit 5353f01

Please sign in to comment.