Module: OsUtil
- Defined in:
- lib/osutil.rb
Class Method Summary collapse
- .ftp_download_dir(version) ⇒ Object
- .linux? ⇒ Boolean
- .osx? ⇒ Boolean
- .p4_executable ⇒ Object
- .p4_path ⇒ Object
- .p4api_file ⇒ Object
- .p4api_path ⇒ Object
- .p4d_executable ⇒ Object
- .p4d_path ⇒ Object
- .platform_dir_prefix ⇒ Object
- .windows? ⇒ Boolean
Class Method Details
.ftp_download_dir(version) ⇒ Object
54 55 56 |
# File 'lib/osutil.rb', line 54 def OsUtil.ftp_download_dir(version) "perforce/#{version}/bin.#{platform_dir_prefix}#{RbConfig::CONFIG['build_cpu']}" end |
.linux? ⇒ Boolean
38 39 40 |
# File 'lib/osutil.rb', line 38 def OsUtil::linux? RbConfig::CONFIG['host_os'] =~ /linux/ end |
.osx? ⇒ Boolean
30 31 32 |
# File 'lib/osutil.rb', line 30 def OsUtil.osx? RbConfig::CONFIG['host_os'] =~ /darwin/ end |
.p4_executable ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/osutil.rb', line 18 def OsUtil.p4_executable if windows? 'p4.exe' else 'p4' end end |
.p4_path ⇒ Object
26 27 28 |
# File 'lib/osutil.rb', line 26 def OsUtil.p4_path File.(File.join(Conventions.working_dir, OsUtil.p4_executable)) end |
.p4api_file ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'lib/osutil.rb', line 58 def OsUtil.p4api_file if windows? raise 'hey you need a visual studio version defined somehow' 'p4api.zip' else 'p4api.tgz' end end |
.p4api_path ⇒ Object
67 68 69 |
# File 'lib/osutil.rb', line 67 def OsUtil.p4api_path File.(File.join(Conventions.working_dir, OsUtil.p4api_file)) end |
.p4d_executable ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/osutil.rb', line 6 def OsUtil.p4d_executable if windows? 'p4d.exe' else 'p4d' end end |
.p4d_path ⇒ Object
14 15 16 |
# File 'lib/osutil.rb', line 14 def OsUtil.p4d_path File.(File.join(Conventions.working_dir, OsUtil.p4d_executable)) end |
.platform_dir_prefix ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/osutil.rb', line 42 def OsUtil.platform_dir_prefix if osx? 'darwin90' elsif windows? 'nt' elsif linux? 'linux26' else raise "OsUtil doesn't know platform: #{RbConfig::CONFIG['host_os']}" end end |
.windows? ⇒ Boolean
34 35 36 |
# File 'lib/osutil.rb', line 34 def OsUtil.windows? RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ end |