commands/plugin: style nitpick
This commit is contained in:
parent
63005fc1c6
commit
f66d08d73c
|
@ -1,5 +1,6 @@
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
require "rubygems/dependency_installer"
|
require "rubygems/dependency_installer"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require "rubygems/format"
|
require "rubygems/format"
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
|
@ -31,10 +32,13 @@ module VagrantPlugins
|
||||||
# If we're installing from a gem file, determine the name
|
# If we're installing from a gem file, determine the name
|
||||||
# based on the spec in the file.
|
# based on the spec in the file.
|
||||||
pkg = if defined?(Gem::Format)
|
pkg = if defined?(Gem::Format)
|
||||||
|
# RubyGems 1.x
|
||||||
Gem::Format.from_file_by_path(plugin_name)
|
Gem::Format.from_file_by_path(plugin_name)
|
||||||
else
|
else
|
||||||
|
# RubyGems 2.x
|
||||||
Gem::Package.new(plugin_name)
|
Gem::Package.new(plugin_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
find_plugin_name = pkg.spec.name
|
find_plugin_name = pkg.spec.name
|
||||||
version = pkg.spec.version
|
version = pkg.spec.version
|
||||||
end
|
end
|
||||||
|
|
|
@ -126,8 +126,8 @@ module VagrantPlugins
|
||||||
|
|
||||||
if prune_specs.length > 0
|
if prune_specs.length > 0
|
||||||
env[:gem_helper].with_environment do
|
env[:gem_helper].with_environment do
|
||||||
|
# Due to a bug in rubygems 2.0, we need to load the
|
||||||
# due to a bug in rubygems 2.0, we need to load the specifications before removing any
|
# specifications before removing any. This achieves that.
|
||||||
Gem::Specification.to_a
|
Gem::Specification.to_a
|
||||||
|
|
||||||
prune_specs.each do |prune_spec|
|
prune_specs.each do |prune_spec|
|
||||||
|
|
Loading…
Reference in New Issue