Permalink
Browse files

Make sure that hitting OK in the alert will run the passenger_config_…

…installer script.
  • Loading branch information...
1 parent e90332d commit 79c46290542c3c9920bf7bc5a429ec4daf8ae38c @alloy alloy committed Jun 10, 2008
Showing with 14 additions and 2 deletions.
  1. +8 −0 Passenger.xcodeproj/project.pbxproj
  2. +3 −1 PassengerPref.rb
  3. +2 −0 shared_passenger_behaviour.rb
  4. +1 −1 test/pref_pane_passenger_test.rb
@@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
516B1B6E0DD3D344009ADB8E /* config_installer.rb in Resources */ = {isa = PBXBuildFile; fileRef = 516B1B6D0DD3D344009ADB8E /* config_installer.rb */; };
519DFB9F0DFDD825008A42FE /* PassengerApplication.rb in Resources */ = {isa = PBXBuildFile; fileRef = 519DFB9E0DFDD825008A42FE /* PassengerApplication.rb */; };
+ 519DFBA80DFE8EAF008A42FE /* passenger_config_installer.rb in Resources */ = {isa = PBXBuildFile; fileRef = 519DFBA60DFE8EAF008A42FE /* passenger_config_installer.rb */; };
+ 519DFBA90DFE8EAF008A42FE /* shared_passenger_behaviour.rb in Resources */ = {isa = PBXBuildFile; fileRef = 519DFBA70DFE8EAF008A42FE /* shared_passenger_behaviour.rb */; };
8D202CEA0486D31800D8A456 /* Passenger_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCFA20370C41700C91783 /* Passenger_Prefix.pch */; };
8D202CED0486D31800D8A456 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
8D202CEE0486D31800D8A456 /* PassengerPref.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F506C040013D9D8001CA16C8 /* PassengerPref.tiff */; };
@@ -28,6 +30,8 @@
32DBCFA20370C41700C91783 /* Passenger_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Passenger_Prefix.pch; sourceTree = "<group>"; };
516B1B6D0DD3D344009ADB8E /* config_installer.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = config_installer.rb; sourceTree = "<group>"; };
519DFB9E0DFDD825008A42FE /* PassengerApplication.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = PassengerApplication.rb; sourceTree = "<group>"; };
+ 519DFBA60DFE8EAF008A42FE /* passenger_config_installer.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = passenger_config_installer.rb; sourceTree = "<group>"; };
+ 519DFBA70DFE8EAF008A42FE /* shared_passenger_behaviour.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = shared_passenger_behaviour.rb; sourceTree = "<group>"; };
8D202CF70486D31800D8A456 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D202CF80486D31800D8A456 /* Passenger.prefPane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Passenger.prefPane; sourceTree = BUILT_PRODUCTS_DIR; };
9648B5E70D195BC700DC73E2 /* RubyCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RubyCocoa.framework; path = /System/Library/Frameworks/RubyCocoa.framework; sourceTree = "<absolute>"; };
@@ -79,6 +83,8 @@
519DFB9E0DFDD825008A42FE /* PassengerApplication.rb */,
9648B5EE0D195C2F00DC73E2 /* Pref.xib */,
8D202CF70486D31800D8A456 /* Info.plist */,
+ 519DFBA60DFE8EAF008A42FE /* passenger_config_installer.rb */,
+ 519DFBA70DFE8EAF008A42FE /* shared_passenger_behaviour.rb */,
089C167DFE841241C02AAC07 /* InfoPlist.strings */,
F506C040013D9D8001CA16C8 /* PassengerPref.tiff */,
);
@@ -192,6 +198,8 @@
9648B5F00D195C2F00DC73E2 /* Pref.xib in Resources */,
516B1B6E0DD3D344009ADB8E /* config_installer.rb in Resources */,
519DFB9F0DFDD825008A42FE /* PassengerApplication.rb in Resources */,
+ 519DFBA80DFE8EAF008A42FE /* passenger_config_installer.rb in Resources */,
+ 519DFBA90DFE8EAF008A42FE /* shared_passenger_behaviour.rb in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -66,7 +66,9 @@ def is_users_apache_config_setup?
def user_wants_us_to_setup_config?
alert = OSX::NSAlert.alloc.init
alert.informativeText = "It seems that your apache configuration hasn't been supercharged with Passenger deploy-dull-making power yet, would you like to do this now?"
- alert.runModal == OSX::NSAlertFirstButtonReturn
+ alert.addButtonWithTitle('Cancel')
+ alert.addButtonWithTitle('OK')
+ alert.runModal == OSX::NSAlertSecondButtonReturn
end
def setup_users_apache_config!
@@ -1,4 +1,6 @@
module SharedPassengerBehaviour
+ include OSX
+
def execute(command)
script = NSAppleScript.alloc.initWithSource("do shell script \"#{command}\" with administrator privileges")
script.performSelector_withObject("executeAndReturnError:", nil)
@@ -41,7 +41,7 @@ def after_setup
end
it "should ask the user if we should set up passenger for them" do
- OSX::NSAlert.any_instance.expects(:runModal).returns(OSX::NSAlertFirstButtonReturn)
+ OSX::NSAlert.any_instance.expects(:runModal).returns(OSX::NSAlertSecondButtonReturn)
pref_pane.user_wants_us_to_setup_config?.should.be true
end

0 comments on commit 79c4629

Please sign in to comment.