Skip to content

Commit 5fa528d

Browse files
committed
Use real keyword args for plugin options
1 parent 3e8eeb1 commit 5fa528d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/dry/system/plugins.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def initialize(name, mod, &block)
2121
end
2222

2323
# @api private
24-
def apply_to(system, options)
25-
system.extend(stateful? ? mod.new(options) : mod)
24+
def apply_to(system, **options)
25+
system.extend(stateful? ? mod.new(**options) : mod)
2626
system.instance_eval(&block) if block
2727
system
2828
end
@@ -90,13 +90,13 @@ def self.loaded_dependencies
9090
# @return [self]
9191
#
9292
# @api public
93-
def use(name, options = {})
93+
def use(name, **options)
9494
return self if enabled_plugins.include?(name)
9595

9696
raise PluginNotFoundError, name unless (plugin = Plugins.registry[name])
9797

9898
plugin.load_dependencies
99-
plugin.apply_to(self, options)
99+
plugin.apply_to(self, **options)
100100

101101
enabled_plugins << name
102102

lib/dry/system/plugins/env.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Env < Module
1010
attr_reader :options
1111

1212
# @api private
13-
def initialize(options)
13+
def initialize(**options)
1414
@options = options
1515
end
1616

lib/dry/system/plugins/zeitwerk.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.dependencies
1717
attr_reader :options
1818

1919
# @api private
20-
def initialize(options)
20+
def initialize(**options)
2121
@options = options
2222
super()
2323
end

0 commit comments

Comments
 (0)