lib/bundler/plugin/index.rb in bundler-2.0.2 vs lib/bundler/plugin/index.rb in bundler-2.1.0.pre.1
- old
+ new
@@ -101,10 +101,18 @@
def installed?(name)
@plugin_paths[name]
end
+ def installed_plugins
+ @plugin_paths.keys
+ end
+
+ def plugin_commands(plugin)
+ @commands.find_all {|_, n| n == plugin }.map(&:first)
+ end
+
def source?(source)
@sources.key? source
end
def source_plugin(name)
@@ -129,11 +137,11 @@
valid_file = index_f && index_f.exist? && !index_f.size.zero?
break unless valid_file
data = index_f.read
- require "bundler/yaml_serializer"
+ require_relative "../yaml_serializer"
index = YAMLSerializer.load(data)
@commands.merge!(index["commands"])
@hooks.merge!(index["hooks"])
@load_paths.merge!(index["load_paths"])
@@ -152,10 +160,10 @@
"load_paths" => @load_paths,
"plugin_paths" => @plugin_paths,
"sources" => @sources,
}
- require "bundler/yaml_serializer"
+ require_relative "../yaml_serializer"
SharedHelpers.filesystem_access(index_file) do |index_f|
FileUtils.mkdir_p(index_f.dirname)
File.open(index_f, "w") {|f| f.puts YAMLSerializer.dump(index) }
end
end