Class: Exercism::Env
- Inherits:
-
Object
- Object
- Exercism::Env
- Defined in:
- lib/exercism/env.rb
Class Method Summary collapse
Class Method Details
.home ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/exercism/env.rb', line 3 def self.home if windows_nt? ENV["HOMEDRIVE"] + ENV["HOMEPATH"] elsif ruby18? || ruby191? File.('~') else Dir.home(Etc.getlogin) end end |
.ruby18? ⇒ Boolean
17 18 19 |
# File 'lib/exercism/env.rb', line 17 def self.ruby18? RUBY_VERSION == '1.8.7' end |
.ruby191? ⇒ Boolean
21 22 23 |
# File 'lib/exercism/env.rb', line 21 def self.ruby191? RUBY_VERSION == '1.9.1' end |
.windows_nt? ⇒ Boolean
13 14 15 |
# File 'lib/exercism/env.rb', line 13 def self.windows_nt? ENV["OS"] == 'Windows_NT' end |