Class: LearnOpen::Environments::JupyterContainerEnvironment

Inherits:
BaseEnvironment
  • Object
show all
Defined in:
lib/learn_open/environments/jupyter_container_environment.rb

Instance Attribute Summary

Attributes inherited from BaseEnvironment

#environment_vars, #io, #logger, #options, #system_adapter

Instance Method Summary collapse

Methods inherited from BaseEnvironment

#download_lesson, #initialize, #install_dependencies, #notify_of_completion, #open_lab, #open_shell, #start_file_backup

Constructor Details

This class inherits a constructor from LearnOpen::Environments::BaseEnvironment

Instance Method Details

#install_jupyter_dependencies(lesson, location) ⇒ Object



22
23
24
# File 'lib/learn_open/environments/jupyter_container_environment.rb', line 22

def install_jupyter_dependencies(lesson, location)
  LearnOpen::DependencyInstallers::JupyterPipInstall.call(lesson, location, self, options)
end

#managed?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/learn_open/environments/jupyter_container_environment.rb', line 4

def managed?
  true
end

#open_editor(lesson, location, editor) ⇒ Object



16
17
18
19
20
# File 'lib/learn_open/environments/jupyter_container_environment.rb', line 16

def open_editor(lesson, location, editor)
  io.puts "Opening lesson..."
  system_adapter.change_context_directory(lesson.to_path)
  system_adapter.open_editor(editor, path: ".")
end

#open_jupyter_lab(lesson, location, editor, clone_only) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/learn_open/environments/jupyter_container_environment.rb', line 8

def open_jupyter_lab(lesson, location, editor, clone_only)
  download_lesson(lesson, location)
  start_file_backup(lesson, location) if lesson.use_student_fork
  install_jupyter_dependencies(lesson, location)
  notify_of_completion
  open_shell unless clone_only
end