Sha256: c5659e954c49a385df65995cc82b5896188203732eb1a4122c114f94f469d2a2

Contents?: true

Size: 434 Bytes

Versions: 8

Compression:

Stored size: 434 Bytes

Contents

class Exercism
  class Env
    def self.home
      if windows_nt?
        ENV["HOMEDRIVE"] + ENV["HOMEPATH"]
      elsif ruby18? || ruby191?
        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
    
    def self.ruby191?
      RUBY_VERSION == '1.9.1'  
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
exercism-0.0.28 lib/exercism/env.rb
exercism-0.0.27 lib/exercism/env.rb
exercism-0.0.26 lib/exercism/env.rb
exercism-0.0.25 lib/exercism/env.rb
exercism-0.0.24 lib/exercism/env.rb
exercism-0.0.23 lib/exercism/env.rb
exercism-0.0.22 lib/exercism/env.rb
exercism-0.0.21 lib/exercism/env.rb