Permalink
Browse files

added gemspec to Plugin object, so can extract summary/description etc

  • Loading branch information...
1 parent 84d728e commit 8133fd89143377b14f6936339c079b2e270e1e35 @banister committed Jun 16, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/pry/plugins.rb
View
@@ -6,10 +6,10 @@ class PluginManager
MessageSink = Object.new.tap { |o| def o.method_missing(*args) end }
class Plugin
- attr_accessor :name, :gem_name, :enabled, :active
+ attr_accessor :name, :gem_name, :enabled, :spec, :active
- def initialize(name, gem_name, enabled)
- @name, @gem_name, @enabled = name, gem_name, enabled
+ def initialize(name, gem_name, spec, enabled)
+ @name, @gem_name, @enabled, @spec = name, gem_name, enabled, spec
end
# Disable a plugin.
@@ -47,7 +47,7 @@ def locate_plugins
(Gem::Specification.respond_to?(:each) ? Gem::Specification : Gem.source_index.find_name('')).each do |gem|
next if gem.name !~ PRY_PLUGIN_PREFIX
plugin_name = gem.name.split('-', 2).last
- @plugins << Plugin.new(plugin_name, gem.name, true) if !gem_located?(gem.name)
+ @plugins << Plugin.new(plugin_name, gem.name, gem, true) if !gem_located?(gem.name)
end
@plugins
end

0 comments on commit 8133fd8

Please sign in to comment.