method

util_setup_gem

Importance_0
v1_9_3_392 - Show latest stable - 0 notes - Class: InstallerTestCase
util_setup_gem(ui = @ui) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/installer_test_case.rb, line 113
  def util_setup_gem(ui = @ui) # HACK fix use_ui to make this automatic
    @spec.files << File.join('lib', 'code.rb')
    @spec.extensions << File.join('ext', 'a', 'mkrf_conf.rb')

    Dir.chdir @tempdir do
      FileUtils.mkdir_p 'bin'
      FileUtils.mkdir_p 'lib'
      FileUtils.mkdir_p File.join('ext', 'a')
      File.open File.join('bin', 'executable'), 'w' do |f|
        f.puts "raise 'ran executable'"
      end
      File.open File.join('lib', 'code.rb'), 'w' do |f| f.puts '1' end
      File.open File.join('ext', 'a', 'mkrf_conf.rb'), 'w' do |f|
        f <<           File.open 'Rakefile', 'w' do |rf| rf.puts "task :default" end
      end

      use_ui ui do
        FileUtils.rm @gem

        @gem = Gem::Builder.new(@spec).build
      end
    end

    @installer = Gem::Installer.new @gem
  end
Register or log in to add new notes.