Class: Hostess::VirtualHost
- Inherits:
-
Object
- Object
- Hostess::VirtualHost
- Defined in:
- lib/hostess/virtual_host.rb
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #execute! ⇒ Object
- #help ⇒ Object
-
#initialize(options, debug = false) ⇒ VirtualHost
constructor
A new instance of VirtualHost.
- #list ⇒ Object
Constructor Details
#initialize(options, debug = false) ⇒ VirtualHost
Returns a new instance of VirtualHost.
3 4 5 |
# File 'lib/hostess/virtual_host.rb', line 3 def initialize(, debug=false) @options, @debug = , debug end |
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/hostess/virtual_host.rb', line 9 def create setup_apache_config create_vhost_directory create_apache_log_directory create_dns_entry create_vhost restart_apache end |
#delete ⇒ Object
17 18 19 20 21 22 |
# File 'lib/hostess/virtual_host.rb', line 17 def delete delete_dns_entry delete_vhost delete_apache_log_directory restart_apache end |
#execute! ⇒ Object
6 7 8 |
# File 'lib/hostess/virtual_host.rb', line 6 def execute! __send__(@options.action) end |
#help ⇒ Object
28 29 30 |
# File 'lib/hostess/virtual_host.rb', line 28 def help @options. end |
#list ⇒ Object
23 24 25 26 27 |
# File 'lib/hostess/virtual_host.rb', line 23 def list Dir[File.join(Hostess.vhosts_dir, '*.conf')].each do |config_file| puts File.basename(config_file, '.conf') end end |