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:
parent
9073bb1ffe
commit
2982f5c6b8
1 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue