Sha256: 83731e1fe02bab0d753372387979627f0398ae94a2d8331041890722aa2def00

Contents?: true

Size: 1.39 KB

Versions: 13

Compression:

Stored size: 1.39 KB

Contents

module Pkg::Gem
  class << self
    # This is preserved because I don't want to update the deprecated code path
    # yet; I'm not entirely sure I've fixed everything that might attempt
    # to call this method so this is now a wrapper for a wrapper.
    def ship(file)
      rsync_to_downloads(file)
      ship_to_rubygems(file)
    end

    # Use rsync to deploy a file and any associated detached signatures,
    # checksums, or other glob-able artifacts to an external download server.
    def rsync_to_downloads(file)
      Pkg::Util.deprecate('Pkg::Gem.rsync_to_downloads', 'Pkg::Util::Ship.ship_pkgs')
      Pkg::Util::Ship.ship_pkgs(["#{file}*"], Pkg::Config.gem_host, Pkg::Config.gem_path, platform_independent: true)
    end

    # Ship a Ruby gem file to rubygems.org. Requires the existence
    # of a ~/.gem/credentials file or else rubygems.org won't have
    # any idea who you are.
    def ship_to_rubygems(file)
      Pkg::Util::File.file_exists?("#{ENV['HOME']}/.gem/credentials", :required => true)
      Pkg::Util::Execution.capture3("gem push #{file}")
    rescue => e
      puts "###########################################"
      puts "#  Publishing to rubygems failed. Make sure your .gem/credentials"
      puts "#  file is set up and you are an owner of #{Pkg::Config.gem_name}"
      puts "###########################################"
      puts
      puts e
      raise e
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
packaging-0.99.14 lib/packaging/gem.rb
packaging-0.99.13 lib/packaging/gem.rb
packaging-0.99.12 lib/packaging/gem.rb
packaging-0.99.11 lib/packaging/gem.rb
packaging-0.99.10.pre.dev1 lib/packaging/gem.rb
packaging-0.99.10.2.gfa4c366 lib/packaging/gem.rb
packaging-0.99.10 lib/packaging/gem.rb
packaging-0.99.9.5.g5811fb8 lib/packaging/gem.rb
packaging-0.99.9 lib/packaging/gem.rb
packaging-0.99.8 lib/packaging/gem.rb
packaging-0.99.7 lib/packaging/gem.rb
packaging-0.99.6 lib/packaging/gem.rb
packaging-0.99.5 lib/packaging/gem.rb