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