Skip to content

Commit

Permalink
Merge pull request #4 from SimplyInsured/fix_2.7.1_ruby_deprecations
Browse files Browse the repository at this point in the history
fix ruby 2.7.1 deprecations
  • Loading branch information
growthcode authored Mar 21, 2023
2 parents 1201731 + c310401 commit 58931f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/honeybadger/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def instances
@@instances
end

def register(name = nil)
def register(name = nil, &block)
name ||= name_from_caller(caller) or
raise(ArgumentError, 'Plugin name is required, but was nil.')
instances[key = name.to_sym] and fail("Already registered: #{name}")
instances[key] = new(name).tap { |d| d.instance_eval(&Proc.new) }
instances[key] = new(name).tap { |d| d.instance_eval(&block) }
end

def load!(config)
Expand Down Expand Up @@ -61,12 +61,12 @@ def initialize(name)
@executions = []
end

def requirement
@requirements << Proc.new
def requirement(&block)
@requirements << block
end

def execution
@executions << Proc.new
def execution(&block)
@executions << block
end

def ok?(config)
Expand Down

0 comments on commit 58931f1

Please sign in to comment.