Sha256: 2954f98b493993e801963b2d02fe3aa9e4ffc35e52b97183d20e06119e021591

Contents?: true

Size: 355 Bytes

Versions: 2

Compression:

Stored size: 355 Bytes

Contents

class Exercism
  class Env
    def self.home
      if windows_nt?
        ENV["HOMEDRIVE"] + ENV["HOMEPATH"]
      elsif ruby18?
        File.expand_path('~')
      else
        Dir.home(Etc.getlogin)
      end
    end

    def self.windows_nt?
      ENV["OS"] == 'Windows_NT'
    end

    def self.ruby18?
      RUBY_VERSION == '1.8.7'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exercism-0.0.20 lib/exercism/env.rb
exercism-0.0.19 lib/exercism/env.rb