Module: Mclone
- Defined in:
- lib/mclone.rb
Defined Under Namespace
Modules: Refinements Classes: Error, ObjectSet, Session, Task, TaskSet, Volume, VolumeSet
Constant Summary collapse
- VERSION =
'0.2.0'
- UNIX_SYSTEM_MOUNTS =
Match OS-specific system mount points (/dev /proc etc.) which normally should be omitted when scanning for Mclone voulmes
%r!^/(dev|sys|proc|run)!
- PATH_LIST_SEPARATOR =
TODO handle Windows variants Specify OS-specific path name list separator (such as in the $PATH environment variable)
windows? ? ';' : ':'
Class Method Summary collapse
-
.environment_mounts ⇒ Object
Return list of live user-provided mounts (mount points on *NIX and disk drives on Windows) which may contain Mclone volumes Look for the $MCLONE_PATH environment variable.
- .rclone ⇒ Object
-
.windows? ⇒ Boolean
Return true if run in the real Windows environment (e.g. not in real *NIX or various emulation layers such as MSYS, Cygwin etc.).
Class Method Details
.environment_mounts ⇒ Object
Return list of live user-provided mounts (mount points on *NIX and disk drives on Windows) which may contain Mclone volumes Look for the $MCLONE_PATH environment variable
702 703 704 |
# File 'lib/mclone.rb', line 702 def self.environment_mounts ENV['MCLONE_PATH'].split(PATH_LIST_SEPARATOR).collect { |path| File.directory?(path) ? path : nil }.compact rescue [] end |
.rclone ⇒ Object
684 685 686 |
# File 'lib/mclone.rb', line 684 def self.rclone @@rclone ||= (rclone = ENV['RCLONE']).nil? ? 'rclone' : rclone end |
.windows? ⇒ Boolean
Return true if run in the real Windows environment (e.g. not in real *NIX or various emulation layers such as MSYS, Cygwin etc.)
689 690 691 |
# File 'lib/mclone.rb', line 689 def self.windows? @@windows ||= /^(mingw)/.match?(RbConfig::CONFIG['target_os']) # RubyInstaller's MRI, other MinGW-build MRI end |