summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-25 13:57:31 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-25 14:00:34 +0100
commit98810684331b659f44bc3e98a36ebbf0eb6d30fe (patch)
tree3c1e020386d301eeefee1c15ece6eb9811f4f7df
parentc0016e29df21296efc3baa099ee496eb929af911 (diff)
downloadbundler-98810684331b659f44bc3e98a36ebbf0eb6d30fe.tar.gz
Improve automatiek activation
Make it consistent with how we do it for `ronn`, and give better messages for installing `automatiek` if missing.
-rw-r--r--Rakefile24
1 files changed, 16 insertions, 8 deletions
diff --git a/Rakefile b/Rakefile
index 6966ee0c28..83acb99e1c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -297,9 +297,24 @@ namespace :man do
end
end
+automatiek_dep = development_dependencies.find do |dep|
+ dep.name == "automatiek"
+end
+
+automatiek_requirement = automatiek_dep.requirement.to_s
+
begin
- require "automatiek"
+ gem "automatiek", automatiek_requirement
+ require "automatiek"
+rescue LoadError
+ namespace :vendor do
+ task(:molinillo) { abort "We couldn't activate automatiek (#{automatiek_requirement}). Try `gem install automatiek:'#{automatiek_requirement}'` to be able to vendor gems" }
+ task(:fileutils) { abort "We couldn't activate automatiek (#{automatiek_requirement}). Try `gem install automatiek:'#{automatiek_requirement}'` to be able to vendor gems" }
+ task(:thor) { abort "We couldn't activate automatiek (#{automatiek_requirement}). Try `gem install automatiek:'#{automatiek_requirement}'` to be able to vendor gems" }
+ task(:"net-http-persistent") { abort "We couldn't activate automatiek (#{automatiek_requirement}). Try `gem install automatiek:'#{automatiek_requirement}'` to be able to vendor gems" }
+ end
+else
Automatiek::RakeTask.new("molinillo") do |lib|
lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
lib.namespace = "Molinillo"
@@ -337,13 +352,6 @@ begin
end
lib.send(:extend, mixin)
end
-rescue LoadError
- namespace :vendor do
- task(:fileutils) { abort "Install the automatiek gem to be able to vendor gems." }
- task(:molinillo) { abort "Install the automatiek gem to be able to vendor gems." }
- task(:thor) { abort "Install the automatiek gem to be able to vendor gems." }
- task("net-http-persistent") { abort "Install the automatiek gem to be able to vendor gems." }
- end
end
task :override_version do