aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-07-11 15:05:02 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-07-11 15:10:54 +0900
commit967c31178dcdb5336f793e00b892492ac9b7573e (patch)
tree902ebf6344c50475aac2d9fa8ec0a260770e89e0 /Rakefile
parentf842b0d5c5e37527c11954a4b7a98c8d9cc57865 (diff)
downloadruby-openssl-967c31178dcdb5336f793e00b892492ac9b7573e.tar.gz
Rakefile: install_dependencies: install only when needed
Emulate the behavior of 'gem install --conservative'. This would prevent overwriting the existing Rake installation.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index 2fca743d..3350157b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -34,8 +34,13 @@ task :install_dependencies do
gemspec = eval(File.read("openssl.gemspec"))
gemspec.development_dependencies.each do |dep|
print "Installing #{dep.name} (#{dep.requirement}) ... "
- gem = Gem.install(dep.name, dep.requirement, force: true)
- puts "#{gem[0].version}"
+ installed = dep.matching_specs
+ if installed.empty?
+ installed = Gem.install(dep.name, dep.requirement)
+ puts "#{installed[0].version}"
+ else
+ puts "(found #{installed[0].version})"
+ end
end
end