Imported File#ftype spec from rubyspecs.
[rbx.git] / lib / bin / gem
blobb5b2b63809e667b2bb094c92256a0d90fccfc503
1 #!/usr/bin/env ruby
2 #--
3 # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
4 # All rights reserved.
5 # See LICENSE.txt for permissions.
6 #++
8 require 'rubygems'
9 require 'rubygems/gem_runner'
10 require 'rubygems/exceptions'
12 required_version = Gem::Requirement.new "> 1.8.3"
14 unless required_version.satisfied_by? Gem.ruby_version then
15 abort "Expected Ruby Version #{required_version}, was #{Gem.ruby_version}"
16 end
18 # We need to preserve the original ARGV to use for passing gem options
19 # to source gems. If there is a -- in the line, strip all options after
20 # it...its for the source building process.
21 args = !ARGV.include?("--") ? ARGV.clone : ARGV[0...ARGV.index("--")]
23 begin
24 Gem::GemRunner.new.run args
25 rescue Gem::SystemExitException => e
26 exit e.exit_code
27 end