summaryrefslogtreecommitdiff
path: root/tasks/bin/bundle-platform
blob: 10d9bb2b3d86ecc9a231b8d45604f6b9f5d83f8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby

platforms = ARGV.shift
platforms = platforms.split(" ").map { |p| Gem::Platform.new(p) }
Gem::Platform.instance_eval { @local = platforms.last }
old_platforms = Gem.platforms
Gem.platforms = platforms
puts "bundle-platform set Gem.platforms to #{Gem.platforms.map { |p| p.to_s }} (was #{old_platforms.map { |p| p.to_s } })"

desired_version = ARGV.shift.delete("_", "")

# The rest of this is a normal bundler binstub
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile",
  Pathname.new(__FILE__).realpath)

require "rubygems"

load Gem.bin_path("bundler", "bundle", desired_version)