Class: Belajar::Terminal::CLI

Inherits:
Thor
  • Object
show all
Includes:
Output
Defined in:
lib/belajar/terminal/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



23
24
25
26
# File 'lib/belajar/terminal/cli.rb', line 23

def self.start
  Belajar.config.import
  super
end

Instance Method Details

#aboutObject



29
30
31
# File 'lib/belajar/terminal/cli.rb', line 29

def about
  Welcome.about
end

#learnObject



52
53
54
55
# File 'lib/belajar/terminal/cli.rb', line 52

def learn
  courses = Loading::Courses.load(Belajar.config.courses_path)
  courses.empty? ? Courses.new.list : Belajar.start
end

#scaffoldObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/belajar/terminal/cli.rb', line 39

def scaffold
  generator = Generator.new
  generator.prepare

  courses_path   = Belajar.config.courses_path
  solutions_path = Belajar.config.solutions_path

  generator.scaffold(courses_path, solutions_path)

  say_info "You will find your solution files in\n#{solutions_path}."
end

#welcomeObject



34
35
36
# File 'lib/belajar/terminal/cli.rb', line 34

def welcome
  Welcome.run
end