1
0
Fork 0
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:
Yorick Peterse 2012-04-20 13:15:33 +02:00
parent 78fba28f3d
commit 048a58b85b

View file

@ -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