Skip to content

Commit

Permalink
Use detect call to simplify it after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Pijnenburg authored and jordansissel committed Nov 15, 2014
1 parent ab71a67 commit 1748f2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/logstash/pluginmanager/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ def execute
options[:document] = []
inst = Gem::DependencyInstaller.new(options)
inst.install plugin, version
specs = inst.installed_gems
specs.reject! { |gemspec| gemspec.name != gem_meta.name }
puts ("Successfully installed '#{specs.first.name}' with version '#{specs.first.version}'")
specs = inst.installed_gems.detect { |gemspec| gemspec.name == gem_meta.name }
puts ("Successfully installed '#{specs.name}' with version '#{specs.version}'")
return 0
end

Expand Down

0 comments on commit 1748f2c

Please sign in to comment.