Class: Exercism

Inherits:
Object
  • Object
show all
Defined in:
lib/cli.rb,
lib/exercism.rb,
lib/exercism/api.rb,
lib/exercism/env.rb,
lib/exercism/config.rb,
lib/exercism/version.rb,
lib/exercism/assignment.rb,
lib/exercism/submission.rb,
lib/cli/monitored_request.rb

Defined Under Namespace

Classes: Api, Assignment, CLI, Config, Env, Submission

Constant Summary collapse

VERSION =
"0.0.26"

Class Method Summary collapse

Class Method Details

.alternate_config_pathObject



46
47
48
# File 'lib/exercism.rb', line 46

def self.alternate_config_path
  Config.alternate_path
end

.configObject



50
51
52
# File 'lib/exercism.rb', line 50

def self.config
  Config.read(home)
end

.homeObject



24
25
26
# File 'lib/exercism.rb', line 24

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

.login(github_username, key, dir) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/exercism.rb', line 28

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

.project_dirObject



42
43
44
# File 'lib/exercism.rb', line 42

def self.project_dir
  config.project_dir
end

.userObject



37
38
39
40
# File 'lib/exercism.rb', line 37

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