Class: Phpow::ApacheConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/phpow/apache_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ ApacheConfiguration

Returns a new instance of ApacheConfiguration.



7
8
9
10
# File 'lib/phpow/apache_configuration.rb', line 7

def initialize(args = {})
  @port = args.fetch(:port, 8888)
  @document_root = args.fetch(:document_root, default_document_root)
end

Instance Attribute Details

#document_rootObject

Returns the value of attribute document_root.



5
6
7
# File 'lib/phpow/apache_configuration.rb', line 5

def document_root
  @document_root
end

#portObject

Returns the value of attribute port.



5
6
7
# File 'lib/phpow/apache_configuration.rb', line 5

def port
  @port
end

Instance Method Details

#installObject



16
17
18
19
20
21
22
# File 'lib/phpow/apache_configuration.rb', line 16

def install
  puts "You are about to write the file '#{pathname}'?"
  print "Enter 'yes' to confirm: "
  return unless gets.strip == "yes"

  write_file
end

#previewObject



12
13
14
# File 'lib/phpow/apache_configuration.rb', line 12

def preview
  puts template_result
end

#uninstallObject



24
25
26
27
28
29
30
# File 'lib/phpow/apache_configuration.rb', line 24

def uninstall
  puts "You are about to permanently delete the file '#{pathname}'?"
  print "Enter 'yes' to confirm: "
  return unless gets.strip == "yes"

  File.delete(pathname)
end