Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't break when a configuration file doesn't include a DirectoryRoot.

  • Loading branch information...
commit de7fb56417598755bdbe64f11127f09f02ec0d73 1 parent b31d9dc
@Manfred Manfred authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 lib/passenger_pane/application.rb
View
20 lib/passenger_pane/application.rb
@@ -74,7 +74,7 @@ def _parse
data.gsub!(/\n\s*DocumentRoot\s+"(.+)"/, '')
path = $1
- if path.end_with?('public')
+ if path && path.end_with?('public')
@path = File.dirname(path)
else
@path = path
@@ -179,20 +179,30 @@ def removed_hosts
# -- Directory services
def register
- PassengerPane::DirectoryServices.register(to_hash['hosts'])
+ if result = PassengerPane::DirectoryServices.register(to_hash['hosts'])
+ PassengerPane::DirectoryServices.write_to_hosts_file_if_broken
+ end; result
end
def unregister
- PassengerPane::DirectoryServices.unregister(to_hash['hosts'])
+ if result = PassengerPane::DirectoryServices.unregister(to_hash['hosts'])
+ PassengerPane::DirectoryServices.write_to_hosts_file_if_broken
+ end; result
end
def sync_host_registration
if new?
register
else
- PassengerPane::DirectoryServices.register(added_hosts) and
- PassengerPane::DirectoryServices.unregister(removed_hosts)
+ if PassengerPane::DirectoryServices.register(added_hosts) and
+ PassengerPane::DirectoryServices.unregister(removed_hosts)
+ PassengerPane::DirectoryServices.write_to_hosts_file_if_broken
+ true
+ else
+ false
+ end
end
+
end
# -- Persisting
Please sign in to comment.
Something went wrong with that request. Please try again.