Module: WebConsole
- Defined in:
- lib/webconsole.rb,
lib/webconsole/lib/view.rb,
lib/webconsole/lib/logger.rb,
lib/webconsole/lib/module.rb,
lib/webconsole/lib/window.rb,
lib/webconsole/lib/view/erb.rb,
lib/webconsole/lib/constants.rb,
lib/webconsole/lib/controller.rb,
lib/webconsole/lib/view/resources.rb,
lib/webconsole/lib/view/javascript.rb
Defined Under Namespace
Modules: Dependencies, REPL
Classes: Controller, Logger, View, Window
Constant Summary
collapse
- LOAD_PLUGIN_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "load_plugin.scpt")
- EXISTS_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "exists.scpt")
- RUN_PLUGIN_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "run_plugin.scpt")
- PLUGIN_HAS_WINDOWS_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "plugin_has_windows.scpt")
- WINDOW_ID_FOR_PLUGIN_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "window_id_for_plugin.scpt")
- RESOURCE_PATH_FOR_PLUGIN_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "resource_path_for_plugin.scpt")
- SHARED_RESOURCES_PLUGIN_NAME =
"Shared Resources"
- SHARED_TEST_RESOURCES_PLUGIN_NAME =
"Shared Test Resources"
- RESOURCE_URL_FOR_PLUGIN_SCRIPT =
File.join(APPLESCRIPT_DIRECTORY, "resource_url_for_plugin.scpt")
- PLUGIN_NAME_KEY =
'WC_PLUGIN_NAME'
- WINDOW_ID_KEY =
'WC_WINDOW_ID'
- SHARED_RESOURCES_PATH_KEY =
'WC_SHARED_RESOURCES_PATH'
- SHARED_RESOURCES_URL_KEY =
'WC_SHARED_RESOURCES_URL'
- APPLESCRIPT_DIRECTORY =
File.join(File.dirname(__FILE__), "..", "..", "applescript")
Class Method Summary
collapse
Class Method Details
.application_exists ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/webconsole/lib/module.rb', line 9
def self.application_exists
result = self.run_applescript(EXISTS_SCRIPT)
result.chomp!
if result == "true"
return true
else
return false
end
end
|
.load_plugin(path) ⇒ Object
4
5
6
|
# File 'lib/webconsole/lib/module.rb', line 4
def self.load_plugin(path)
self.run_applescript(LOAD_PLUGIN_SCRIPT, [path])
end
|
.plugin_has_windows(name) ⇒ Object
34
35
36
37
38
39
40
41
42
|
# File 'lib/webconsole/lib/module.rb', line 34
def self.plugin_has_windows(name)
result = self.run_applescript(PLUGIN_HAS_WINDOWS_SCRIPT, [name])
result.chomp!
if result == "true"
return true
else
return false
end
end
|
.resource_path_for_plugin(name) ⇒ Object
54
55
56
57
58
|
# File 'lib/webconsole/lib/module.rb', line 54
def self.resource_path_for_plugin(name)
result = self.run_applescript(RESOURCE_PATH_FOR_PLUGIN_SCRIPT, [name])
result.chomp!
return result
end
|
.resource_url_for_plugin(name) ⇒ Object
81
82
83
84
85
|
# File 'lib/webconsole/lib/module.rb', line 81
def self.resource_url_for_plugin(name)
result = self.run_applescript(RESOURCE_URL_FOR_PLUGIN_SCRIPT, [name])
result.chomp!
return result
end
|
.run_plugin(name, directory = nil, arguments = nil) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/webconsole/lib/module.rb', line 20
def self.run_plugin(name, directory = nil, arguments = nil)
parameters = [name]
if directory
parameters.push(directory)
end
if arguments
parameters = parameters + arguments
end
result = self.run_applescript(RUN_PLUGIN_SCRIPT, parameters)
result.chomp!
return result
end
|
.shared_resource(resource) ⇒ Object
71
72
73
|
# File 'lib/webconsole/lib/module.rb', line 71
def self.shared_resource(resource)
return File.join(self.shared_resources_path, resource)
end
|
.shared_resources_path ⇒ Object
64
65
66
|
# File 'lib/webconsole/lib/module.rb', line 64
def self.shared_resources_path
return resource_path_for_plugin(SHARED_RESOURCES_PLUGIN_NAME)
end
|
.shared_resources_url ⇒ Object
86
87
88
|
# File 'lib/webconsole/lib/module.rb', line 86
def self.shared_resources_url
return resource_url_for_plugin(SHARED_RESOURCES_PLUGIN_NAME)
end
|
.shared_test_resource(resource) ⇒ Object
74
75
76
|
# File 'lib/webconsole/lib/module.rb', line 74
def self.shared_test_resource(resource)
return File.join(self.shared_test_resources_path, resource)
end
|
.shared_test_resources_path ⇒ Object
67
68
69
|
# File 'lib/webconsole/lib/module.rb', line 67
def self.shared_test_resources_path
return resource_path_for_plugin(SHARED_TEST_RESOURCES_PLUGIN_NAME)
end
|
.window_id_for_plugin(name) ⇒ Object
45
46
47
48
49
|
# File 'lib/webconsole/lib/module.rb', line 45
def self.window_id_for_plugin(name)
result = self.run_applescript(WINDOW_ID_FOR_PLUGIN_SCRIPT, [name])
result.chomp!
return result
end
|