Sha256: 777110acc3566da34b66d8cdc73204b973afa22fe160d585d347e4fa478de43b

Contents?: true

Size: 696 Bytes

Versions: 1

Compression:

Stored size: 696 Bytes

Contents

class Gem::Commands::CompactCommand < Gem::Command
  def description
    'Clean up gems for all the paths'
  end

  def initialize
    super('compact', description)
  end

  def execute
    require 'rubygems/commands/cleanup_command'

    cmd = Gem::Commands::CleanupCommand.new
    args, build_args = options.values_at(:args, :build_args)
    args.unshift('--no-check-development')

    with_path do
      cmd.invoke_with_build_args(args, build_args)
    end
  end

  private

  def with_path
    path = Gem.path
    path.each do |dir|
      if Dir.exist?(dir)
        say "Checking #{dir}"
        Gem.use_paths(dir)
        yield
      end
    end
  ensure
    Gem.use_paths(*path)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gem-compact-0.5.0 lib/rubygems/commands/compact_command.rb