Remove spurious 'unless activated?' on most activation calls

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-02-06 12:22:51 -05:00
parent 91ed6e3256
commit 591317e659
4 changed files with 6 additions and 5 deletions

View file

@ -40,7 +40,8 @@ module Inspec
if hook
# OK, load the hook if it hasn't been already. We'll then know a module,
# which we can then inject into the context
hook.activate unless hook.activated?
hook.activate
# Inject the module's methods into the context.
# implementation_class is the field name, but this is actually a module.
self.class.include(hook.implementation_class)

View file

@ -38,7 +38,7 @@ module Inspec::DSL
if hook
# OK, load the hook if it hasn't been already. We'll then know a module,
# which we can then inject into the context
hook.activate unless hook.activated?
hook.activate
# Inject the module's methods into the context
# implementation_class is the field name, but this is actually a module.
self.class.include(hook.implementation_class)

View file

@ -52,7 +52,7 @@ module Inspec
if hook
# OK, load the hook if it hasn't been already. We'll then know a module,
# which we can then inject into the resource
hook.activate unless hook.activated?
hook.activate
# Inject the module's methods into the resource as class methods.
# implementation_class is the field name, but this is actually a module.
extend(hook.implementation_class)

View file

@ -17,7 +17,7 @@ module Inspec
if hook
# OK, load the hook if it hasn't been already. We'll then know a module,
# which we can then inject into the context
hook.activate unless hook.activated?
hook.activate
# Inject the module's methods into the example group contexts.
# implementation_class is the field name, but this is actually a module.
@ -46,7 +46,7 @@ module Inspec
if hook
# OK, load the hook if it hasn't been already. We'll then know a module,
# which we can then inject into the context
hook.activate unless hook.activated?
hook.activate
# Inject the module's methods into the example group contexts.
# implementation_class is the field name, but this is actually a module.