Class: Phpow::ApacheConfiguration
- Inherits:
-
Object
- Object
- Phpow::ApacheConfiguration
- Defined in:
- lib/phpow/apache_configuration.rb
Instance Attribute Summary collapse
-
#document_root ⇒ Object
Returns the value of attribute document_root.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ ApacheConfiguration
constructor
A new instance of ApacheConfiguration.
- #install ⇒ Object
- #preview ⇒ Object
- #uninstall ⇒ Object
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_root ⇒ Object
Returns the value of attribute document_root.
5 6 7 |
# File 'lib/phpow/apache_configuration.rb', line 5 def document_root @document_root end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/phpow/apache_configuration.rb', line 5 def port @port end |
Instance Method Details
#install ⇒ Object
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 |
#preview ⇒ Object
12 13 14 |
# File 'lib/phpow/apache_configuration.rb', line 12 def preview puts template_result end |
#uninstall ⇒ Object
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 |