<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>passenger_pane_config.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -18,6 +18,7 @@
 		518C7F770E06B665003A3ED0 /* SecurityHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 518C7F750E06B665003A3ED0 /* SecurityHelper.m */; };
 		519DFB9F0DFDD825008A42FE /* PassengerApplication.rb in Resources */ = {isa = PBXBuildFile; fileRef = 519DFB9E0DFDD825008A42FE /* PassengerApplication.rb */; };
 		519DFBA90DFE8EAF008A42FE /* shared_passenger_behaviour.rb in Resources */ = {isa = PBXBuildFile; fileRef = 519DFBA70DFE8EAF008A42FE /* shared_passenger_behaviour.rb */; };
+		51A703B10E648641006A1E26 /* passenger_pane_config.rb in Resources */ = {isa = PBXBuildFile; fileRef = 51A703B00E648641006A1E26 /* passenger_pane_config.rb */; };
 		51B9190D0E01523900F45803 /* Alerts.icns in Resources */ = {isa = PBXBuildFile; fileRef = 51B9190C0E01523900F45803 /* Alerts.icns */; };
 		51B919140E0172C200F45803 /* config_uninstaller.rb in Resources */ = {isa = PBXBuildFile; fileRef = 51B919130E0172C200F45803 /* config_uninstaller.rb */; };
 		51D16FE30E07DFA000A46A7D /* PassengerPaneHelp in Resources */ = {isa = PBXBuildFile; fileRef = 51D16FDD0E07DFA000A46A7D /* PassengerPaneHelp */; };
@@ -50,6 +51,7 @@
 		518C7F750E06B665003A3ED0 /* SecurityHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecurityHelper.m; sourceTree = &quot;&lt;group&gt;&quot;; };
 		519DFB9E0DFDD825008A42FE /* PassengerApplication.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = PassengerApplication.rb; sourceTree = &quot;&lt;group&gt;&quot;; };
 		519DFBA70DFE8EAF008A42FE /* shared_passenger_behaviour.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = shared_passenger_behaviour.rb; sourceTree = &quot;&lt;group&gt;&quot;; };
+		51A703B00E648641006A1E26 /* passenger_pane_config.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = passenger_pane_config.rb; sourceTree = &quot;&lt;group&gt;&quot;; };
 		51B9190C0E01523900F45803 /* Alerts.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Alerts.icns; sourceTree = &quot;&lt;group&gt;&quot;; };
 		51B919130E0172C200F45803 /* config_uninstaller.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = config_uninstaller.rb; sourceTree = &quot;&lt;group&gt;&quot;; };
 		51D16FDE0E07DFA000A46A7D /* English */ = {isa = PBXFileReference; lastKnownFileType = folder; name = English; path = English.lproj/PassengerPaneHelp; sourceTree = &quot;&lt;group&gt;&quot;; };
@@ -108,6 +110,7 @@
 				518C7F720E06A668003A3ED0 /* Security.bridgesupport */,
 				5186C3150E090B59008D8E1F /* HelpHelper.h */,
 				5186C3160E090B59008D8E1F /* HelpHelper.m */,
+				51A703B00E648641006A1E26 /* passenger_pane_config.rb */,
 				51B919130E0172C200F45803 /* config_uninstaller.rb */,
 				51B9190C0E01523900F45803 /* Alerts.icns */,
 				9648B5EE0D195C2F00DC73E2 /* Pref.xib */,
@@ -242,6 +245,7 @@
 				518C7F730E06A668003A3ED0 /* Security.bridgesupport in Resources */,
 				51D16FE30E07DFA000A46A7D /* PassengerPaneHelp in Resources */,
 				5189C6E70E111C3300B83EA5 /* LICENSE in Resources */,
+				51A703B10E648641006A1E26 /* passenger_pane_config.rb in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};</diff>
      <filename>Passenger.xcodeproj/project.pbxproj</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ include OSX
 
 require 'fileutils'
 require 'yaml'
+require File.expand_path('../passenger_pane_config', __FILE__)
 require File.expand_path('../shared_passenger_behaviour', __FILE__)
 
 class PassengerApplication &lt; NSObject
@@ -18,7 +19,7 @@ class PassengerApplication &lt; NSObject
     include SharedPassengerBehaviour
     
     def existingApplications
-      Dir.glob(File.join(PASSENGER_APPS_DIR, '*.vhost.conf')).map do |app|
+      Dir.glob(File.join(PassengerPaneConfig::PASSENGER_APPS_DIR, '*.vhost.conf')).map do |app|
         PassengerApplication.alloc.initWithFile(app)
       end
     end
@@ -139,7 +140,7 @@ class PassengerApplication &lt; NSObject
   end
   
   def config_path
-    File.join(PASSENGER_APPS_DIR, &quot;#{@host}.vhost.conf&quot;)
+    File.join(PassengerPaneConfig::PASSENGER_APPS_DIR, &quot;#{@host}.vhost.conf&quot;)
   end
   
   def rbSetValue_forKey(value, key)</diff>
      <filename>PassengerApplication.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ include OSX
 OSX.require_framework 'PreferencePanes'
 OSX.load_bridge_support_file File.expand_path('../Security.bridgesupport', __FILE__)
 
+require File.expand_path('../passenger_pane_config', __FILE__)
 require File.expand_path('../shared_passenger_behaviour', __FILE__)
 require File.expand_path('../PassengerApplication', __FILE__)
 
@@ -263,4 +264,4 @@ class PrefPanePassenger &lt; NSPreferencePane
       @installPassengerWarning.hidden = false
     end
   end
-end
+end
\ No newline at end of file</diff>
      <filename>PassengerPref.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
 require 'osx/cocoa'
 require 'yaml'
 require 'fileutils'
+require File.expand_path('../passenger_pane_config', __FILE__)
 
 class String
   def bypass_safe_level_1
@@ -28,19 +29,17 @@ class ConfigInstaller
     end
   end
   
-  VHOSTS_DIR = &quot;/private/etc/apache2/passenger_pane_vhosts&quot;
   def verify_vhost_conf
-    unless File.exist? VHOSTS_DIR
-      OSX::NSLog(&quot;Will create directory: #{VHOSTS_DIR}&quot;)
-      FileUtils.mkdir_p VHOSTS_DIR
+    unless File.exist? PassengerPaneConfig::PASSENGER_APPS_DIR
+      OSX::NSLog(&quot;Will create directory: #{PassengerPaneConfig::PASSENGER_APPS_DIR}&quot;)
+      FileUtils.mkdir_p PassengerPaneConfig::PASSENGER_APPS_DIR
     end
   end
   
-  CONF = &quot;/private/etc/apache2/httpd.conf&quot;
   def verify_httpd_conf
-    unless File.read(CONF).include? 'Include /private/etc/apache2/passenger_pane_vhosts/*.conf'
-      OSX::NSLog(&quot;Will try to append passenger pane vhosts conf to: #{CONF}&quot;)
-      File.open(CONF, 'a') do |f|
+    unless File.read(PassengerPaneConfig::HTTPD_CONF).include? &quot;Include #{PassengerPaneConfig::PASSENGER_APPS_DIR}/*.conf&quot;
+      OSX::NSLog(&quot;Will try to append passenger pane vhosts conf to: #{PassengerPaneConfig::HTTPD_CONF}&quot;)
+      File.open(PassengerPaneConfig::HTTPD_CONF, 'a') do |f|
         f &lt;&lt; %{
 
 # Added by the Passenger preference pane
@@ -48,7 +47,7 @@ class ConfigInstaller
 # PassengerRoot, and PassengerRuby directives) before this section.
 &lt;IfModule passenger_module&gt;
   NameVirtualHost *:80
-  Include /private/etc/apache2/passenger_pane_vhosts/*.conf
+  Include #{PassengerPaneConfig::PASSENGER_APPS_DIR}/*.conf
 &lt;/IfModule&gt;}
       end
     end
@@ -71,7 +70,7 @@ class ConfigInstaller
   end
   
   def restart_apache!
-    system &quot;sudo /bin/launchctl stop org.apache.httpd&quot;
+    system PassengerPaneConfig::APACHE_RESTART_COMMAND
   end
   
   def install!</diff>
      <filename>config_installer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@
 
 require 'osx/cocoa'
 require 'yaml'
+require File.expand_path('../passenger_pane_config', __FILE__)
 
 class String
   def bypass_safe_level_1
@@ -32,11 +33,11 @@ class ConfigUninstaller
   end
   
   def config_path(index)
-    &quot;/private/etc/apache2/passenger_pane_vhosts/#{@data[index]['host'].bypass_safe_level_1}.vhost.conf&quot;
+    &quot;#{PassengerPaneConfig::PASSENGER_APPS_DIR}/#{@data[index]['host'].bypass_safe_level_1}.vhost.conf&quot;
   end
   
   def restart_apache!
-    system &quot;/bin/launchctl stop org.apache.httpd&quot;
+    system PassengerPaneConfig::APACHE_RESTART_COMMAND
   end
   
   def uninstall!</diff>
      <filename>config_uninstaller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,6 @@
 module SharedPassengerBehaviour
   include OSX
   
-  PASSENGER_APPS_DIR = &quot;/private/etc/apache2/passenger_pane_vhosts&quot;
-  
   def execute(command, *args)
     if OSX::SecurityHelper.sharedInstance.executeCommand_withArgs(command, args) == 0
       alert = OSX::NSAlert.alloc.init</diff>
      <filename>shared_passenger_behaviour.rb</filename>
    </modified>
    <modified>
      <diff>@@ -86,19 +86,17 @@ describe &quot;ConfigInstaller&quot; do
   end
   
   it &quot;should check if the vhost directory exists, if not add it&quot; do
-    dir = &quot;/private/etc/apache2/passenger_pane_vhosts&quot;
-    File.expects(:exist?).with(dir).returns(false)
-    FileUtils.expects(:mkdir_p).with(dir)
+    File.expects(:exist?).with(PassengerPaneConfig::PASSENGER_APPS_DIR).returns(false)
+    FileUtils.expects(:mkdir_p).with(PassengerPaneConfig::PASSENGER_APPS_DIR)
     
     @installer.verify_vhost_conf
   end
   
   it &quot;should check if our configuration to load the vhosts has been added to the apache conf yet&quot; do
-    conf = &quot;/private/etc/apache2/httpd.conf&quot;
-    File.stubs(:read).with(conf).returns(&quot;Include /private/etc/apache2/other/*.conf&quot;)
+    File.stubs(:read).with(PassengerPaneConfig::HTTPD_CONF).returns(&quot;Include #{PassengerPaneConfig::APACHE_DIR}/other/*.conf&quot;)
     
     file_mock = mock(&quot;Apache conf&quot;)
-    File.expects(:open).with(conf, 'a').yields(file_mock)
+    File.expects(:open).with(PassengerPaneConfig::HTTPD_CONF, 'a').yields(file_mock)
     file_mock.expects(:&lt;&lt;).with(%{
 
 # Added by the Passenger preference pane
@@ -106,23 +104,22 @@ describe &quot;ConfigInstaller&quot; do
 # PassengerRoot, and PassengerRuby directives) before this section.
 &lt;IfModule passenger_module&gt;
   NameVirtualHost *:80
-  Include /private/etc/apache2/passenger_pane_vhosts/*.conf
+  Include #{PassengerPaneConfig::PASSENGER_APPS_DIR}/*.conf
 &lt;/IfModule&gt;})
 
     @installer.verify_httpd_conf
   end
   
   it &quot;should not add the vhosts configuration to the apache conf if it's in there already&quot; do
-    conf = &quot;/private/etc/apache2/httpd.conf&quot;
-    File.stubs(:read).with(conf).returns(%{
-Include /private/etc/apache2/other/*.conf
+    File.stubs(:read).with(PassengerPaneConfig::HTTPD_CONF).returns(%{
+Include #{PassengerPaneConfig::APACHE_DIR}/other/*.conf
 
 # Added by the Passenger preference pane
 # Make sure to include the Passenger configuration (the LoadModule,
 # PassengerRoot, and PassengerRuby directives) before this section.
 &lt;IfModule passenger_module&gt;
   NameVirtualHost *:80
-  Include /private/etc/apache2/passenger_pane_vhosts/*.conf
+  Include #{PassengerPaneConfig::PASSENGER_APPS_DIR}/*.conf
 &lt;/IfModule&gt;})
     
     File.expects(:open).times(0)
@@ -130,11 +127,10 @@ Include /private/etc/apache2/other/*.conf
   end
   
   it &quot;should not check if our configuration to load the vhosts has been added to the apache conf yet&quot; do
-    conf = &quot;/private/etc/apache2/httpd.conf&quot;
-    File.stubs(:read).with(conf).returns(&quot;Include /private/etc/apache2/other/*.conf&quot;)
+    File.stubs(:read).with(PassengerPaneConfig::HTTPD_CONF).returns(&quot;Include #{PassengerPaneConfig::APACHE_DIR}/other/*.conf&quot;)
     
     file_mock = mock(&quot;Apache conf&quot;)
-    File.expects(:open).with(conf, 'a').yields(file_mock)
+    File.expects(:open).with(PassengerPaneConfig::HTTPD_CONF, 'a').yields(file_mock)
     file_mock.expects(:&lt;&lt;).with(%{
 
 # Added by the Passenger preference pane
@@ -142,14 +138,14 @@ Include /private/etc/apache2/other/*.conf
 # PassengerRoot, and PassengerRuby directives) before this section.
 &lt;IfModule passenger_module&gt;
   NameVirtualHost *:80
-  Include /private/etc/apache2/passenger_pane_vhosts/*.conf
+  Include #{PassengerPaneConfig::PASSENGER_APPS_DIR}/*.conf
 &lt;/IfModule&gt;})
     
     @installer.verify_httpd_conf
   end
   
   it &quot;should restart Apache&quot; do
-    @installer.expects(:system).with(&quot;sudo /bin/launchctl stop org.apache.httpd&quot;)
+    @installer.expects(:system).with(PassengerPaneConfig::APACHE_RESTART_COMMAND)
     @installer.restart_apache!
   end
   </diff>
      <filename>test/config_installer_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,7 +32,7 @@ describe &quot;ConfigUninstaller&quot; do
   end
   
   it &quot;should return the path to the vhost config&quot; do
-    @uninstaller.config_path(0).should == &quot;/private/etc/apache2/passenger_pane_vhosts/het-manfreds-blog.local.vhost.conf&quot;
+    @uninstaller.config_path(0).should == &quot;#{PassengerPaneConfig::PASSENGER_APPS_DIR}/het-manfreds-blog.local.vhost.conf&quot;
   end
   
   it &quot;should remove the vhost config file&quot; do
@@ -42,7 +42,7 @@ describe &quot;ConfigUninstaller&quot; do
   end
   
   it &quot;should restart Apache&quot; do
-    @uninstaller.expects(:system).with(&quot;/bin/launchctl stop org.apache.httpd&quot;)
+    @uninstaller.expects(:system).with(PassengerPaneConfig::APACHE_RESTART_COMMAND)
     @uninstaller.restart_apache!
   end
   </diff>
      <filename>test/config_uninstaller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -142,7 +142,7 @@ describe &quot;PassengerApplication, in general&quot; do
   end
   
   it &quot;should return the path to the config file&quot; do
-    passenger_app.config_path.should == File.join(SharedPassengerBehaviour::PASSENGER_APPS_DIR, &quot;het-manfreds-blog.local.vhost.conf&quot;)
+    passenger_app.config_path.should == File.join(PassengerPaneConfig::PASSENGER_APPS_DIR, &quot;het-manfreds-blog.local.vhost.conf&quot;)
   end
   
   it &quot;should be able to save the config file&quot; do
@@ -255,7 +255,7 @@ describe &quot;PassengerApplication, in general&quot; do
   end
   
   it &quot;should load existing applications&quot; do
-    dir = SharedPassengerBehaviour::PASSENGER_APPS_DIR
+    dir = PassengerPaneConfig::PASSENGER_APPS_DIR
     blog, paste = [&quot;#{dir}/blog.vhost.conf&quot;, &quot;#{dir}/paste.vhost.conf&quot;]
     blog_app, paste_app = stub(&quot;PassengerApplication: blog&quot;), stub(&quot;PassengerApplication: paste&quot;)
     </diff>
      <filename>test/passenger_application_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -106,7 +106,7 @@ describe &quot;PrefPanePassenger, when about to be (re)displayed&quot; do
     installPassengerWarning.hidden?.should.be true
   end
   
-  it &quot;should add existing applications found in #{SharedPassengerBehaviour::PASSENGER_APPS_DIR} to the array controller: applicationsController&quot; do
+  it &quot;should add existing applications found in #{PassengerPaneConfig::PASSENGER_APPS_DIR} to the array controller: applicationsController&quot; do
     blog_app, paste_app = add_applications!
     pref_pane.paneWillBecomeActive
     
@@ -126,7 +126,7 @@ describe &quot;PrefPanePassenger, when about to be (re)displayed&quot; do
   private
   
   def add_applications!
-    dir = SharedPassengerBehaviour::PASSENGER_APPS_DIR
+    dir = PassengerPaneConfig::PASSENGER_APPS_DIR
     blog, paste = [&quot;#{dir}/blog.vhost.conf&quot;, &quot;#{dir}/paste.vhost.conf&quot;]
     apps = stub(&quot;PassengerApplication: blog&quot;), stub(&quot;PassengerApplication: paste&quot;)
     PassengerApplication.stubs(:existingApplications).returns(apps)</diff>
      <filename>test/pref_pane_passenger_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e2bf8d77cece5b99df8e9ee5052598f446a6d695</id>
    </parent>
  </parents>
  <author>
    <name>Eloy Duran</name>
    <email>eloy.de.enige@gmail.com</email>
  </author>
  <url>http://github.com/alloy/passengerpane/commit/8b6387ca9b022cabbe10e5fa36c28e8f4c11a6db</url>
  <id>8b6387ca9b022cabbe10e5fa36c28e8f4c11a6db</id>
  <committed-date>2008-08-26T11:48:14-07:00</committed-date>
  <authored-date>2008-08-26T11:48:14-07:00</authored-date>
  <message>Refactored all paths to Apache dirs into a central config module PassengerPaneConfig.

This should make it easier for people to configure for a custom Apache.

[#18 state:resolved]</message>
  <tree>4ccad372904e0dbc0db9a928ed07021338376f4b</tree>
  <committer>
    <name>Eloy Duran</name>
    <email>eloy.de.enige@gmail.com</email>
  </committer>
</commit>
