From 70dfb424a8cc6f65b1c5e7b673cdb1d0d15c33b0 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 23 Apr 2012 12:36:27 +0200 Subject: [PATCH] Set plugin options before requiring the plugin. Signed-off-by: Yorick Peterse --- lib/pry/plugins.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pry/plugins.rb b/lib/pry/plugins.rb index 9612cea7..2476eebd 100644 --- a/lib/pry/plugins.rb +++ b/lib/pry/plugins.rb @@ -42,6 +42,9 @@ class Pry # disabled) # Does not reload plugin if it's already active. def activate! + # Create the configuration object for the plugin. + Pry.config.send("#{gem_name.gsub('-', '_')}=", OpenStruct.new) + begin require gem_name if !active? rescue LoadError => e @@ -49,9 +52,6 @@ class Pry 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