Class: WebConsole::Dependencies::View

Inherits:
View
  • Object
show all
Defined in:
lib/webconsole/dependencies/lib/view.rb

Constant Summary collapse

BASE_DIRECTORY =
File.join(File.dirname(__FILE__), '..')
VIEWS_DIRECTORY =
File.join(BASE_DIRECTORY, "views")
VIEW_TEMPLATE =
File.join(VIEWS_DIRECTORY, 'view.html.erb')
ADD_MISSING_DEPENDENCY_FUNCTION =
"addMissingDependency"

Constants inherited from View

View::CSS_EXTENSION, View::CSS_PATH_COMPONENT, View::JS_EXTENSION, View::JS_PATH_COMPONENT

Constants inherited from Window

Window::CLOSEWINDOW_SCRIPT, Window::DOJAVASCRIPT_SCRIPT, Window::LOADHTMLWITHBASEURL_SCRIPT, Window::LOADHTML_SCRIPT, Window::READ_FROM_STANDARD_INPUT_SCRIPT

Instance Attribute Summary

Attributes inherited from View

#title

Attributes inherited from Window

#base_url

Instance Method Summary collapse

Methods inherited from View

#do_javascript_function, javascript_function, #javascript_include_tag, #load_erb, #load_erb_from_path, #shared_javascript_include_tag, #shared_stylesheet_link_tag, #stylesheet_link_tag, #view_id

Methods inherited from Window

#base_url_path=, #close, #do_javascript, #load_html, #read_from_standard_input, #split_id, #split_id_last, #window_id

Constructor Details

#initializeView

Returns a new instance of View.



8
9
10
11
12
# File 'lib/webconsole/dependencies/lib/view.rb', line 8

def initialize
  super
  self.base_url_path = File.expand_path(BASE_DIRECTORY)
  load_erb_from_path(VIEW_TEMPLATE)
end

Instance Method Details

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



15
16
17
# File 'lib/webconsole/dependencies/lib/view.rb', line 15

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