Module: Drakkon::PlatformCompat
Overview
Helper to provide platform compatibility
Instance Method Summary collapse
Instance Method Details
#build_env ⇒ Object
10 11 12 |
# File 'lib/drakkon/lib/platform_compat.rb', line 10 def build_env run_env # not sure if these will ever be different end |
#path_divider ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/drakkon/lib/platform_compat.rb', line 18 def path_divider if windows? ';' # Linux uses ':' (same with mac/unix?) else ':' end end |
#run_env ⇒ Object
4 5 6 7 8 |
# File 'lib/drakkon/lib/platform_compat.rb', line 4 def run_env { 'PATH' => "#{version_dir}#{path_divider}#{ENV.fetch('PATH', nil)}" } end |
#windows? ⇒ Boolean
14 15 16 |
# File 'lib/drakkon/lib/platform_compat.rb', line 14 def windows? (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil end |