A vendor_gem is used with a gem
dependencies file. The gem created here has no files, just a gem
specification for the given name and version.
Yields the specification to the block, if given
# File lib/rubygems/test_case.rb, line 1292
def vendor_gem name = 'a', version = 1
directory = File.join 'vendor', name
vendor_spec = Gem::Specification.new name, version do |specification|
yield specification if block_given?
end
FileUtils.mkdir_p directory
open File.join(directory, "#{name}.gemspec"), 'w' do |io|
io.write vendor_spec.to_ruby
end
return name, vendor_spec.version, directory
end