Class: Scatter::Commands::Remote::Rm

Inherits:
SubCommand show all
Defined in:
lib/scatter/commands/remote/rm.rb

Instance Method Summary collapse

Constructor Details

#initialize(out, name) ⇒ Rm

Returns a new instance of Rm.



5
6
7
8
# File 'lib/scatter/commands/remote/rm.rb', line 5

def initialize(out, name)
  super(out)
  @name = name
end

Instance Method Details

#execute!Object

Raises:



10
11
12
13
14
15
# File 'lib/scatter/commands/remote/rm.rb', line 10

def execute!
  remote = Scatter::Config.find_remote(@name)
  raise CommandLineError, "Remote #{@name} does not exist" unless remote
  Scatter::Config.remotes.delete(remote)
  Scatter::Config.save!
end