Class: Pixiebox::Commands::RemoveService

Inherits:
Utils::VisitorByOs show all
Defined in:
lib/pixiebox/commands/remove_service.rb

Instance Method Summary collapse

Methods inherited from Utils::VisitorByOs

#visit, #visit_unsupported, #visit_windows

Methods included from Utils::DomainEventPublisher

#publish_event

Constructor Details

#initialize(type) ⇒ RemoveService

Returns a new instance of RemoveService.



4
5
6
# File 'lib/pixiebox/commands/remove_service.rb', line 4

def initialize(type)
  @type = type
end

Instance Method Details

#visit_darwin(subject) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/pixiebox/commands/remove_service.rb', line 8

def visit_darwin subject
  publish_event :remove_service_start, type

  raise Errors::ProjectNotInitialized unless os.project_initialized?

  Services::Installer.new(os).uninstall(type)

  publish_event :remove_service_completed, type
end

#visit_linux(subject) ⇒ Object



19
20
21
# File 'lib/pixiebox/commands/remove_service.rb', line 19

def visit_linux subject
  visit_darwin subject
end