Sha256: e659f549c2200e1a324487b2ce656e5a69aa9f6688529a5fae39aff52b5c3d01

Contents?: true

Size: 897 Bytes

Versions: 2

Compression:

Stored size: 897 Bytes

Contents

require 'rubygems' if RUBY_VERSION <= "1.8.7"
require 'etc'
require 'json'
require 'yaml'
require 'fileutils'

old_warn, $-w = $-w, nil
begin
  require 'faraday'
ensure
  $-w = old_warn
end

require 'exercism/version'
require 'exercism/env'
require 'exercism/config'
require 'exercism/user'
require 'exercism/assignment'
require 'exercism/submission'
require 'exercism/api'
require 'exercism/stash'

class Exercism

  def self.home
    @home ||= Env.home
  end

  def self.login(github_username, key, dir)
    data = {
      'github_username' => github_username,
      'key' => key,
      'project_dir' => dir
    }
    Config.write home, data
  end

  def self.user
    c = config
    User.new(c.github_username, c.key)
  end

  def self.project_dir
    config.project_dir
  end

  def self.alternate_config_path
    Config.alternate_path
  end

  def self.config
    Config.read(home)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exercism-0.0.28 lib/exercism.rb
exercism-0.0.27 lib/exercism.rb