1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

plugins are now enabled when explicitly activated! (even if previously disabled)

This commit is contained in:
John Mair 2011-05-23 22:11:50 +12:00
parent 9073bb1ffe
commit 2982f5c6b8

View file

@ -6,8 +6,7 @@ class Pry
PluginNotFound = Class.new(LoadError)
class Plugin
attr_accessor :name, :gem_name, :enabled
attr_reader :active
attr_accessor :name, :gem_name, :enabled, :active
def initialize(name, gem_name, enabled)
@name, @gem_name, @enabled = name, gem_name, enabled
@ -26,13 +25,12 @@ class Pry
# Activate the plugin (require the gem).
def activate!
begin
Pry::Helpers::BaseHelpers.silence_warnings do
require gem_name
end
rescue LoadError
raise PluginNotFound, "The plugin '#{gem_name}' was not found!"
end
@active = true
self.active = true
self.enabled = true
end
alias active? active