passenger 3.0.0.pre2 → 3.0.0.pre3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (182) hide show
  1. data/bin/passenger-status +1 -1
  2. data/build/packaging.rb +4 -7
  3. data/build/ruby_extension.rb +5 -5
  4. data/ext/common/Constants.h +1 -1
  5. data/ext/common/LoggingAgent/RemoteSender.h +3 -1
  6. data/ext/nginx/ngx_http_passenger_module.c +1 -1
  7. data/ext/{phusion_passenger → ruby}/extconf.rb +1 -1
  8. data/ext/{phusion_passenger/native_support.c → ruby/passenger_native_support.c} +1 -1
  9. data/lib/phusion_passenger.rb +5 -6
  10. data/lib/phusion_passenger/dependencies.rb +23 -0
  11. data/lib/phusion_passenger/native_support.rb +123 -65
  12. data/lib/phusion_passenger/packaging.rb +1 -1
  13. data/lib/phusion_passenger/platform_info/apache.rb +1 -1
  14. data/lib/phusion_passenger/platform_info/compiler.rb +25 -1
  15. data/lib/phusion_passenger/platform_info/ruby.rb +36 -5
  16. data/lib/phusion_passenger/standalone/runtime_installer.rb +5 -4
  17. data/lib/phusion_passenger/utils.rb +62 -1
  18. data/test/ruby/utils_spec.rb +62 -0
  19. data/test/support/test_helper.rb +2 -0
  20. metadata +6 -168
  21. data/doc/rdoc/classes/ConditionVariable.html +0 -215
  22. data/doc/rdoc/classes/Exception.html +0 -120
  23. data/doc/rdoc/classes/GC.html +0 -113
  24. data/doc/rdoc/classes/IO.html +0 -221
  25. data/doc/rdoc/classes/PhusionPassenger.html +0 -368
  26. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
  27. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
  28. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
  29. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
  30. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  31. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  32. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  33. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  34. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
  35. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
  36. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
  37. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
  38. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
  39. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
  40. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
  41. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
  42. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
  43. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
  44. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
  45. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
  46. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
  47. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -341
  48. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -294
  49. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -199
  50. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
  51. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
  52. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
  53. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
  54. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
  55. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
  56. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
  57. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
  58. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
  59. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
  60. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
  61. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  62. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
  63. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  64. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
  65. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  66. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  67. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
  68. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
  69. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
  70. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -494
  71. data/doc/rdoc/classes/PhusionPassenger/NativeSupport/FileSystemWatcher.html +0 -96
  72. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
  73. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1758
  74. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
  75. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  76. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
  77. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
  78. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
  79. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
  80. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -256
  81. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
  82. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
  83. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
  84. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
  85. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
  86. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
  87. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
  88. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
  89. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
  90. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
  91. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
  92. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
  93. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
  94. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
  95. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
  96. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
  97. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
  98. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
  99. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  100. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1468
  101. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
  102. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
  103. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
  104. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
  105. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
  106. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
  107. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  108. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
  109. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  110. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  111. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
  112. data/doc/rdoc/classes/Process.html +0 -115
  113. data/doc/rdoc/classes/Signal.html +0 -139
  114. data/doc/rdoc/created.rid +0 -1
  115. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -276
  116. data/doc/rdoc/files/README.html +0 -157
  117. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
  118. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
  119. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
  120. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  121. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  122. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
  123. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
  124. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  125. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
  126. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
  127. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
  128. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
  129. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
  130. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
  131. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
  132. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  133. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  134. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
  135. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
  136. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  137. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
  138. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  139. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
  140. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -131
  141. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  142. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
  143. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
  144. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -126
  145. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
  146. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
  147. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
  148. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
  149. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
  150. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
  151. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
  152. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
  153. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
  154. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
  155. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  156. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
  157. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  158. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
  159. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
  160. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -135
  161. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
  162. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
  163. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
  164. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
  165. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -132
  166. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
  167. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
  168. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
  169. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
  170. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
  171. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
  172. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
  173. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  174. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
  175. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
  176. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
  177. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
  178. data/doc/rdoc/fr_class_index.html +0 -139
  179. data/doc/rdoc/fr_file_index.html +0 -109
  180. data/doc/rdoc/fr_method_index.html +0 -435
  181. data/doc/rdoc/index.html +0 -26
  182. data/doc/rdoc/rdoc-style.css +0 -187
@@ -1,96 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Class: PhusionPassenger::NativeSupport::FileSystemWatcher</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::NativeSupport::FileSystemWatcher</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../../files/ext/phusion_passenger/native_support_c.html">ext/phusion_passenger/native_support.c</a>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>Parent:</td>
65
- <td>
66
- Object
67
- </td>
68
- </tr>
69
- </table>
70
- </td>
71
- </tr>
72
- </table>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
- <div id="content">
77
-
78
- <div class="description"><p>
79
- Utility functions for accessing system functionality.
80
- </p>
81
- </div>
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
- </div>
92
-
93
- </div>
94
-
95
- </body>
96
- </html>
@@ -1,129 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: PhusionPassenger::Packaging</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::Packaging</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/packaging_rb.html">lib/phusion_passenger/packaging.rb</a>
61
- </td>
62
- </tr>
63
- </table>
64
- </td>
65
- </tr>
66
- </table>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
- <div id="content">
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
- <div class="sectiontitle">Constants</div>
80
- <table border='0' cellpadding='5'>
81
- <tr valign='top'>
82
- <td class="attr-name">ASCII_DOCS</td>
83
- <td>=</td>
84
- <td class="attr-value">[ 'doc/Users guide Apache.html', 'doc/Users guide Nginx.html', 'doc/Users guide Standalone.html', 'doc/Security of user switching support.html', 'doc/Architectural overview.html'</td>
85
- </tr>
86
- <tr valign='top'>
87
- <td>&nbsp;</td>
88
- <td colspan="2" class="attr-desc">
89
- A list of HTML files that are generated with Asciidoc.
90
-
91
- </td>
92
- </tr>
93
- <tr valign='top'>
94
- <td class="attr-name">USER_EXECUTABLES</td>
95
- <td>=</td>
96
- <td class="attr-value">[ 'passenger', 'passenger-install-apache2-module', 'passenger-install-nginx-module', 'passenger-config', 'passenger-stress-test'</td>
97
- </tr>
98
- <tr valign='top'>
99
- <td class="attr-name">SUPER_USER_EXECUTABLES</td>
100
- <td>=</td>
101
- <td class="attr-value">[ 'passenger-status', 'passenger-memory-stats', 'passenger-make-enterprisey'</td>
102
- </tr>
103
- <tr valign='top'>
104
- <td class="attr-name">GLOB</td>
105
- <td>=</td>
106
- <td class="attr-value">[ 'Rakefile', 'README', 'DEVELOPERS.TXT', 'PACKAGING.TXT', 'LICENSE', 'INSTALL', 'NEWS', 'build/*.rb', 'lib/*.rb', 'lib/**/*.rb', 'lib/**/*.py', 'lib/phusion_passenger/templates/*', 'lib/phusion_passenger/templates/apache2/*', 'lib/phusion_passenger/templates/nginx/*', 'lib/phusion_passenger/templates/standalone/*', 'lib/phusion_passenger/templates/standalone_default_root/*', 'bin/*', 'doc/**/*', 'man/*', 'debian/*', 'helper-scripts/*', 'ext/common/**/*.{cpp,c,h,hpp}', 'ext/apache2/*.{cpp,h,hpp,c,TXT}', 'ext/nginx/*.{c,cpp,h}', 'ext/nginx/config', 'ext/boost/**/*', 'ext/google/**/*', 'ext/libev/{LICENSE,Changes,README,Makefile.am,Makefile.in}', 'ext/libev/{*.m4,autogen.sh,config.guess,config.h.in,config.sub}', 'ext/libev/{configure,configure.ac,install-sh,ltmain.sh,missing,mkinstalldirs}', 'ext/libev/{*.h,*.c}', 'ext/oxt/*.hpp', 'ext/oxt/*.cpp', 'ext/oxt/detail/*.hpp', 'ext/phusion_passenger/*.{c,rb}', 'misc/*', 'test/*.example', 'test/support/*.{cpp,h,rb}', 'test/tut/*', 'test/cxx/*.{cpp,h}', 'test/oxt/*.{cpp,hpp}', 'test/ruby/**/*', 'test/integration_tests/**/*', 'test/stub/**/*'</td>
107
- </tr>
108
- <tr valign='top'>
109
- <td>&nbsp;</td>
110
- <td colspan="2" class="attr-desc">
111
- A list of globs which match all files that should be packaged in the
112
- Phusion Passenger gem or tarball.
113
-
114
- </td>
115
- </tr>
116
- <tr valign='top'>
117
- <td class="attr-name">EXCLUDE_GLOB</td>
118
- <td>=</td>
119
- <td class="attr-value">[ 'test/stub/rails_apps/3.0/empty/help/**/*'</td>
120
- </tr>
121
- </table>
122
-
123
-
124
- </div>
125
-
126
- </div>
127
-
128
- </body>
129
- </html>
@@ -1,1758 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: PhusionPassenger::PlatformInfo</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />PhusionPassenger::PlatformInfo</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/phusion_passenger/platform_info_rb.html">lib/phusion_passenger/platform_info.rb</a>
61
- <a href="../../files/lib/phusion_passenger/platform_info/apache_rb.html">lib/phusion_passenger/platform_info/apache.rb</a>
62
- <a href="../../files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html">lib/phusion_passenger/platform_info/binary_compatibility.rb</a>
63
- <a href="../../files/lib/phusion_passenger/platform_info/compiler_rb.html">lib/phusion_passenger/platform_info/compiler.rb</a>
64
- <a href="../../files/lib/phusion_passenger/platform_info/curl_rb.html">lib/phusion_passenger/platform_info/curl.rb</a>
65
- <a href="../../files/lib/phusion_passenger/platform_info/documentation_tools_rb.html">lib/phusion_passenger/platform_info/documentation_tools.rb</a>
66
- <a href="../../files/lib/phusion_passenger/platform_info/linux_rb.html">lib/phusion_passenger/platform_info/linux.rb</a>
67
- <a href="../../files/lib/phusion_passenger/platform_info/operating_system_rb.html">lib/phusion_passenger/platform_info/operating_system.rb</a>
68
- <a href="../../files/lib/phusion_passenger/platform_info/ruby_rb.html">lib/phusion_passenger/platform_info/ruby.rb</a>
69
- <a href="../../files/lib/phusion_passenger/platform_info/zlib_rb.html">lib/phusion_passenger/platform_info/zlib.rb</a>
70
- </td>
71
- </tr>
72
- </table>
73
- </td>
74
- </tr>
75
- </table>
76
- <!-- banner header -->
77
-
78
- <div id="bodyContent">
79
- <div id="content">
80
-
81
- <div class="description"><p>
82
- Users can change the detection behavior by setting the environment variable
83
- <tt>APXS2</tt> to the correct &#8216;apxs&#8217; (or &#8216;<a
84
- href="PlatformInfo.html#M000040">apxs2</a>&#8217;) binary, as provided by
85
- Apache.
86
- </p>
87
- </div>
88
-
89
-
90
-
91
- <div class="sectiontitle">Methods</div>
92
- <ul>
93
- <li><a href="#M000045">apache2_bindir</a></li>
94
- <li><a href="#M000047">apache2_module_cflags</a></li>
95
- <li><a href="#M000048">apache2_module_ldflags</a></li>
96
- <li><a href="#M000046">apache2_sbindir</a></li>
97
- <li><a href="#M000041">apache2ctl</a></li>
98
- <li><a href="#M000043">apr_config</a></li>
99
- <li><a href="#M000053">apr_config_needed_for_building_apache_modules?</a></li>
100
- <li><a href="#M000049">apr_flags</a></li>
101
- <li><a href="#M000050">apr_libs</a></li>
102
- <li><a href="#M000044">apu_config</a></li>
103
- <li><a href="#M000051">apu_flags</a></li>
104
- <li><a href="#M000052">apu_libs</a></li>
105
- <li><a href="#M000040">apxs2</a></li>
106
- <li><a href="#M000068">asciidoc</a></li>
107
- <li><a href="#M000057">cc</a></li>
108
- <li><a href="#M000059">compiler_supports_visibility_flag?</a></li>
109
- <li><a href="#M000060">compiler_visibility_flag_generates_warnings?</a></li>
110
- <li><a href="#M000054">cpu_architecture</a></li>
111
- <li><a href="#M000065">curl_flags</a></li>
112
- <li><a href="#M000066">curl_libs</a></li>
113
- <li><a href="#M000067">curl_supports_ssl?</a></li>
114
- <li><a href="#M000058">cxx</a></li>
115
- <li><a href="#M000063">debugging_cflags</a></li>
116
- <li><a href="#M000039">env_defined?</a></li>
117
- <li><a href="#M000064">export_dynamic_flags</a></li>
118
- <li><a href="#M000038">find_command</a></li>
119
- <li><a href="#M000075">fork_supported?</a></li>
120
- <li><a href="#M000076">gem_command</a></li>
121
- <li><a href="#M000042">httpd</a></li>
122
- <li><a href="#M000080">in_rvm?</a></li>
123
- <li><a href="#M000072">library_extension</a></li>
124
- <li><a href="#M000069">linux_distro</a></li>
125
- <li><a href="#M000070">linux_distro_tags</a></li>
126
- <li><a href="#M000084">locate_ruby_executable</a></li>
127
- <li><a href="#M000071">os_name</a></li>
128
- <li><a href="#M000056">passenger_binary_compatibility_id</a></li>
129
- <li><a href="#M000061">portability_cflags</a></li>
130
- <li><a href="#M000062">portability_ldflags</a></li>
131
- <li><a href="#M000077">rake</a></li>
132
- <li><a href="#M000078">rake_command</a></li>
133
- <li><a href="#M000079">rspec</a></li>
134
- <li><a href="#M000073">ruby_command</a></li>
135
- <li><a href="#M000074">ruby_executable</a></li>
136
- <li><a href="#M000055">ruby_extension_binary_compatibility_ids</a></li>
137
- <li><a href="#M000083">ruby_sudo_command</a></li>
138
- <li><a href="#M000081">rvm_path</a></li>
139
- <li><a href="#M000082">rvm_ruby_string</a></li>
140
- <li><a href="#M000085">zlib_flags</a></li>
141
- <li><a href="#M000086">zlib_libs</a></li>
142
- </ul>
143
-
144
-
145
-
146
-
147
- <div class="sectiontitle">Constants</div>
148
- <table border='0' cellpadding='5'>
149
- <tr valign='top'>
150
- <td class="attr-name">GEM_HOME</td>
151
- <td>=</td>
152
- <td class="attr-value">gem_home</td>
153
- </tr>
154
- <tr valign='top'>
155
- <td class="attr-name">RUBY_ENGINE</td>
156
- <td>=</td>
157
- <td class="attr-value">::RUBY_ENGINE</td>
158
- </tr>
159
- <tr valign='top'>
160
- <td class="attr-name">RUBY_ENGINE</td>
161
- <td>=</td>
162
- <td class="attr-value">&quot;ruby&quot;</td>
163
- </tr>
164
- </table>
165
-
166
-
167
- <div class="sectiontitle">Public Class methods</div>
168
- <div class="method">
169
- <div class="title">
170
- <a name="M000045"></a><b>apache2_bindir</b>()
171
- </div>
172
- <div class="description">
173
- <p>
174
- The absolute path to the Apache 2 &#8216;bin&#8217; directory, or nil if
175
- unknown.
176
- </p>
177
- </div>
178
- <div class="sourcecode">
179
- <p class="source-link">[ <a href="javascript:toggleSource('M000045_source')" id="l_M000045_source">show source</a> ]</p>
180
- <div id="M000045_source" class="dyn-source">
181
- <pre>
182
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 140</span>
183
- 140: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_bindir</span>
184
- 141: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
185
- 142: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
186
- 143: <span class="ruby-keyword kw">else</span>
187
- 144: <span class="ruby-keyword kw">return</span> <span class="ruby-node">`#{apxs2} -q BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
188
- 145: <span class="ruby-keyword kw">end</span>
189
- 146: <span class="ruby-keyword kw">end</span>
190
- </pre>
191
- </div>
192
- </div>
193
- </div>
194
- <div class="method">
195
- <div class="title">
196
- <a name="M000047"></a><b>apache2_module_cflags</b>(with_apr_flags = true)
197
- </div>
198
- <div class="description">
199
- <p>
200
- The C compiler flags that are necessary to compile an Apache module. Also
201
- includes APR and APU compiler flags if with_apr_flags is true.
202
- </p>
203
- </div>
204
- <div class="sourcecode">
205
- <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>
206
- <div id="M000047_source" class="dyn-source">
207
- <pre>
208
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 164</span>
209
- 164: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_module_cflags</span>(<span class="ruby-identifier">with_apr_flags</span> = <span class="ruby-keyword kw">true</span>)
210
- 165: <span class="ruby-identifier">flags</span> = [<span class="ruby-value str">&quot;-fPIC&quot;</span>]
211
- 166: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_supports_visibility_flag?</span>
212
- 167: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED&quot;</span>
213
- 168: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_visibility_flag_generates_warnings?</span>
214
- 169: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-Wno-attributes&quot;</span>
215
- 170: <span class="ruby-keyword kw">end</span>
216
- 171: <span class="ruby-keyword kw">end</span>
217
- 172: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">with_apr_flags</span>
218
- 173: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apr_flags</span>
219
- 174: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apu_flags</span>
220
- 175: <span class="ruby-keyword kw">end</span>
221
- 176: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
222
- 177: <span class="ruby-identifier">apxs2_flags</span> = <span class="ruby-node">`#{apxs2} -q CFLAGS`</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; -I&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">`#{apxs2} -q INCLUDEDIR`</span>.<span class="ruby-identifier">strip</span>
223
- 178: <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/-O\d? /</span>, <span class="ruby-value str">''</span>)
224
- 179:
225
- 180: <span class="ruby-comment cmt"># Remove flags not supported by GCC</span>
226
- 181: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span> <span class="ruby-comment cmt"># TODO: Add support for people using SunStudio</span>
227
- 182: <span class="ruby-comment cmt"># The big problem is Coolstack apxs includes a bunch of solaris -x directives.</span>
228
- 183: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">split</span>
229
- 184: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-x/</span> }
230
- 185: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-Xa/</span> }
231
- 186: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-fast/</span> }
232
- 187: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\-mt/</span> }
233
- 188: <span class="ruby-identifier">apxs2_flags</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
234
- 189: <span class="ruby-keyword kw">end</span>
235
- 190:
236
- 191: <span class="ruby-identifier">apxs2_flags</span>.<span class="ruby-identifier">strip!</span>
237
- 192: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">apxs2_flags</span>
238
- 193: <span class="ruby-keyword kw">end</span>
239
- 194: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">httpd</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
240
- 195: <span class="ruby-comment cmt"># The default Apache install on OS X is a universal binary.</span>
241
- 196: <span class="ruby-comment cmt"># Figure out which architectures it's compiled for and do the same</span>
242
- 197: <span class="ruby-comment cmt"># thing for mod_passenger. We use the 'file' utility to do this.</span>
243
- 198: <span class="ruby-comment cmt">#</span>
244
- 199: <span class="ruby-comment cmt"># Running 'file' on the Apache executable usually outputs something</span>
245
- 200: <span class="ruby-comment cmt"># like this:</span>
246
- 201: <span class="ruby-comment cmt">#</span>
247
- 202: <span class="ruby-comment cmt"># /usr/sbin/httpd: Mach-O universal binary with 4 architectures</span>
248
- 203: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture ppc7400): Mach-O executable ppc</span>
249
- 204: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture ppc64): Mach-O 64-bit executable ppc64</span>
250
- 205: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture i386): Mach-O executable i386</span>
251
- 206: <span class="ruby-comment cmt"># /usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable x86_64</span>
252
- 207: <span class="ruby-comment cmt">#</span>
253
- 208: <span class="ruby-comment cmt"># But on some machines, it may output just:</span>
254
- 209: <span class="ruby-comment cmt">#</span>
255
- 210: <span class="ruby-comment cmt"># /usr/sbin/httpd: Mach-O fat file with 4 architectures</span>
256
- 211: <span class="ruby-comment cmt">#</span>
257
- 212: <span class="ruby-comment cmt"># (http://code.google.com/p/phusion-passenger/issues/detail?id=236)</span>
258
- 213: <span class="ruby-identifier">output</span> = <span class="ruby-node">`file &quot;#{httpd}&quot;`</span>.<span class="ruby-identifier">strip</span>
259
- 214: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Mach-O fat file/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/for architecture/</span>
260
- 215: <span class="ruby-identifier">architectures</span> = [<span class="ruby-value str">&quot;-arch i386 -arch ppc -arch x86_64 -arch ppc64&quot;</span>]
261
- 216: <span class="ruby-keyword kw">else</span>
262
- 217: <span class="ruby-identifier">architectures</span> = []
263
- 218: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/for architecture/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
264
- 219: <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/for architecture (.*?)\)/</span>
265
- 220: <span class="ruby-identifier">architectures</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-arch #{$1}&quot;</span>
266
- 221: <span class="ruby-keyword kw">end</span>
267
- 222: <span class="ruby-keyword kw">end</span>
268
- 223: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">architectures</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>)
269
- 224: <span class="ruby-keyword kw">end</span>
270
- 225: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">' '</span>).<span class="ruby-identifier">strip</span>
271
- 226: <span class="ruby-keyword kw">end</span>
272
- </pre>
273
- </div>
274
- </div>
275
- </div>
276
- <div class="method">
277
- <div class="title">
278
- <a name="M000048"></a><b>apache2_module_ldflags</b>()
279
- </div>
280
- <div class="description">
281
- <p>
282
- Linker flags that are necessary for linking an Apache module. Already
283
- includes APR and APU linker flags.
284
- </p>
285
- </div>
286
- <div class="sourcecode">
287
- <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>
288
- <div id="M000048_source" class="dyn-source">
289
- <pre>
290
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 231</span>
291
- 231: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_module_ldflags</span>
292
- 232: <span class="ruby-identifier">flags</span> = <span class="ruby-node">&quot;-fPIC #{apr_libs} #{apu_libs}&quot;</span>
293
- 233: <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">strip!</span>
294
- 234: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>
295
- 235: <span class="ruby-keyword kw">end</span>
296
- </pre>
297
- </div>
298
- </div>
299
- </div>
300
- <div class="method">
301
- <div class="title">
302
- <a name="M000046"></a><b>apache2_sbindir</b>()
303
- </div>
304
- <div class="description">
305
- <p>
306
- The absolute path to the Apache 2 &#8216;sbin&#8217; directory, or nil if
307
- unknown.
308
- </p>
309
- </div>
310
- <div class="sourcecode">
311
- <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p>
312
- <div id="M000046_source" class="dyn-source">
313
- <pre>
314
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 150</span>
315
- 150: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2_sbindir</span>
316
- 151: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
317
- 152: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
318
- 153: <span class="ruby-keyword kw">else</span>
319
- 154: <span class="ruby-keyword kw">return</span> <span class="ruby-node">`#{apxs2} -q SBINDIR`</span>.<span class="ruby-identifier">strip</span>
320
- 155: <span class="ruby-keyword kw">end</span>
321
- 156: <span class="ruby-keyword kw">end</span>
322
- </pre>
323
- </div>
324
- </div>
325
- </div>
326
- <div class="method">
327
- <div class="title">
328
- <a name="M000041"></a><b>apache2ctl</b>()
329
- </div>
330
- <div class="description">
331
- <p>
332
- The absolute path to the &#8216;apachectl&#8217; or &#8216;<a
333
- href="PlatformInfo.html#M000041">apache2ctl</a>&#8217; binary, or nil if
334
- not found.
335
- </p>
336
- </div>
337
- <div class="sourcecode">
338
- <p class="source-link">[ <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show source</a> ]</p>
339
- <div id="M000041_source" class="dyn-source">
340
- <pre>
341
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 60</span>
342
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apache2ctl</span>
343
- 61: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_apache2_executable</span>(<span class="ruby-value str">'apache2ctl'</span>, <span class="ruby-value str">'apachectl2'</span>, <span class="ruby-value str">'apachectl'</span>)
344
- 62: <span class="ruby-keyword kw">end</span>
345
- </pre>
346
- </div>
347
- </div>
348
- </div>
349
- <div class="method">
350
- <div class="title">
351
- <a name="M000043"></a><b>apr_config</b>()
352
- </div>
353
- <div class="description">
354
- <p>
355
- The absolute path to the &#8216;apr-config&#8217; or
356
- &#8216;apr-1-config&#8217; executable, or nil if not found.
357
- </p>
358
- </div>
359
- <div class="sourcecode">
360
- <p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p>
361
- <div id="M000043_source" class="dyn-source">
362
- <pre>
363
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 86</span>
364
- 86: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_config</span>
365
- 87: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'APR_CONFIG'</span>)
366
- 88: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'APR_CONFIG'</span>]
367
- 89: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
368
- 90: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
369
- 91: <span class="ruby-keyword kw">else</span>
370
- 92: <span class="ruby-identifier">filename</span> = <span class="ruby-node">`#{apxs2} -q APR_CONFIG 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
371
- 93: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">empty?</span>
372
- 94: <span class="ruby-identifier">apr_bindir</span> = <span class="ruby-node">`#{apxs2} -q APR_BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
373
- 95: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apr_bindir</span>.<span class="ruby-identifier">empty?</span>
374
- 96: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
375
- 97: <span class="ruby-keyword kw">else</span>
376
- 98: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">select_executable</span>(<span class="ruby-identifier">apr_bindir</span>,
377
- 99: <span class="ruby-value str">&quot;apr-1-config&quot;</span>, <span class="ruby-value str">&quot;apr-config&quot;</span>)
378
- 100: <span class="ruby-keyword kw">end</span>
379
- 101: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
380
- 102: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
381
- 103: <span class="ruby-keyword kw">else</span>
382
- 104: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
383
- 105: <span class="ruby-keyword kw">end</span>
384
- 106: <span class="ruby-keyword kw">end</span>
385
- 107: <span class="ruby-keyword kw">end</span>
386
- </pre>
387
- </div>
388
- </div>
389
- </div>
390
- <div class="method">
391
- <div class="title">
392
- <a name="M000053"></a><b>apr_config_needed_for_building_apache_modules?</b>()
393
- </div>
394
- <div class="description">
395
- <p>
396
- Returns whether it is necessary to use information outputted by
397
- &#8216;apr-config&#8217; and &#8216;apu-config&#8217; in order to compile
398
- an Apache module. When Apache is installed with &#8212;with-included-apr,
399
- the APR/APU headers are placed into the same directory as the Apache
400
- headers, and so &#8216;apr-config&#8217; and &#8216;apu-config&#8217;
401
- won&#8216;t be necessary in that case.
402
- </p>
403
- </div>
404
- <div class="sourcecode">
405
- <p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
406
- <div id="M000053_source" class="dyn-source">
407
- <pre>
408
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 266</span>
409
- 266: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_config_needed_for_building_apache_modules?</span>
410
- 267: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-node">&quot;/tmp/passenger-platform-check-#{Process.pid}.c&quot;</span>)
411
- 268: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
412
- 269: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;#include &lt;apr.h&gt;&quot;</span>)
413
- 270: <span class="ruby-keyword kw">end</span>
414
- 271: <span class="ruby-keyword kw">begin</span>
415
- 272: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">system</span>(<span class="ruby-node">&quot;(gcc #{apache2_module_cflags(false)} -c '#{filename}' -o '#{filename}.o') &gt;/dev/null 2&gt;/dev/null&quot;</span>)
416
- 273: <span class="ruby-keyword kw">ensure</span>
417
- 274: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
418
- 275: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-node">&quot;#{filename}.o&quot;</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
419
- 276: <span class="ruby-keyword kw">end</span>
420
- 277: <span class="ruby-keyword kw">end</span>
421
- </pre>
422
- </div>
423
- </div>
424
- </div>
425
- <div class="method">
426
- <div class="title">
427
- <a name="M000049"></a><b>apr_flags</b>()
428
- </div>
429
- <div class="description">
430
- <p>
431
- The C compiler flags that are necessary for programs that use APR.
432
- </p>
433
- </div>
434
- <div class="sourcecode">
435
- <p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>
436
- <div id="M000049_source" class="dyn-source">
437
- <pre>
438
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 239</span>
439
- 239: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_flags</span>
440
- 240: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apr_info</span>[<span class="ruby-value">0</span>]
441
- 241: <span class="ruby-keyword kw">end</span>
442
- </pre>
443
- </div>
444
- </div>
445
- </div>
446
- <div class="method">
447
- <div class="title">
448
- <a name="M000050"></a><b>apr_libs</b>()
449
- </div>
450
- <div class="description">
451
- <p>
452
- The linker flags that are necessary for linking programs that use APR.
453
- </p>
454
- </div>
455
- <div class="sourcecode">
456
- <p class="source-link">[ <a href="javascript:toggleSource('M000050_source')" id="l_M000050_source">show source</a> ]</p>
457
- <div id="M000050_source" class="dyn-source">
458
- <pre>
459
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 244</span>
460
- 244: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apr_libs</span>
461
- 245: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apr_info</span>[<span class="ruby-value">1</span>]
462
- 246: <span class="ruby-keyword kw">end</span>
463
- </pre>
464
- </div>
465
- </div>
466
- </div>
467
- <div class="method">
468
- <div class="title">
469
- <a name="M000044"></a><b>apu_config</b>()
470
- </div>
471
- <div class="description">
472
- <p>
473
- The absolute path to the &#8216;apu-config&#8217; or
474
- &#8216;apu-1-config&#8217; executable, or nil if not found.
475
- </p>
476
- </div>
477
- <div class="sourcecode">
478
- <p class="source-link">[ <a href="javascript:toggleSource('M000044_source')" id="l_M000044_source">show source</a> ]</p>
479
- <div id="M000044_source" class="dyn-source">
480
- <pre>
481
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 112</span>
482
- 112: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_config</span>
483
- 113: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'APU_CONFIG'</span>)
484
- 114: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'APU_CONFIG'</span>]
485
- 115: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
486
- 116: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
487
- 117: <span class="ruby-keyword kw">else</span>
488
- 118: <span class="ruby-identifier">filename</span> = <span class="ruby-node">`#{apxs2} -q APU_CONFIG 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
489
- 119: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">empty?</span>
490
- 120: <span class="ruby-identifier">apu_bindir</span> = <span class="ruby-node">`#{apxs2} -q APU_BINDIR 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
491
- 121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">apu_bindir</span>.<span class="ruby-identifier">empty?</span>
492
- 122: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
493
- 123: <span class="ruby-keyword kw">else</span>
494
- 124: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">select_executable</span>(<span class="ruby-identifier">apu_bindir</span>,
495
- 125: <span class="ruby-value str">&quot;apu-1-config&quot;</span>, <span class="ruby-value str">&quot;apu-config&quot;</span>)
496
- 126: <span class="ruby-keyword kw">end</span>
497
- 127: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">filename</span>)
498
- 128: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
499
- 129: <span class="ruby-keyword kw">else</span>
500
- 130: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
501
- 131: <span class="ruby-keyword kw">end</span>
502
- 132: <span class="ruby-keyword kw">end</span>
503
- 133: <span class="ruby-keyword kw">end</span>
504
- </pre>
505
- </div>
506
- </div>
507
- </div>
508
- <div class="method">
509
- <div class="title">
510
- <a name="M000051"></a><b>apu_flags</b>()
511
- </div>
512
- <div class="description">
513
- <p>
514
- The C compiler flags that are necessary for programs that use APR-Util.
515
- </p>
516
- </div>
517
- <div class="sourcecode">
518
- <p class="source-link">[ <a href="javascript:toggleSource('M000051_source')" id="l_M000051_source">show source</a> ]</p>
519
- <div id="M000051_source" class="dyn-source">
520
- <pre>
521
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 249</span>
522
- 249: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_flags</span>
523
- 250: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apu_info</span>[<span class="ruby-value">0</span>]
524
- 251: <span class="ruby-keyword kw">end</span>
525
- </pre>
526
- </div>
527
- </div>
528
- </div>
529
- <div class="method">
530
- <div class="title">
531
- <a name="M000052"></a><b>apu_libs</b>()
532
- </div>
533
- <div class="description">
534
- <p>
535
- The linker flags that are necessary for linking programs that use APR-Util.
536
- </p>
537
- </div>
538
- <div class="sourcecode">
539
- <p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
540
- <div id="M000052_source" class="dyn-source">
541
- <pre>
542
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 254</span>
543
- 254: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apu_libs</span>
544
- 255: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">determine_apu_info</span>[<span class="ruby-value">1</span>]
545
- 256: <span class="ruby-keyword kw">end</span>
546
- </pre>
547
- </div>
548
- </div>
549
- </div>
550
- <div class="method">
551
- <div class="title">
552
- <a name="M000040"></a><b>apxs2</b>()
553
- </div>
554
- <div class="description">
555
- <p>
556
- The absolute path to the &#8216;apxs&#8217; or &#8216;<a
557
- href="PlatformInfo.html#M000040">apxs2</a>&#8217; executable, or nil if not
558
- found.
559
- </p>
560
- </div>
561
- <div class="sourcecode">
562
- <p class="source-link">[ <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show source</a> ]</p>
563
- <div id="M000040_source" class="dyn-source">
564
- <pre>
565
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 44</span>
566
- 44: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">apxs2</span>
567
- 45: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">&quot;APXS2&quot;</span>)
568
- 46: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;APXS2&quot;</span>]
569
- 47: <span class="ruby-keyword kw">end</span>
570
- 48: [<span class="ruby-value str">'apxs2'</span>, <span class="ruby-value str">'apxs'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
571
- 49: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
572
- 50: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">command</span>.<span class="ruby-identifier">nil?</span>
573
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
574
- 52: <span class="ruby-keyword kw">end</span>
575
- 53: <span class="ruby-keyword kw">end</span>
576
- 54: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
577
- 55: <span class="ruby-keyword kw">end</span>
578
- </pre>
579
- </div>
580
- </div>
581
- </div>
582
- <div class="method">
583
- <div class="title">
584
- <a name="M000068"></a><b>asciidoc</b>()
585
- </div>
586
- <div class="sourcecode">
587
- <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p>
588
- <div id="M000068_source" class="dyn-source">
589
- <pre>
590
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/documentation_tools.rb, line 29</span>
591
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">asciidoc</span>
592
- 30: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'asciidoc'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'mizuho-asciidoc'</span>)
593
- 31: <span class="ruby-keyword kw">end</span>
594
- </pre>
595
- </div>
596
- </div>
597
- </div>
598
- <div class="method">
599
- <div class="title">
600
- <a name="M000057"></a><b>cc</b>()
601
- </div>
602
- <div class="sourcecode">
603
- <p class="source-link">[ <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show source</a> ]</p>
604
- <div id="M000057_source" class="dyn-source">
605
- <pre>
606
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 29</span>
607
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cc</span>
608
- 30: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'CC'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;gcc&quot;</span>
609
- 31: <span class="ruby-keyword kw">end</span>
610
- </pre>
611
- </div>
612
- </div>
613
- </div>
614
- <div class="method">
615
- <div class="title">
616
- <a name="M000059"></a><b>compiler_supports_visibility_flag?</b>()
617
- </div>
618
- <div class="sourcecode">
619
- <p class="source-link">[ <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show source</a> ]</p>
620
- <div id="M000059_source" class="dyn-source">
621
- <pre>
622
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 37</span>
623
- 37: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compiler_supports_visibility_flag?</span>
624
- 38: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:c</span>, <span class="ruby-value str">''</span>, <span class="ruby-value str">'-fvisibility=hidden'</span>)
625
- 39: <span class="ruby-keyword kw">end</span>
626
- </pre>
627
- </div>
628
- </div>
629
- </div>
630
- <div class="method">
631
- <div class="title">
632
- <a name="M000060"></a><b>compiler_visibility_flag_generates_warnings?</b>()
633
- </div>
634
- <div class="description">
635
- <p>
636
- Returns whether compiling C++ with -fvisibility=hidden might result in tons
637
- of useless warnings, like this: <a
638
- href="http://code.google.com/p/phusion-passenger/issues/detail?id=526">code.google.com/p/phusion-passenger/issues/detail?id=526</a>
639
- This appears to be a bug in older g++ versions: <a
640
- href="http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00861.html">gcc.gnu.org/ml/gcc-patches/2006-07/msg00861.html</a>
641
- Warnings should be suppressed with -Wno-attributes.
642
- </p>
643
- </div>
644
- <div class="sourcecode">
645
- <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
646
- <div id="M000060_source" class="dyn-source">
647
- <pre>
648
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 48</span>
649
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">compiler_visibility_flag_generates_warnings?</span>
650
- 49: <span class="ruby-keyword kw">if</span> <span class="ruby-node">`#{cxx} -v 2&gt;&amp;1`</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/gcc version (.*?)/</span>
651
- 50: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">$1</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value str">&quot;4.1.2&quot;</span>
652
- 51: <span class="ruby-keyword kw">else</span>
653
- 52: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
654
- 53: <span class="ruby-keyword kw">end</span>
655
- 54: <span class="ruby-keyword kw">end</span>
656
- </pre>
657
- </div>
658
- </div>
659
- </div>
660
- <div class="method">
661
- <div class="title">
662
- <a name="M000054"></a><b>cpu_architecture</b>()
663
- </div>
664
- <div class="description">
665
- <p>
666
- Returns the host machine&#8216;s CPU architecture. Please note that this
667
- may not be the same as the Ruby interpreter&#8216;s CPU architecture
668
- because the Ruby interpreter may be running on a different architectural
669
- mode than the default one.
670
- </p>
671
- </div>
672
- <div class="sourcecode">
673
- <p class="source-link">[ <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show source</a> ]</p>
674
- <div id="M000054_source" class="dyn-source">
675
- <pre>
676
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/binary_compatibility.rb, line 35</span>
677
- 35: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cpu_architecture</span>
678
- 36: <span class="ruby-identifier">result</span> = <span class="ruby-value">`uname -p`</span>.<span class="ruby-identifier">strip</span>
679
- 37: <span class="ruby-comment cmt"># On some systems 'uname -p' returns something like</span>
680
- 38: <span class="ruby-comment cmt"># 'Intel(R) Pentium(R) M processor 1400MHz'.</span>
681
- 39: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;unknown&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/ /</span>
682
- 40: <span class="ruby-identifier">result</span> = <span class="ruby-value">`uname -m`</span>.<span class="ruby-identifier">strip</span>
683
- 41: <span class="ruby-keyword kw">end</span>
684
- 42: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
685
- 43: <span class="ruby-keyword kw">end</span>
686
- </pre>
687
- </div>
688
- </div>
689
- </div>
690
- <div class="method">
691
- <div class="title">
692
- <a name="M000065"></a><b>curl_flags</b>()
693
- </div>
694
- <div class="sourcecode">
695
- <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p>
696
- <div id="M000065_source" class="dyn-source">
697
- <pre>
698
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/curl.rb, line 29</span>
699
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">curl_flags</span>
700
- 30: <span class="ruby-identifier">result</span> = <span class="ruby-value">`(curl-config --cflags) 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
701
- 31: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
702
- 32: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
703
- 33: <span class="ruby-keyword kw">else</span>
704
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
705
- 35: <span class="ruby-keyword kw">end</span>
706
- 36: <span class="ruby-keyword kw">end</span>
707
- </pre>
708
- </div>
709
- </div>
710
- </div>
711
- <div class="method">
712
- <div class="title">
713
- <a name="M000066"></a><b>curl_libs</b>()
714
- </div>
715
- <div class="sourcecode">
716
- <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p>
717
- <div id="M000066_source" class="dyn-source">
718
- <pre>
719
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/curl.rb, line 39</span>
720
- 39: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">curl_libs</span>
721
- 40: <span class="ruby-identifier">result</span> = <span class="ruby-value">`(curl-config --libs) 2&gt;/dev/null`</span>.<span class="ruby-identifier">strip</span>
722
- 41: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">empty?</span>
723
- 42: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
724
- 43: <span class="ruby-keyword kw">else</span>
725
- 44: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
726
- 45: <span class="ruby-keyword kw">end</span>
727
- 46: <span class="ruby-keyword kw">end</span>
728
- </pre>
729
- </div>
730
- </div>
731
- </div>
732
- <div class="method">
733
- <div class="title">
734
- <a name="M000067"></a><b>curl_supports_ssl?</b>()
735
- </div>
736
- <div class="sourcecode">
737
- <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p>
738
- <div id="M000067_source" class="dyn-source">
739
- <pre>
740
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/curl.rb, line 49</span>
741
- 49: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">curl_supports_ssl?</span>
742
- 50: <span class="ruby-identifier">features</span> = <span class="ruby-value">`(curl-config --features) 2&gt;/dev/null`</span>
743
- 51: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">features</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/SSL/</span>
744
- 52: <span class="ruby-keyword kw">end</span>
745
- </pre>
746
- </div>
747
- </div>
748
- </div>
749
- <div class="method">
750
- <div class="title">
751
- <a name="M000058"></a><b>cxx</b>()
752
- </div>
753
- <div class="sourcecode">
754
- <p class="source-link">[ <a href="javascript:toggleSource('M000058_source')" id="l_M000058_source">show source</a> ]</p>
755
- <div id="M000058_source" class="dyn-source">
756
- <pre>
757
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 33</span>
758
- 33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cxx</span>
759
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'CXX'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;g++&quot;</span>
760
- 35: <span class="ruby-keyword kw">end</span>
761
- </pre>
762
- </div>
763
- </div>
764
- </div>
765
- <div class="method">
766
- <div class="title">
767
- <a name="M000063"></a><b>debugging_cflags</b>()
768
- </div>
769
- <div class="description">
770
- <p>
771
- C compiler flags that should be passed in order to enable debugging
772
- information.
773
- </p>
774
- </div>
775
- <div class="sourcecode">
776
- <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
777
- <div id="M000063_source" class="dyn-source">
778
- <pre>
779
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 135</span>
780
- 135: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">debugging_cflags</span>
781
- 136: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/openbsd/</span>
782
- 137: <span class="ruby-comment cmt"># According to OpenBSD's pthreads man page, pthreads do not work</span>
783
- 138: <span class="ruby-comment cmt"># correctly when an app is compiled with -g. It recommends using</span>
784
- 139: <span class="ruby-comment cmt"># -ggdb instead.</span>
785
- 140: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-ggdb'</span>
786
- 141: <span class="ruby-keyword kw">else</span>
787
- 142: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-g'</span>
788
- 143: <span class="ruby-keyword kw">end</span>
789
- 144: <span class="ruby-keyword kw">end</span>
790
- </pre>
791
- </div>
792
- </div>
793
- </div>
794
- <div class="method">
795
- <div class="title">
796
- <a name="M000039"></a><b>env_defined?</b>(name)
797
- </div>
798
- <div class="sourcecode">
799
- <p class="source-link">[ <a href="javascript:toggleSource('M000039_source')" id="l_M000039_source">show source</a> ]</p>
800
- <div id="M000039_source" class="dyn-source">
801
- <pre>
802
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 155</span>
803
- 155: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">env_defined?</span>(<span class="ruby-identifier">name</span>)
804
- 156: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">ENV</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">empty?</span>
805
- 157: <span class="ruby-keyword kw">end</span>
806
- </pre>
807
- </div>
808
- </div>
809
- </div>
810
- <div class="method">
811
- <div class="title">
812
- <a name="M000064"></a><b>export_dynamic_flags</b>()
813
- </div>
814
- <div class="sourcecode">
815
- <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p>
816
- <div id="M000064_source" class="dyn-source">
817
- <pre>
818
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 146</span>
819
- 146: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">export_dynamic_flags</span>
820
- 147: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/linux/</span>
821
- 148: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-rdynamic'</span>
822
- 149: <span class="ruby-keyword kw">else</span>
823
- 150: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
824
- 151: <span class="ruby-keyword kw">end</span>
825
- 152: <span class="ruby-keyword kw">end</span>
826
- </pre>
827
- </div>
828
- </div>
829
- </div>
830
- <div class="method">
831
- <div class="title">
832
- <a name="M000038"></a><b>find_command</b>(name)
833
- </div>
834
- <div class="description">
835
- <p>
836
- Check whether the specified command is in $PATH, and return its absolute
837
- filename. Returns nil if the command is not found.
838
- </p>
839
- <p>
840
- This function exists because system(&#8216;which&#8217;) doesn&#8216;t
841
- always behave correctly, for some weird reason.
842
- </p>
843
- </div>
844
- <div class="sourcecode">
845
- <p class="source-link">[ <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show source</a> ]</p>
846
- <div id="M000038_source" class="dyn-source">
847
- <pre>
848
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info.rb, line 145</span>
849
- 145: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
850
- 146: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PATH'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">detect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">directory</span><span class="ruby-operator">|</span>
851
- 147: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
852
- 148: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">path</span>)
853
- 149: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span>
854
- 150: <span class="ruby-keyword kw">end</span>
855
- 151: <span class="ruby-keyword kw">end</span>
856
- 152: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
857
- 153: <span class="ruby-keyword kw">end</span>
858
- </pre>
859
- </div>
860
- </div>
861
- </div>
862
- <div class="method">
863
- <div class="title">
864
- <a name="M000075"></a><b>fork_supported?</b>()
865
- </div>
866
- <div class="description">
867
- <p>
868
- Returns whether the Ruby interpreter supports process forking.
869
- </p>
870
- </div>
871
- <div class="sourcecode">
872
- <p class="source-link">[ <a href="javascript:toggleSource('M000075_source')" id="l_M000075_source">show source</a> ]</p>
873
- <div id="M000075_source" class="dyn-source">
874
- <pre>
875
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 79</span>
876
- 79: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fork_supported?</span>
877
- 80: <span class="ruby-comment cmt"># MRI &gt;= 1.9.2's respond_to? returns false for methods</span>
878
- 81: <span class="ruby-comment cmt"># that are not implemented.</span>
879
- 82: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:fork</span>) <span class="ruby-operator">&amp;&amp;</span>
880
- 83: <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;jruby&quot;</span> <span class="ruby-operator">&amp;&amp;</span>
881
- 84: <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;macruby&quot;</span> <span class="ruby-operator">&amp;&amp;</span>
882
- 85: <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'target_os'</span>] <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/mswin|windows|mingw/</span>
883
- 86: <span class="ruby-keyword kw">end</span>
884
- </pre>
885
- </div>
886
- </div>
887
- </div>
888
- <div class="method">
889
- <div class="title">
890
- <a name="M000076"></a><b>gem_command</b>()
891
- </div>
892
- <div class="description">
893
- <p>
894
- Returns the correct &#8216;gem&#8217; command for this Ruby interpreter.
895
- </p>
896
- </div>
897
- <div class="sourcecode">
898
- <p class="source-link">[ <a href="javascript:toggleSource('M000076_source')" id="l_M000076_source">show source</a> ]</p>
899
- <div id="M000076_source" class="dyn-source">
900
- <pre>
901
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 89</span>
902
- 89: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gem_command</span>
903
- 90: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_executable</span>(<span class="ruby-value str">'gem'</span>)
904
- 91: <span class="ruby-keyword kw">end</span>
905
- </pre>
906
- </div>
907
- </div>
908
- </div>
909
- <div class="method">
910
- <div class="title">
911
- <a name="M000042"></a><b>httpd</b>()
912
- </div>
913
- <div class="description">
914
- <p>
915
- The absolute path to the Apache binary (that is, &#8216;<a
916
- href="PlatformInfo.html#M000042">httpd</a>&#8217;, &#8216;httpd2&#8217;,
917
- &#8216;apache&#8217; or &#8216;apache2&#8217;), or nil if not found.
918
- </p>
919
- </div>
920
- <div class="sourcecode">
921
- <p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>
922
- <div id="M000042_source" class="dyn-source">
923
- <pre>
924
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/apache.rb, line 67</span>
925
- 67: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">httpd</span>
926
- 68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env_defined?</span>(<span class="ruby-value str">'HTTPD'</span>)
927
- 69: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HTTPD'</span>]
928
- 70: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">apxs2</span>.<span class="ruby-identifier">nil?</span>
929
- 71: [<span class="ruby-value str">&quot;apache2&quot;</span>, <span class="ruby-value str">&quot;httpd2&quot;</span>, <span class="ruby-value str">&quot;apache&quot;</span>, <span class="ruby-value str">&quot;httpd&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
930
- 72: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-identifier">name</span>)
931
- 73: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">command</span>.<span class="ruby-identifier">nil?</span>
932
- 74: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
933
- 75: <span class="ruby-keyword kw">end</span>
934
- 76: <span class="ruby-keyword kw">end</span>
935
- 77: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
936
- 78: <span class="ruby-keyword kw">else</span>
937
- 79: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">find_apache2_executable</span>(<span class="ruby-node">`#{apxs2} -q TARGET`</span>.<span class="ruby-identifier">strip</span>)
938
- 80: <span class="ruby-keyword kw">end</span>
939
- 81: <span class="ruby-keyword kw">end</span>
940
- </pre>
941
- </div>
942
- </div>
943
- </div>
944
- <div class="method">
945
- <div class="title">
946
- <a name="M000080"></a><b>in_rvm?</b>()
947
- </div>
948
- <div class="description">
949
- <p>
950
- Returns whether the current Ruby interpreter is managed by RVM.
951
- </p>
952
- </div>
953
- <div class="sourcecode">
954
- <p class="source-link">[ <a href="javascript:toggleSource('M000080_source')" id="l_M000080_source">show source</a> ]</p>
955
- <div id="M000080_source" class="dyn-source">
956
- <pre>
957
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 133</span>
958
- 133: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">in_rvm?</span>
959
- 134: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'/.rvm/'</span>)
960
- 135: <span class="ruby-keyword kw">end</span>
961
- </pre>
962
- </div>
963
- </div>
964
- </div>
965
- <div class="method">
966
- <div class="title">
967
- <a name="M000072"></a><b>library_extension</b>()
968
- </div>
969
- <div class="description">
970
- <p>
971
- The current platform&#8216;s shared library extension (&#8216;so&#8217; on
972
- most Unices).
973
- </p>
974
- </div>
975
- <div class="sourcecode">
976
- <p class="source-link">[ <a href="javascript:toggleSource('M000072_source')" id="l_M000072_source">show source</a> ]</p>
977
- <div id="M000072_source" class="dyn-source">
978
- <pre>
979
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/operating_system.rb, line 42</span>
980
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">library_extension</span>
981
- 43: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
982
- 44: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;bundle&quot;</span>
983
- 45: <span class="ruby-keyword kw">else</span>
984
- 46: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;so&quot;</span>
985
- 47: <span class="ruby-keyword kw">end</span>
986
- 48: <span class="ruby-keyword kw">end</span>
987
- </pre>
988
- </div>
989
- </div>
990
- </div>
991
- <div class="method">
992
- <div class="title">
993
- <a name="M000069"></a><b>linux_distro</b>()
994
- </div>
995
- <div class="description">
996
- <p>
997
- An identifier for the current Linux distribution. nil if the operating
998
- system is not Linux.
999
- </p>
1000
- </div>
1001
- <div class="sourcecode">
1002
- <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p>
1003
- <div id="M000069_source" class="dyn-source">
1004
- <pre>
1005
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/linux.rb, line 30</span>
1006
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">linux_distro</span>
1007
- 31: <span class="ruby-identifier">tags</span> = <span class="ruby-identifier">linux_distro_tags</span>
1008
- 32: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tags</span>
1009
- 33: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">first</span>
1010
- 34: <span class="ruby-keyword kw">else</span>
1011
- 35: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1012
- 36: <span class="ruby-keyword kw">end</span>
1013
- 37: <span class="ruby-keyword kw">end</span>
1014
- </pre>
1015
- </div>
1016
- </div>
1017
- </div>
1018
- <div class="method">
1019
- <div class="title">
1020
- <a name="M000070"></a><b>linux_distro_tags</b>()
1021
- </div>
1022
- <div class="description">
1023
- <p>
1024
- Autodetects the current Linux distribution and return a number of
1025
- identifier tags. The first tag identifies the distribution while the other
1026
- tags indicate which distributions it is likely compatible with. Returns nil
1027
- if the operating system is not Linux.
1028
- </p>
1029
- </div>
1030
- <div class="sourcecode">
1031
- <p class="source-link">[ <a href="javascript:toggleSource('M000070_source')" id="l_M000070_source">show source</a> ]</p>
1032
- <div id="M000070_source" class="dyn-source">
1033
- <pre>
1034
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/linux.rb, line 43</span>
1035
- 43: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">linux_distro_tags</span>
1036
- 44: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/linux/</span>
1037
- 45: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1038
- 46: <span class="ruby-keyword kw">end</span>
1039
- 47: <span class="ruby-identifier">lsb_release</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-value str">&quot;/etc/lsb-release&quot;</span>)
1040
- 48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lsb_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Ubuntu/</span>
1041
- 49: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:ubuntu</span>, <span class="ruby-identifier">:debian</span>]
1042
- 50: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/debian_version&quot;</span>)
1043
- 51: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:debian</span>]
1044
- 52: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/redhat-release&quot;</span>)
1045
- 53: <span class="ruby-identifier">redhat_release</span> = <span class="ruby-identifier">read_file</span>(<span class="ruby-value str">&quot;/etc/redhat-release&quot;</span>)
1046
- 54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/CentOS/</span>
1047
- 55: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:centos</span>, <span class="ruby-identifier">:redhat</span>]
1048
- 56: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Fedora/</span>
1049
- 57: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:fedora</span>, <span class="ruby-identifier">:redhat</span>]
1050
- 58: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">redhat_release</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/Mandriva/</span>
1051
- 59: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:mandriva</span>, <span class="ruby-identifier">:redhat</span>]
1052
- 60: <span class="ruby-keyword kw">else</span>
1053
- 61: <span class="ruby-comment cmt"># On official RHEL distros, the content is in the form of</span>
1054
- 62: <span class="ruby-comment cmt"># &quot;Red Hat Enterprise Linux Server release 5.1 (Tikanga)&quot;</span>
1055
- 63: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:rhel</span>, <span class="ruby-identifier">:redhat</span>]
1056
- 64: <span class="ruby-keyword kw">end</span>
1057
- 65: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/suse-release&quot;</span>)
1058
- 66: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:suse</span>]
1059
- 67: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;/etc/gentoo-release&quot;</span>)
1060
- 68: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:gentoo</span>]
1061
- 69: <span class="ruby-keyword kw">else</span>
1062
- 70: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">:unknown</span>]
1063
- 71: <span class="ruby-keyword kw">end</span>
1064
- 72: <span class="ruby-comment cmt"># TODO: Slackware</span>
1065
- 73: <span class="ruby-keyword kw">end</span>
1066
- </pre>
1067
- </div>
1068
- </div>
1069
- </div>
1070
- <div class="method">
1071
- <div class="title">
1072
- <a name="M000084"></a><b>locate_ruby_executable</b>(name)
1073
- </div>
1074
- <div class="description">
1075
- <p>
1076
- Locate a Ruby tool command, e.g. &#8216;gem&#8217;, &#8216;<a
1077
- href="PlatformInfo.html#M000077">rake</a>&#8217;, &#8216;bundle&#8217;,
1078
- etc. Instead of naively looking in $PATH, this function uses a variety of
1079
- search heuristics to find the command that&#8216;s really associated with
1080
- the current Ruby interpreter. It should never locate a command that&#8216;s
1081
- actually associated with a different Ruby interpreter.
1082
- </p>
1083
- </div>
1084
- <div class="sourcecode">
1085
- <p class="source-link">[ <a href="javascript:toggleSource('M000084_source')" id="l_M000084_source">show source</a> ]</p>
1086
- <div id="M000084_source" class="dyn-source">
1087
- <pre>
1088
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 214</span>
1089
- 214: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">locate_ruby_executable</span>(<span class="ruby-identifier">name</span>)
1090
- 215: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span> <span class="ruby-operator">&amp;&amp;</span>
1091
- 216: <span class="ruby-identifier">ruby_command</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r(\A/System/Library/Frameworks/Ruby.framework/Versions/.*?/usr/bin/ruby\Z)</span>
1092
- 217: <span class="ruby-comment cmt"># On OS X we must look for Ruby binaries in /usr/bin.</span>
1093
- 218: <span class="ruby-comment cmt"># RubyGems puts executables (e.g. 'rake') in there, not in</span>
1094
- 219: <span class="ruby-comment cmt"># /System/Libraries/(...)/bin.</span>
1095
- 220: <span class="ruby-identifier">filename</span> = <span class="ruby-node">&quot;/usr/bin/#{name}&quot;</span>
1096
- 221: <span class="ruby-keyword kw">else</span>
1097
- 222: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">ruby_command</span>) <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/#{name}&quot;</span>
1098
- 223: <span class="ruby-keyword kw">end</span>
1099
- 224:
1100
- 225: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">filename</span>)
1101
- 226: <span class="ruby-comment cmt"># RubyGems might put binaries in a directory other</span>
1102
- 227: <span class="ruby-comment cmt"># than Ruby's bindir. Debian packaged RubyGems and</span>
1103
- 228: <span class="ruby-comment cmt"># DebGem packaged RubyGems are the prime examples.</span>
1104
- 229: <span class="ruby-keyword kw">begin</span>
1105
- 230: <span class="ruby-identifier">require</span> <span class="ruby-value str">'rubygems'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Gem</span>)
1106
- 231: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">bindir</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/#{name}&quot;</span>
1107
- 232: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span>
1108
- 233: <span class="ruby-identifier">filename</span> = <span class="ruby-keyword kw">nil</span>
1109
- 234: <span class="ruby-keyword kw">end</span>
1110
- 235: <span class="ruby-keyword kw">end</span>
1111
- 236:
1112
- 237: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">filename</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">filename</span>)
1113
- 238: <span class="ruby-comment cmt"># Looks like it's not in the RubyGems bindir. Search in $PATH, but</span>
1114
- 239: <span class="ruby-comment cmt"># be very careful about this because whatever we find might belong</span>
1115
- 240: <span class="ruby-comment cmt"># to a different Ruby interpreter than the current one.</span>
1116
- 241: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PATH'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span>
1117
- 242: <span class="ruby-identifier">filename</span> = <span class="ruby-node">&quot;#{dir}/#{name}&quot;</span>
1118
- 243: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">filename</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">filename</span>)
1119
- 244: <span class="ruby-identifier">shebang</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'rb'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
1120
- 245: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">readline</span>.<span class="ruby-identifier">strip</span>
1121
- 246: <span class="ruby-keyword kw">end</span>
1122
- 247: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">shebang</span> <span class="ruby-operator">==</span> <span class="ruby-node">&quot;#!#{ruby_command}&quot;</span>
1123
- 248: <span class="ruby-comment cmt"># Looks good.</span>
1124
- 249: <span class="ruby-keyword kw">break</span>
1125
- 250: <span class="ruby-keyword kw">end</span>
1126
- 251: <span class="ruby-keyword kw">end</span>
1127
- 252:
1128
- 253: <span class="ruby-comment cmt"># Not found. Try next path.</span>
1129
- 254: <span class="ruby-identifier">filename</span> = <span class="ruby-keyword kw">nil</span>
1130
- 255: <span class="ruby-keyword kw">end</span>
1131
- 256: <span class="ruby-keyword kw">end</span>
1132
- 257:
1133
- 258: <span class="ruby-identifier">filename</span>
1134
- 259: <span class="ruby-keyword kw">end</span>
1135
- </pre>
1136
- </div>
1137
- </div>
1138
- </div>
1139
- <div class="method">
1140
- <div class="title">
1141
- <a name="M000071"></a><b>os_name</b>()
1142
- </div>
1143
- <div class="description">
1144
- <p>
1145
- Returns the operating system&#8216;s name. This name is in lowercase and
1146
- contains no spaces, and thus is suitable to be used in some kind of ID.
1147
- E.g. &quot;linux&quot;, &quot;macosx&quot;.
1148
- </p>
1149
- </div>
1150
- <div class="sourcecode">
1151
- <p class="source-link">[ <a href="javascript:toggleSource('M000071_source')" id="l_M000071_source">show source</a> ]</p>
1152
- <div id="M000071_source" class="dyn-source">
1153
- <pre>
1154
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/operating_system.rb, line 32</span>
1155
- 32: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">os_name</span>
1156
- 33: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'target_os'</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">sw_vers</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'sw_vers'</span>))
1157
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;macosx&quot;</span>
1158
- 35: <span class="ruby-keyword kw">else</span>
1159
- 36: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">RUBY_PLATFORM</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/.*?-/</span>, <span class="ruby-value str">''</span>)
1160
- 37: <span class="ruby-keyword kw">end</span>
1161
- 38: <span class="ruby-keyword kw">end</span>
1162
- </pre>
1163
- </div>
1164
- </div>
1165
- </div>
1166
- <div class="method">
1167
- <div class="title">
1168
- <a name="M000056"></a><b>passenger_binary_compatibility_id</b>()
1169
- </div>
1170
- <div class="description">
1171
- <p>
1172
- Returns an identifier string that describes the current platform&#8216;s
1173
- binary compatibility with regard to Phusion Passenger binaries, both the
1174
- Ruby extension and the C++ binaries. Two systems with the same binary
1175
- compatibility identifiers are able to run the same Phusion Passenger
1176
- binaries.
1177
- </p>
1178
- <p>
1179
- The the string depends on the following factors:
1180
- </p>
1181
- <ul>
1182
- <li>The Ruby extension binary compatibility identifiers.
1183
-
1184
- </li>
1185
- <li>The operating system name.
1186
-
1187
- </li>
1188
- <li>Operating system runtime identifier. This may include the kernel version,
1189
- libc version, C++ ABI version, etc. Everything that is of interest for
1190
- binary compatibility with Phusion Passenger&#8216;s C++ components.
1191
-
1192
- </li>
1193
- <li>Operating system default runtime architecture. This is not the same as the
1194
- CPU architecture; some CPUs support multiple architectures, e.g. Intel Core
1195
- 2 Duo supports x86 and x86_64. Some operating systems actually support
1196
- multiple runtime architectures: a lot of x86_64 Linux distributions also
1197
- include 32-bit runtimes, and OS X Snow Leopard is x86_64 by default but all
1198
- system libraries also support x86. This component identifies the
1199
- architecture that is used when compiling a binary with the system&#8216;s
1200
- C++ compiler with its default options.
1201
-
1202
- </li>
1203
- </ul>
1204
- </div>
1205
- <div class="sourcecode">
1206
- <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p>
1207
- <div id="M000056_source" class="dyn-source">
1208
- <pre>
1209
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/binary_compatibility.rb, line 117</span>
1210
- 117: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">passenger_binary_compatibility_id</span>
1211
- 118: <span class="ruby-identifier">ruby_engine</span>, <span class="ruby-identifier">ruby_ext_version</span>, <span class="ruby-identifier">ruby_arch</span>, <span class="ruby-identifier">os_name</span> =
1212
- 119: <span class="ruby-identifier">ruby_extension_binary_compatibility_ids</span>
1213
- 120:
1214
- 121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">os_name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;macosx&quot;</span>
1215
- 122: <span class="ruby-comment cmt"># RUBY_PLATFORM gives us the kernel version, but we want</span>
1216
- 123: <span class="ruby-comment cmt"># the OS X version.</span>
1217
- 124: <span class="ruby-identifier">os_version_string</span> = <span class="ruby-value">`sw_vers -productVersion`</span>.<span class="ruby-identifier">strip</span>
1218
- 125: <span class="ruby-comment cmt"># sw_vers returns something like &quot;10.6.2&quot;. We're only</span>
1219
- 126: <span class="ruby-comment cmt"># interested in the first two digits (MAJOR.MINOR) since</span>
1220
- 127: <span class="ruby-comment cmt"># tiny releases tend to be binary compatible with each</span>
1221
- 128: <span class="ruby-comment cmt"># other.</span>
1222
- 129: <span class="ruby-identifier">components</span> = <span class="ruby-identifier">os_version_string</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>)
1223
- 130: <span class="ruby-identifier">os_version</span> = <span class="ruby-node">&quot;#{components[0]}.#{components[1]}&quot;</span>
1224
- 131: <span class="ruby-identifier">os_runtime</span> = <span class="ruby-identifier">os_version</span>
1225
- 132:
1226
- 133: <span class="ruby-identifier">os_arch</span> = <span class="ruby-identifier">cpu_architecture</span>
1227
- 134: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">os_version</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value str">&quot;10.5&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">os_arch</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^i.86$/</span>
1228
- 135: <span class="ruby-comment cmt"># On Snow Leopard, 'uname -m' returns i386 but</span>
1229
- 136: <span class="ruby-comment cmt"># we *know* that everything is x86_64 by default.</span>
1230
- 137: <span class="ruby-identifier">os_arch</span> = <span class="ruby-value str">&quot;x86_64&quot;</span>
1231
- 138: <span class="ruby-keyword kw">end</span>
1232
- 139: <span class="ruby-keyword kw">else</span>
1233
- 140: <span class="ruby-identifier">os_arch</span> = <span class="ruby-identifier">cpu_architecture</span>
1234
- 141:
1235
- 142: <span class="ruby-identifier">cpp</span> = <span class="ruby-identifier">find_command</span>(<span class="ruby-value str">'cpp'</span>)
1236
- 143: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cpp</span>
1237
- 144: <span class="ruby-identifier">macros</span> = <span class="ruby-node">`#{cpp} -dM &lt; /dev/null`</span>
1238
- 145:
1239
- 146: <span class="ruby-comment cmt"># Can be something like &quot;4.3.2&quot;</span>
1240
- 147: <span class="ruby-comment cmt"># or &quot;4.2.1 20070719 (FreeBSD)&quot;</span>
1241
- 148: <span class="ruby-identifier">macros</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/__VERSION__ &quot;(.+)&quot;/</span>
1242
- 149: <span class="ruby-identifier">compiler_version</span> = <span class="ruby-identifier">$1</span>
1243
- 150: <span class="ruby-identifier">compiler_version</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/ .*/</span>, <span class="ruby-value str">''</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_version</span>
1244
- 151:
1245
- 152: <span class="ruby-identifier">macros</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/__GXX_ABI_VERSION (.+)$/</span>
1246
- 153: <span class="ruby-identifier">cxx_abi_version</span> = <span class="ruby-identifier">$1</span>
1247
- 154: <span class="ruby-keyword kw">else</span>
1248
- 155: <span class="ruby-identifier">compiler_version</span> = <span class="ruby-keyword kw">nil</span>
1249
- 156: <span class="ruby-identifier">cxx_abi_version</span> = <span class="ruby-keyword kw">nil</span>
1250
- 157: <span class="ruby-keyword kw">end</span>
1251
- 158:
1252
- 159: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compiler_version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">cxx_abi_version</span>
1253
- 160: <span class="ruby-identifier">os_runtime</span> = <span class="ruby-node">&quot;gcc#{compiler_version}-#{cxx_abi_version}&quot;</span>
1254
- 161: <span class="ruby-keyword kw">else</span>
1255
- 162: <span class="ruby-identifier">os_runtime</span> = [<span class="ruby-identifier">compiler_version</span>, <span class="ruby-identifier">cxx_abi_version</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;-&quot;</span>)
1256
- 163: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">os_runtime</span>.<span class="ruby-identifier">empty?</span>
1257
- 164: <span class="ruby-identifier">os_runtime</span> = <span class="ruby-value">`uname -r`</span>.<span class="ruby-identifier">strip</span>
1258
- 165: <span class="ruby-keyword kw">end</span>
1259
- 166: <span class="ruby-keyword kw">end</span>
1260
- 167: <span class="ruby-keyword kw">end</span>
1261
- 168:
1262
- 169: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ruby_engine</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;jruby&quot;</span>
1263
- 170: <span class="ruby-comment cmt"># For JRuby it's kinda useless to prepend &quot;java&quot; as extension</span>
1264
- 171: <span class="ruby-comment cmt"># architecture because JRuby doesn't allow any other extension</span>
1265
- 172: <span class="ruby-comment cmt"># architecture.</span>
1266
- 173: <span class="ruby-identifier">identifier</span> = <span class="ruby-value str">&quot;&quot;</span>
1267
- 174: <span class="ruby-keyword kw">else</span>
1268
- 175: <span class="ruby-identifier">identifier</span> = <span class="ruby-node">&quot;#{ruby_arch}-&quot;</span>
1269
- 176: <span class="ruby-keyword kw">end</span>
1270
- 177: <span class="ruby-identifier">identifier</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{ruby_engine}#{ruby_ext_version}-&quot;</span>
1271
- 178: <span class="ruby-comment cmt"># If the extension architecture is the same as the OS architecture</span>
1272
- 179: <span class="ruby-comment cmt"># then there's no need to specify it twice.</span>
1273
- 180: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ruby_arch</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">os_arch</span>
1274
- 181: <span class="ruby-identifier">identifier</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{os_arch}-&quot;</span>
1275
- 182: <span class="ruby-keyword kw">end</span>
1276
- 183: <span class="ruby-identifier">identifier</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{os_name}-#{os_runtime}&quot;</span>
1277
- 184: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">identifier</span>
1278
- 185: <span class="ruby-keyword kw">end</span>
1279
- </pre>
1280
- </div>
1281
- </div>
1282
- </div>
1283
- <div class="method">
1284
- <div class="title">
1285
- <a name="M000061"></a><b>portability_cflags</b>()
1286
- </div>
1287
- <div class="description">
1288
- <p>
1289
- Compiler flags that should be used for compiling every C/C++ program, for
1290
- portability reasons. These flags should be specified as last when invoking
1291
- the compiler.
1292
- </p>
1293
- </div>
1294
- <div class="sourcecode">
1295
- <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
1296
- <div id="M000061_source" class="dyn-source">
1297
- <pre>
1298
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 60</span>
1299
- 60: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">portability_cflags</span>
1300
- 61: <span class="ruby-identifier">flags</span> = [<span class="ruby-value str">&quot;-D_REENTRANT -I/usr/local/include&quot;</span>]
1301
- 62:
1302
- 63: <span class="ruby-comment cmt"># Google SparseHash flags.</span>
1303
- 64: <span class="ruby-comment cmt"># Figure out header for hash function object and its namespace.</span>
1304
- 65: <span class="ruby-comment cmt"># Based on stl_hash.m4 and stl_hash_fun.m4 in the Google SparseHash sources.</span>
1305
- 66: <span class="ruby-identifier">hash_namespace</span> = <span class="ruby-keyword kw">nil</span>
1306
- 67: <span class="ruby-identifier">ok</span> = <span class="ruby-keyword kw">false</span>
1307
- 68: [<span class="ruby-value str">'__gnu_cxx'</span>, <span class="ruby-value str">''</span>, <span class="ruby-value str">'std'</span>, <span class="ruby-value str">'stdext'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">namespace</span><span class="ruby-operator">|</span>
1308
- 69: [<span class="ruby-value str">'ext/hash_map'</span>, <span class="ruby-value str">'hash_map'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash_map_header</span><span class="ruby-operator">|</span>
1309
- 70: <span class="ruby-identifier">ok</span> = <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:cxx</span>, <span class="ruby-node">%Q{
1310
- 71: #include &lt;#{hash_map_header}&gt;
1311
- 72: int
1312
- 73: main() {
1313
- 74: #{namespace}::hash_map&lt;int, int&gt; m;
1314
- 75: return 0;
1315
- 76: }
1316
- 77: }</span>)
1317
- 78: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ok</span>
1318
- 79: <span class="ruby-identifier">hash_namespace</span> = <span class="ruby-identifier">namespace</span>
1319
- 80: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-DHASH_NAMESPACE=\&quot;#{namespace}\&quot;&quot;</span>
1320
- 81: <span class="ruby-keyword kw">end</span>
1321
- 82: <span class="ruby-keyword kw">end</span>
1322
- 83: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ok</span>
1323
- 84: <span class="ruby-keyword kw">end</span>
1324
- 85: [<span class="ruby-value str">'ext/hash_fun.h'</span>, <span class="ruby-value str">'functional'</span>, <span class="ruby-value str">'tr1/functional'</span>,
1325
- 86: <span class="ruby-value str">'ext/stl_hash_fun.h'</span>, <span class="ruby-value str">'hash_fun.h'</span>, <span class="ruby-value str">'stl_hash_fun.h'</span>,
1326
- 87: <span class="ruby-value str">'stl/_hash_fun.h'</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hash_function_header</span><span class="ruby-operator">|</span>
1327
- 88: <span class="ruby-identifier">ok</span> = <span class="ruby-identifier">try_compile</span>(<span class="ruby-identifier">:cxx</span>, <span class="ruby-node">%Q{
1328
- 89: #include &lt;#{hash_function_header}&gt;
1329
- 90: int
1330
- 91: main() {
1331
- 92: #{hash_namespace}::hash&lt;int&gt;()(5);
1332
- 93: return 0;
1333
- 94: }
1334
- 95: }</span>)
1335
- 96: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ok</span>
1336
- 97: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-DHASH_FUN_H=\&quot;&lt;#{hash_function_header}&gt;\&quot;&quot;</span>
1337
- 98: <span class="ruby-keyword kw">break</span>
1338
- 99: <span class="ruby-keyword kw">end</span>
1339
- 100: <span class="ruby-keyword kw">end</span>
1340
- 101:
1341
- 102: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span>
1342
- 103: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-pthreads'</span>
1343
- 104: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'</span>
1344
- 105: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_HAS_STDINT_H'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris2.9/</span>
1345
- 106: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris2.9/</span>
1346
- 107: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-mcpu=ultrasparc'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/sparc/</span>
1347
- 108: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/openbsd/</span>
1348
- 109: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_HAS_STDINT_H -D_GLIBCPP__PTHREADS'</span>
1349
- 110: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/aix/</span>
1350
- 111: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DOXT_DISABLE_BACKTRACES'</span>
1351
- 112: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(sparc-linux|arm-linux|^arm.*-linux|sh4-linux)/</span>
1352
- 113: <span class="ruby-comment cmt"># http://code.google.com/p/phusion-passenger/issues/detail?id=200</span>
1353
- 114: <span class="ruby-comment cmt"># http://groups.google.com/group/phusion-passenger/t/6b904a962ee28e5c</span>
1354
- 115: <span class="ruby-comment cmt"># http://groups.google.com/group/phusion-passenger/browse_thread/thread/aad4bd9d8d200561</span>
1355
- 116: <span class="ruby-identifier">flags</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'-DBOOST_SP_USE_PTHREADS'</span>
1356
- 117: <span class="ruby-keyword kw">end</span>
1357
- 118: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot; &quot;</span>).<span class="ruby-identifier">strip</span>
1358
- 119: <span class="ruby-keyword kw">end</span>
1359
- </pre>
1360
- </div>
1361
- </div>
1362
- </div>
1363
- <div class="method">
1364
- <div class="title">
1365
- <a name="M000062"></a><b>portability_ldflags</b>()
1366
- </div>
1367
- <div class="description">
1368
- <p>
1369
- Linker flags that should be used for linking every C/C++ program, for
1370
- portability reasons. These flags should be specified as last when invoking
1371
- the linker.
1372
- </p>
1373
- </div>
1374
- <div class="sourcecode">
1375
- <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
1376
- <div id="M000062_source" class="dyn-source">
1377
- <pre>
1378
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/compiler.rb, line 125</span>
1379
- 125: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">portability_ldflags</span>
1380
- 126: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/solaris/</span>
1381
- 127: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lxnet -lrt -lsocket -lnsl -lpthread'</span>
1382
- 128: <span class="ruby-keyword kw">else</span>
1383
- 129: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lpthread'</span>
1384
- 130: <span class="ruby-keyword kw">end</span>
1385
- 131: <span class="ruby-keyword kw">end</span>
1386
- </pre>
1387
- </div>
1388
- </div>
1389
- </div>
1390
- <div class="method">
1391
- <div class="title">
1392
- <a name="M000077"></a><b>rake</b>()
1393
- </div>
1394
- <div class="description">
1395
- <p>
1396
- Returns the absolute path to the Rake executable that belongs to the
1397
- current Ruby interpreter. Returns nil if it doesn&#8216;t exist.
1398
- </p>
1399
- <p>
1400
- The return value may not be the actual correct invocation for Rake. Use <a
1401
- href="PlatformInfo.html#M000078">rake_command</a> for that.
1402
- </p>
1403
- </div>
1404
- <div class="sourcecode">
1405
- <p class="source-link">[ <a href="javascript:toggleSource('M000077_source')" id="l_M000077_source">show source</a> ]</p>
1406
- <div id="M000077_source" class="dyn-source">
1407
- <pre>
1408
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 100</span>
1409
- 100: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rake</span>
1410
- 101: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_executable</span>(<span class="ruby-value str">'rake'</span>)
1411
- 102: <span class="ruby-keyword kw">end</span>
1412
- </pre>
1413
- </div>
1414
- </div>
1415
- </div>
1416
- <div class="method">
1417
- <div class="title">
1418
- <a name="M000078"></a><b>rake_command</b>()
1419
- </div>
1420
- <div class="description">
1421
- <p>
1422
- Returns the correct command string for invoking the Rake executable that
1423
- belongs to the current Ruby interpreter. Returns nil if Rake is not found.
1424
- </p>
1425
- </div>
1426
- <div class="sourcecode">
1427
- <p class="source-link">[ <a href="javascript:toggleSource('M000078_source')" id="l_M000078_source">show source</a> ]</p>
1428
- <div id="M000078_source" class="dyn-source">
1429
- <pre>
1430
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 108</span>
1431
- 108: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rake_command</span>
1432
- 109: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">rake</span>
1433
- 110: <span class="ruby-comment cmt"># If the Rake executable is a Ruby program then we need to run</span>
1434
- 111: <span class="ruby-comment cmt"># it in the correct Ruby interpreter just in case Rake doesn't</span>
1435
- 112: <span class="ruby-comment cmt"># have the correct shebang line; we don't want a totally different</span>
1436
- 113: <span class="ruby-comment cmt"># Ruby than the current one to be invoked.</span>
1437
- 114: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">is_ruby_program?</span>(<span class="ruby-identifier">filename</span>)
1438
- 115: <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{ruby_command} #{filename}&quot;</span>
1439
- 116: <span class="ruby-keyword kw">else</span>
1440
- 117: <span class="ruby-comment cmt"># If it's not a Ruby program then it's probably a wrapper</span>
1441
- 118: <span class="ruby-comment cmt"># script as is the case with e.g. RVM (~/.rvm/wrappers).</span>
1442
- 119: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">filename</span>
1443
- 120: <span class="ruby-keyword kw">end</span>
1444
- 121: <span class="ruby-keyword kw">end</span>
1445
- </pre>
1446
- </div>
1447
- </div>
1448
- </div>
1449
- <div class="method">
1450
- <div class="title">
1451
- <a name="M000079"></a><b>rspec</b>()
1452
- </div>
1453
- <div class="description">
1454
- <p>
1455
- Returns the absolute path to the RSpec runner program that belongs to the
1456
- current Ruby interpreter. Returns nil if it doesn&#8216;t exist.
1457
- </p>
1458
- </div>
1459
- <div class="sourcecode">
1460
- <p class="source-link">[ <a href="javascript:toggleSource('M000079_source')" id="l_M000079_source">show source</a> ]</p>
1461
- <div id="M000079_source" class="dyn-source">
1462
- <pre>
1463
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 127</span>
1464
- 127: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rspec</span>
1465
- 128: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">locate_ruby_executable</span>(<span class="ruby-value str">'spec'</span>)
1466
- 129: <span class="ruby-keyword kw">end</span>
1467
- </pre>
1468
- </div>
1469
- </div>
1470
- </div>
1471
- <div class="method">
1472
- <div class="title">
1473
- <a name="M000073"></a><b>ruby_command</b>()
1474
- </div>
1475
- <div class="description">
1476
- <p>
1477
- Returns correct command for invoking the current Ruby interpreter. In case
1478
- of RVM this function will return the path to the RVM wrapper script that
1479
- executes the current Ruby interpreter in the currently active gem set.
1480
- </p>
1481
- </div>
1482
- <div class="sourcecode">
1483
- <p class="source-link">[ <a href="javascript:toggleSource('M000073_source')" id="l_M000073_source">show source</a> ]</p>
1484
- <div id="M000073_source" class="dyn-source">
1485
- <pre>
1486
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 48</span>
1487
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_command</span>
1488
- 49: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1489
- 50: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">rvm_ruby_string</span>
1490
- 51: <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">rvm_path</span>
1491
- 52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">dir</span>
1492
- 53: <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{dir}/wrappers/#{name}/ruby&quot;</span>
1493
- 54: <span class="ruby-keyword kw">else</span>
1494
- 55: <span class="ruby-comment cmt"># Something's wrong with the user's RVM installation.</span>
1495
- 56: <span class="ruby-comment cmt"># Raise an error so that the user knows this instead of</span>
1496
- 57: <span class="ruby-comment cmt"># having things fail randomly later on.</span>
1497
- 58: <span class="ruby-comment cmt"># 'name' is guaranteed to be non-nil because rvm_ruby_string</span>
1498
- 59: <span class="ruby-comment cmt"># already raises an exception on error.</span>
1499
- 60: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Your RVM installation appears to be broken: the RVM &quot;</span> <span class="ruby-operator">+</span>
1500
- 61: <span class="ruby-value str">&quot;path cannot be found. Please fix your RVM installation &quot;</span> <span class="ruby-operator">+</span>
1501
- 62: <span class="ruby-value str">&quot;or contact the RVM developers for support.&quot;</span>
1502
- 63: <span class="ruby-keyword kw">end</span>
1503
- 64: <span class="ruby-keyword kw">else</span>
1504
- 65: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ruby_executable</span>
1505
- 66: <span class="ruby-keyword kw">end</span>
1506
- 67: <span class="ruby-keyword kw">end</span>
1507
- </pre>
1508
- </div>
1509
- </div>
1510
- </div>
1511
- <div class="method">
1512
- <div class="title">
1513
- <a name="M000074"></a><b>ruby_executable</b>()
1514
- </div>
1515
- <div class="description">
1516
- <p>
1517
- Returns the full path to the current Ruby interpreter&#8216;s executable
1518
- file. This might not be the actual correct command to use for invoking the
1519
- Ruby interpreter; use <a href="PlatformInfo.html#M000073">ruby_command</a>
1520
- instead.
1521
- </p>
1522
- </div>
1523
- <div class="sourcecode">
1524
- <p class="source-link">[ <a href="javascript:toggleSource('M000074_source')" id="l_M000074_source">show source</a> ]</p>
1525
- <div id="M000074_source" class="dyn-source">
1526
- <pre>
1527
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 73</span>
1528
- 73: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_executable</span>
1529
- 74: <span class="ruby-ivar">@@ruby_executable</span> <span class="ruby-operator">||=</span>
1530
- 75: <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'RUBY_INSTALL_NAME'</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'EXEEXT'</span>]
1531
- 76: <span class="ruby-keyword kw">end</span>
1532
- </pre>
1533
- </div>
1534
- </div>
1535
- </div>
1536
- <div class="method">
1537
- <div class="title">
1538
- <a name="M000055"></a><b>ruby_extension_binary_compatibility_ids</b>()
1539
- </div>
1540
- <div class="description">
1541
- <p>
1542
- Returns an array of identifiers that describe the current Ruby
1543
- interpreter&#8216;s extension binary compatibility. A Ruby extension
1544
- compiled for a certain Ruby interpreter can also be loaded on a different
1545
- Ruby interpreter with the same binary compatibility identifiers.
1546
- </p>
1547
- <p>
1548
- The identifiers depend on the following factors:
1549
- </p>
1550
- <ul>
1551
- <li>Ruby engine name.
1552
-
1553
- </li>
1554
- <li>Ruby extension version. This is not the same as the Ruby language version,
1555
- which identifies language-level compatibility. This is rather about binary
1556
- compatibility of extensions. MRI seems to break source compatibility
1557
- between tiny releases, though patchlevel releases tend to be source and
1558
- binary compatible.
1559
-
1560
- </li>
1561
- <li>Ruby extension architecture. This is not necessarily the same as the
1562
- operating system runtime architecture or the CPU architecture. For example,
1563
- in case of JRuby, the extension architecture is just &quot;java&quot;
1564
- because all extensions target the Java platform; the architecture the JVM
1565
- was compiled for has no effect on compatibility. On systems with universal
1566
- binaries support there may be multiple architectures. In this case the
1567
- architecture is &quot;universal&quot; because extensions must be able to
1568
- support all of the Ruby executable&#8216;s architectures.
1569
-
1570
- </li>
1571
- <li>The operating system for which the Ruby interpreter was compiled.
1572
-
1573
- </li>
1574
- </ul>
1575
- </div>
1576
- <div class="sourcecode">
1577
- <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
1578
- <div id="M000055_source" class="dyn-source">
1579
- <pre>
1580
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/binary_compatibility.rb, line 73</span>
1581
- 73: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_extension_binary_compatibility_ids</span>
1582
- 74: <span class="ruby-identifier">ruby_engine</span> = <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">RUBY_ENGINE</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">RUBY_ENGINE</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;ruby&quot;</span>
1583
- 75: <span class="ruby-identifier">ruby_ext_version</span> = <span class="ruby-constant">RUBY_VERSION</span>
1584
- 76: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/darwin/</span>
1585
- 77: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/universal/</span>
1586
- 78: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-value str">&quot;universal&quot;</span>
1587
- 79: <span class="ruby-keyword kw">else</span>
1588
- 80: <span class="ruby-comment cmt"># Something like:</span>
1589
- 81: <span class="ruby-comment cmt"># &quot;/opt/ruby-enterprise/bin/ruby: Mach-O 64-bit executable x86_64&quot;</span>
1590
- 82: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-node">`file -L &quot;#{ruby_executable}&quot;`</span>.<span class="ruby-identifier">strip</span>
1591
- 83: <span class="ruby-identifier">ruby_arch</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/.* /</span>, <span class="ruby-value str">''</span>)
1592
- 84: <span class="ruby-keyword kw">end</span>
1593
- 85: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;java&quot;</span>
1594
- 86: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-value str">&quot;java&quot;</span>
1595
- 87: <span class="ruby-keyword kw">else</span>
1596
- 88: <span class="ruby-identifier">ruby_arch</span> = <span class="ruby-identifier">cpu_architecture</span>
1597
- 89: <span class="ruby-keyword kw">end</span>
1598
- 90: <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">ruby_engine</span>, <span class="ruby-identifier">ruby_ext_version</span>, <span class="ruby-identifier">ruby_arch</span>, <span class="ruby-identifier">os_name</span>]
1599
- 91: <span class="ruby-keyword kw">end</span>
1600
- </pre>
1601
- </div>
1602
- </div>
1603
- </div>
1604
- <div class="method">
1605
- <div class="title">
1606
- <a name="M000083"></a><b>ruby_sudo_command</b>()
1607
- </div>
1608
- <div class="description">
1609
- <p>
1610
- Returns either &#8216;sudo&#8217; or &#8216;rvmsudo&#8217; depending on
1611
- whether the current Ruby interpreter is managed by RVM.
1612
- </p>
1613
- </div>
1614
- <div class="sourcecode">
1615
- <p class="source-link">[ <a href="javascript:toggleSource('M000083_source')" id="l_M000083_source">show source</a> ]</p>
1616
- <div id="M000083_source" class="dyn-source">
1617
- <pre>
1618
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 201</span>
1619
- 201: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_sudo_command</span>
1620
- 202: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1621
- 203: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;rvmsudo&quot;</span>
1622
- 204: <span class="ruby-keyword kw">else</span>
1623
- 205: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;sudo&quot;</span>
1624
- 206: <span class="ruby-keyword kw">end</span>
1625
- 207: <span class="ruby-keyword kw">end</span>
1626
- </pre>
1627
- </div>
1628
- </div>
1629
- </div>
1630
- <div class="method">
1631
- <div class="title">
1632
- <a name="M000081"></a><b>rvm_path</b>()
1633
- </div>
1634
- <div class="description">
1635
- <p>
1636
- If the current Ruby interpreter is managed by RVM, returns the directory in
1637
- which RVM places its working files. Otherwise returns nil.
1638
- </p>
1639
- </div>
1640
- <div class="sourcecode">
1641
- <p class="source-link">[ <a href="javascript:toggleSource('M000081_source')" id="l_M000081_source">show source</a> ]</p>
1642
- <div id="M000081_source" class="dyn-source">
1643
- <pre>
1644
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 140</span>
1645
- 140: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rvm_path</span>
1646
- 141: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1647
- 142: [<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'rvm_path'</span>], <span class="ruby-value str">&quot;~/.rvm&quot;</span>, <span class="ruby-value str">&quot;/usr/local/rvm&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
1648
- 143: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">nil?</span>
1649
- 144: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
1650
- 145: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>)
1651
- 146: <span class="ruby-keyword kw">end</span>
1652
- 147: <span class="ruby-keyword kw">end</span>
1653
- 148: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1654
- 149: <span class="ruby-keyword kw">end</span>
1655
- </pre>
1656
- </div>
1657
- </div>
1658
- </div>
1659
- <div class="method">
1660
- <div class="title">
1661
- <a name="M000082"></a><b>rvm_ruby_string</b>()
1662
- </div>
1663
- <div class="description">
1664
- <p>
1665
- If the current Ruby interpreter is managed by RVM, returns the RVM name
1666
- which identifies the current Ruby interpreter plus the currently active
1667
- gemset, e.g. something like this: &quot;ruby-1.9.2-p0@mygemset&quot;
1668
- </p>
1669
- <p>
1670
- Returns nil otherwise.
1671
- </p>
1672
- </div>
1673
- <div class="sourcecode">
1674
- <p class="source-link">[ <a href="javascript:toggleSource('M000082_source')" id="l_M000082_source">show source</a> ]</p>
1675
- <div id="M000082_source" class="dyn-source">
1676
- <pre>
1677
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/ruby.rb, line 158</span>
1678
- 158: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rvm_ruby_string</span>
1679
- 159: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_rvm?</span>
1680
- 160: <span class="ruby-comment cmt"># RVM used to export the necessary information through</span>
1681
- 161: <span class="ruby-comment cmt"># environment variables, but doesn't always do that anymore</span>
1682
- 162: <span class="ruby-comment cmt"># in the latest versions in order to fight env var pollution.</span>
1683
- 163: <span class="ruby-comment cmt"># Scanning $LOAD_PATH seems to be the only way to obtain</span>
1684
- 164: <span class="ruby-comment cmt"># the information.</span>
1685
- 165:
1686
- 166: <span class="ruby-comment cmt"># Getting the RVM name of the Ruby interpreter (&quot;ruby-1.9.2&quot;)</span>
1687
- 167: <span class="ruby-comment cmt"># isn't so hard, we can extract it from the #ruby_executable</span>
1688
- 168: <span class="ruby-comment cmt"># string. Getting the gemset name is a bit harder, so let's</span>
1689
- 169: <span class="ruby-comment cmt"># try various strategies...</span>
1690
- 170:
1691
- 171: <span class="ruby-comment cmt"># $GEM_HOME usually contains the gem set name.</span>
1692
- 172: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">GEM_HOME</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">GEM_HOME</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;rvm/gems/&quot;</span>)
1693
- 173: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-constant">GEM_HOME</span>)
1694
- 174: <span class="ruby-keyword kw">end</span>
1695
- 175:
1696
- 176: <span class="ruby-comment cmt"># User somehow managed to nuke $GEM_HOME. Extract info</span>
1697
- 177: <span class="ruby-comment cmt"># from $LOAD_PATH.</span>
1698
- 178: <span class="ruby-identifier">matching_path</span> = <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
1699
- 179: <span class="ruby-identifier">item</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;rvm/gems/&quot;</span>)
1700
- 180: <span class="ruby-keyword kw">end</span>
1701
- 181: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matching_path</span>
1702
- 182: <span class="ruby-identifier">subpath</span> = <span class="ruby-identifier">matching_path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^.*rvm\/gems\//</span>, <span class="ruby-value str">''</span>)
1703
- 183: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">subpath</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>).<span class="ruby-identifier">first</span>
1704
- 184: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>
1705
- 185: <span class="ruby-keyword kw">end</span>
1706
- 186:
1707
- 187: <span class="ruby-comment cmt"># On Ruby 1.9, $LOAD_PATH does not contain any gem paths until</span>
1708
- 188: <span class="ruby-comment cmt"># at least one gem has been required so the above can fail.</span>
1709
- 189: <span class="ruby-comment cmt"># We're out of options now, we can't detect the gem set.</span>
1710
- 190: <span class="ruby-comment cmt"># Raise an exception so that the user knows what's going on</span>
1711
- 191: <span class="ruby-comment cmt"># instead of having things fail in obscure ways later.</span>
1712
- 192: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unable to autodetect the currently active RVM gem &quot;</span> <span class="ruby-operator">+</span>
1713
- 193: <span class="ruby-value str">&quot;set name. Please contact this program's author for support.&quot;</span>
1714
- 194: <span class="ruby-keyword kw">end</span>
1715
- 195: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1716
- 196: <span class="ruby-keyword kw">end</span>
1717
- </pre>
1718
- </div>
1719
- </div>
1720
- </div>
1721
- <div class="method">
1722
- <div class="title">
1723
- <a name="M000085"></a><b>zlib_flags</b>()
1724
- </div>
1725
- <div class="sourcecode">
1726
- <p class="source-link">[ <a href="javascript:toggleSource('M000085_source')" id="l_M000085_source">show source</a> ]</p>
1727
- <div id="M000085_source" class="dyn-source">
1728
- <pre>
1729
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/zlib.rb, line 29</span>
1730
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zlib_flags</span>
1731
- 30: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1732
- 31: <span class="ruby-keyword kw">end</span>
1733
- </pre>
1734
- </div>
1735
- </div>
1736
- </div>
1737
- <div class="method">
1738
- <div class="title">
1739
- <a name="M000086"></a><b>zlib_libs</b>()
1740
- </div>
1741
- <div class="sourcecode">
1742
- <p class="source-link">[ <a href="javascript:toggleSource('M000086_source')" id="l_M000086_source">show source</a> ]</p>
1743
- <div id="M000086_source" class="dyn-source">
1744
- <pre>
1745
- <span class="ruby-comment cmt"># File lib/phusion_passenger/platform_info/zlib.rb, line 33</span>
1746
- 33: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">zlib_libs</span>
1747
- 34: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'-lz'</span>
1748
- 35: <span class="ruby-keyword kw">end</span>
1749
- </pre>
1750
- </div>
1751
- </div>
1752
- </div>
1753
- </div>
1754
-
1755
- </div>
1756
-
1757
- </body>
1758
- </html>