Class: Ruby::Nginx::Commands::RemoveNginxConfig

Inherits:
Object
  • Object
show all
Includes:
Ruby::Nginx::Constants
Defined in:
lib/ruby/nginx/commands/remove_nginx_config.rb

Constant Summary

Constants included from Ruby::Nginx::Constants

Ruby::Nginx::Constants::CONFIG_PATH, Ruby::Nginx::Constants::SERVERS_PATH

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ RemoveNginxConfig

Returns a new instance of RemoveNginxConfig.



12
13
14
# File 'lib/ruby/nginx/commands/remove_nginx_config.rb', line 12

def initialize(name)
  @name = name
end

Instance Method Details

#runObject



16
17
18
19
20
21
# File 'lib/ruby/nginx/commands/remove_nginx_config.rb', line 16

def run
  return false unless exists?

  Ruby::Nginx::System::SafeFile.rm(config_path)
  true
end