Module: AssLauncher::Support::Platforms
- Included in:
- Enterprise, Enterprise::BinaryWrapper, Enterprise::Cli::Parameters::Path, Enterprise::Cli::Parameters::PathTwice, Enterprise::Ole::OleBinaries::AbstractAssOleBinary, Linux, Shell, Shell::AssOutFile, Shell::ProcessHolder, Shell::Script
- Defined in:
- lib/ass_launcher/support/platforms.rb
Overview
OS-specific things Mixin module help work with things as paths and env in other plases
Defined Under Namespace
Classes: CygEnv, PathnameExt, UnixEnv, WinEnv
Class Method Summary collapse
-
.cygwin? ⇒ Boolean
True if run in Cygwin.
-
.env ⇒ UnixEnv | WinEnv | CygEnv
Return suitable class.
-
.glob(p1, *args) ⇒ Array<PathnameExt>
Override (Pathname.glob) method for correct work with windows paths like a ‘\\host\share’, ‘C:\’ and Cygwin paths like a ‘/cygdrive/c’.
-
.linux? ⇒ Boolean
True if run in Linux.
-
.path(string) ⇒ UnixPath | WinPath | CygPath
Return suitable class instance.
-
.path_class ⇒ UnixPath | WinPath | CygPath
Return suitable class.
-
.windows? ⇒ Boolean
True if run in MinGW.
Class Method Details
.cygwin? ⇒ Boolean
True if run in Cygwin
84 85 86 |
# File 'lib/ass_launcher/support/platforms.rb', line 84 def cygwin? Platform.cygwin? end |
.env ⇒ UnixEnv | WinEnv | CygEnv
Return suitable class
241 242 243 244 245 246 247 248 249 |
# File 'lib/ass_launcher/support/platforms.rb', line 241 def self.env if cygwin? CygEnv elsif windows? WinEnv else UnixEnv end end |
.glob(p1, *args) ⇒ Array<PathnameExt>
Override (Pathname.glob) method for correct work with windows paths like a ‘\\host\share’, ‘C:\’ and Cygwin paths like a ‘/cygdrive/c’
129 130 131 |
# File 'lib/ass_launcher/support/platforms.rb', line 129 def self.glob(p1, *args) path_class.glob(p1, *args) end |
.linux? ⇒ Boolean
True if run in Linux
96 97 98 |
# File 'lib/ass_launcher/support/platforms.rb', line 96 def linux? Platform.linux? end |
.path(string) ⇒ UnixPath | WinPath | CygPath
Return suitable class instance
124 125 126 |
# File 'lib/ass_launcher/support/platforms.rb', line 124 def self.path(string) path_class.new(string) end |
.path_class ⇒ UnixPath | WinPath | CygPath
Return suitable class
112 113 114 115 116 117 118 119 120 |
# File 'lib/ass_launcher/support/platforms.rb', line 112 def self.path_class if cygwin? PathnameExt::CygPath elsif windows? PathnameExt::WinPath else PathnameExt::UnixPath end end |