Sha256: d2e994f0899d9c570e9404625d74263d035264b67912aaf13142920071f9b342

Contents?: true

Size: 607 Bytes

Versions: 18

Compression:

Stored size: 607 Bytes

Contents

class Gem::Commands::TumbleCommand < Gem::AbstractCommand
  def description
    'Enable or disable Gemcutter as your primary gem source.'
  end

  def initialize
    super 'tumble', description
  end

  def execute
    say "Thanks for using Gemcutter!"
    tumble
    show_sources
  end

  def tumble
    if Gem.sources.include?(URL)
      Gem.sources.delete URL
      Gem.configuration.write
    else
      Gem.sources.unshift URL
      Gem.configuration.write
    end
  end

  def show_sources
    say "Your gem sources are now:"
    Gem.sources.each do |source|
      say "- #{source}"
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
qrush-gemcutter-0.0.7 lib/commands/tumble.rb
qrush-gemcutter-0.0.8 lib/commands/tumble.rb
qrush-gemcutter-0.0.9 lib/commands/tumble.rb
qrush-gemcutter-0.1.0 lib/commands/tumble.rb
qrush-gemcutter-0.1.1 lib/commands/tumble.rb
qrush-gemcutter-0.1.2 lib/commands/tumble.rb
gemcutter-0.1.8 lib/commands/tumble.rb
gemcutter-0.1.7 lib/commands/tumble.rb
gemcutter-0.1.6 lib/commands/tumble.rb
gemcutter-0.1.5 lib/commands/tumble.rb
gemcutter-0.1.4 lib/commands/tumble.rb
gemcutter-0.1.3 lib/commands/tumble.rb
gemcutter-0.1.2 lib/commands/tumble.rb
gemcutter-0.1.1 lib/commands/tumble.rb
gemcutter-0.1.0 lib/commands/tumble.rb
gemcutter-0.0.9 lib/commands/tumble.rb
gemcutter-0.0.8 lib/commands/tumble.rb
gemcutter-0.0.7 lib/commands/tumble.rb