Class: Belajar::Terminal::Welcome

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.aboutObject



10
11
12
# File 'lib/belajar/terminal/welcome.rb', line 10

def self.about
  new.about
end

.runObject



6
7
8
# File 'lib/belajar/terminal/welcome.rb', line 6

def self.run
  new.run
end

Instance Method Details

#aboutObject



35
36
37
38
39
40
# File 'lib/belajar/terminal/welcome.rb', line 35

def about
  empty_line
  say Terminal.text :about
  empty_line
  say `belajar help`
end

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/belajar/terminal/welcome.rb', line 14

def run
  empty_line
  say Terminal.text :welcome
  empty_line
  say 'For now, let’s setup the belajar paths.'
  Belajar::Terminal::Setup.new.init

  show_setup_list_announcement
  show_courses_list_announcement

  courses = Loading::Courses.load(Belajar.config.courses_path)

  if courses.empty?
    show_courses_download_announcement
    show_solutions_open_announcement
  end

  empty_line
  show_learn_announcement
end