Class: Repla::Dependencies::View

Inherits:
View show all
Defined in:
lib/repla/dependencies/lib/view.rb

Overview

Dependency view

Constant Summary collapse

ROOT_ACCESS_DIRECTORY =
File.join(__dir__, '../../')
HTML_DIRECTORY =
File.join(__dir__, '../html/')
VIEW_TEMPLATE =
File.join(HTML_DIRECTORY, 'index.html')
ADD_MISSING_DEPENDENCY_FUNCTION =
'addMissingDependency'.freeze

Constants inherited from Window

Window::CLOSEWINDOW_SCRIPT, Window::DOJAVASCRIPT_SCRIPT, Window::LOADWITHROOTACCESSDIRECTORY_SCRIPT, Window::LOAD_SCRIPT, Window::LOAD_URL_CACHE_SCRIPT, Window::LOAD_URL_SCRIPT, Window::READ_FROM_STANDARD_INPUT_SCRIPT

Instance Attribute Summary

Attributes inherited from Window

#root_access_directory_path

Instance Method Summary collapse

Methods inherited from View

#do_javascript_function, javascript_function, #view_id

Methods inherited from Window

#close, #dark_mode, #do_javascript, #load_file, #load_url, #read_from_standard_input, #split_id, #split_id_last, #window_id

Constructor Details

#initializeView

Returns a new instance of View.



9
10
11
12
13
14
15
# File 'lib/repla/dependencies/lib/view.rb', line 9

def initialize
  super
  self.root_access_directory_path = File.expand_path(
    ROOT_ACCESS_DIRECTORY
  )
  load_file(VIEW_TEMPLATE)
end

Instance Method Details

#add_missing_dependency(name, type, installation_instructions = nil) ⇒ Object



18
19
20
21
# File 'lib/repla/dependencies/lib/view.rb', line 18

def add_missing_dependency(name, type, installation_instructions = nil)
  do_javascript_function(ADD_MISSING_DEPENDENCY_FUNCTION,
                         [name, type, installation_instructions])
end