mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Auto create configuration objects for plugins.
Whenever a plugin is activated a configuration object (using OpenStruct) will be created in Pry.config for that plugin. For example, for the plugin "pry-doc" the object Pry.config.pry_doc would be created. See #436 for more information. Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
This commit is contained in:
parent
78fba28f3d
commit
048a58b85b
1 changed files with 4 additions and 0 deletions
|
@ -48,6 +48,10 @@ class Pry
|
|||
warn "Warning: The plugin '#{gem_name}' was not found! (gem found but could not be loaded)"
|
||||
warn e
|
||||
end
|
||||
|
||||
# Create the configuration object for the plugin.
|
||||
Pry.config.send("#{gem_name.gsub('-', '_')}=", OpenStruct.new)
|
||||
|
||||
self.active = true
|
||||
self.enabled = true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue