webconsole 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/applescript/close_window.scpt +0 -0
- data/lib/applescript/create_window.scpt +0 -0
- data/lib/applescript/do_javascript.scpt +0 -0
- data/lib/applescript/load_html.scpt +0 -0
- data/lib/applescript/load_html_with_base_url.scpt +0 -0
- data/lib/applescript/read_from_standard_input.scpt +0 -0
- data/lib/applescript/run_plugin.scpt +0 -0
- data/lib/applescript/run_plugin_in_split.scpt +0 -0
- data/lib/applescript/split_id_in_window.scpt +0 -0
- data/lib/applescript/window_id_for_plugin.scpt +0 -0
- data/lib/webconsole/lib/constants.rb +1 -0
- data/lib/webconsole/lib/module.rb +7 -0
- data/lib/webconsole/lib/view.rb +21 -22
- data/lib/webconsole/lib/view/erb.rb +1 -1
- data/lib/webconsole/lib/view/javascript.rb +1 -1
- data/lib/webconsole/lib/view/resources.rb +1 -1
- data/lib/webconsole/lib/window.rb +41 -19
- metadata +3 -5
- data/lib/applescript/do_javascript_in_split.scpt +0 -0
- data/lib/applescript/load_html_in_split.scpt +0 -0
- data/lib/applescript/load_html_with_base_url_in_split.scpt +0 -0
- data/lib/applescript/split_id_for_plugin_in_window.scpt +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fcc746a3b332008cbc7f7767e5c7879b968b639
|
4
|
+
data.tar.gz: d2debc54d64a67a3555db9164e012f2e2d59a883
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e195df3b04bdff44650930f4e1e00ea1cb4839dde2e771d1ce1e482b5c6a0f31e9917cfcc9395bcdfdf97148be98310534b21fc8c65fe4ca2ee622106d4b5b6
|
7
|
+
data.tar.gz: c18edf9c671929b543e95171fc6b683eea64a19990a7bab4afd74b2b5d61b441d779099bcd003fad7e720c3b8c2e582bfc66acb9a49f2c8fdbc9bb33c3ea6ccb
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -48,6 +48,13 @@ module WebConsole
|
|
48
48
|
return result
|
49
49
|
end
|
50
50
|
|
51
|
+
CREATE_WINDOW_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "create_window.scpt")
|
52
|
+
def self.create_window
|
53
|
+
result = self.run_applescript(CREATE_WINDOW_SCRIPT)
|
54
|
+
result.chomp!
|
55
|
+
return result
|
56
|
+
end
|
57
|
+
|
51
58
|
# Shared Resources
|
52
59
|
|
53
60
|
RESOURCE_PATH_FOR_PLUGIN_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "resource_path_for_plugin.scpt")
|
data/lib/webconsole/lib/view.rb
CHANGED
@@ -1,33 +1,32 @@
|
|
1
|
+
require_relative "window"
|
1
2
|
require_relative "view/javascript"
|
2
3
|
require_relative "view/erb"
|
3
4
|
require_relative "view/resources"
|
4
5
|
|
5
6
|
module WebConsole
|
6
|
-
class View
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
@
|
19
|
-
end
|
20
|
-
|
21
|
-
def load_html(html)
|
22
|
-
@window.load_html(html)
|
7
|
+
class View < Window
|
8
|
+
|
9
|
+
# Properties
|
10
|
+
|
11
|
+
def view_id
|
12
|
+
if !@view_id
|
13
|
+
if ENV.has_key?(SPLIT_ID_KEY)
|
14
|
+
@view_id = ENV[SPLIT_ID_KEY]
|
15
|
+
else
|
16
|
+
@view_id = split_id
|
17
|
+
end
|
18
|
+
end
|
19
|
+
return @view_id
|
23
20
|
end
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
private
|
23
|
+
|
24
|
+
# Web
|
28
25
|
|
29
|
-
def
|
30
|
-
|
26
|
+
def arguments_with_target(arguments)
|
27
|
+
arguments = super(arguments)
|
28
|
+
arguments.push(view_id)
|
29
|
+
return arguments
|
31
30
|
end
|
32
31
|
|
33
32
|
end
|
@@ -8,9 +8,24 @@ module WebConsole
|
|
8
8
|
@window_id = window_id
|
9
9
|
end
|
10
10
|
|
11
|
+
# Properties
|
12
|
+
|
11
13
|
def base_url_path=(value)
|
12
14
|
@base_url = "file://" + value
|
13
15
|
end
|
16
|
+
|
17
|
+
def window_id
|
18
|
+
if !@window_id
|
19
|
+
if ENV.has_key?(WINDOW_ID_KEY)
|
20
|
+
@window_id = ENV[WINDOW_ID_KEY]
|
21
|
+
else
|
22
|
+
@window_id = WebConsole::create_window
|
23
|
+
end
|
24
|
+
end
|
25
|
+
return @window_id
|
26
|
+
end
|
27
|
+
|
28
|
+
# Web
|
14
29
|
|
15
30
|
LOADHTML_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "load_html.scpt")
|
16
31
|
LOADHTMLWITHBASEURL_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "load_html_with_base_url.scpt")
|
@@ -24,44 +39,51 @@ module WebConsole
|
|
24
39
|
arguments.push(@base_url)
|
25
40
|
end
|
26
41
|
|
27
|
-
|
28
|
-
arguments.push(window_id)
|
29
|
-
end
|
30
|
-
|
31
|
-
result = WebConsole::run_applescript(script, arguments)
|
32
|
-
if !window_id
|
33
|
-
# This allows a window manager created without a window_id and then be assigned the window_id when load_html is called.
|
34
|
-
@window_id = self.class.window_id_from_result(result)
|
35
|
-
end
|
42
|
+
return run_script(script, arguments)
|
36
43
|
end
|
37
44
|
|
38
45
|
DOJAVASCRIPT_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "do_javascript.scpt")
|
39
46
|
def do_javascript(javascript)
|
40
|
-
|
47
|
+
return run_script(DOJAVASCRIPT_SCRIPT, [javascript])
|
41
48
|
end
|
42
49
|
|
43
50
|
READ_FROM_STANDARD_INPUT_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "read_from_standard_input.scpt")
|
44
51
|
def read_from_standard_input(text)
|
45
|
-
|
52
|
+
run_script(READ_FROM_STANDARD_INPUT_SCRIPT, [text])
|
46
53
|
end
|
47
54
|
|
55
|
+
# Window
|
56
|
+
|
48
57
|
CLOSEWINDOW_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "close_window.scpt")
|
49
58
|
def close
|
50
59
|
WebConsole::run_applescript(CLOSEWINDOW_SCRIPT, [window_id])
|
51
60
|
end
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
61
|
+
|
62
|
+
SPLIT_ID_IN_WINDOW_SCRIPT = File.join(APPLESCRIPT_DIRECTORY, "split_id_in_window.scpt")
|
63
|
+
def split_id(pluginName = nil)
|
64
|
+
arguments = [window_id]
|
65
|
+
|
66
|
+
if pluginName
|
67
|
+
arguments.push(pluginName)
|
56
68
|
end
|
57
|
-
|
69
|
+
|
70
|
+
result = WebConsole::run_applescript(SPLIT_ID_IN_WINDOW_SCRIPT, arguments)
|
71
|
+
result.chomp!
|
72
|
+
return result
|
58
73
|
end
|
59
74
|
|
60
75
|
private
|
61
|
-
|
62
|
-
def
|
63
|
-
|
76
|
+
|
77
|
+
def run_script(script, arguments = [])
|
78
|
+
arguments = arguments_with_target(arguments)
|
79
|
+
return WebConsole::run_applescript(script, arguments)
|
64
80
|
end
|
65
81
|
|
82
|
+
def arguments_with_target(arguments)
|
83
|
+
arguments.push(window_id)
|
84
|
+
return arguments
|
85
|
+
end
|
86
|
+
|
87
|
+
|
66
88
|
end
|
67
89
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webconsole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roben Kleene
|
@@ -17,13 +17,11 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/applescript/close_window.scpt
|
20
|
+
- lib/applescript/create_window.scpt
|
20
21
|
- lib/applescript/do_javascript.scpt
|
21
|
-
- lib/applescript/do_javascript_in_split.scpt
|
22
22
|
- lib/applescript/exists.scpt
|
23
23
|
- lib/applescript/load_html.scpt
|
24
|
-
- lib/applescript/load_html_in_split.scpt
|
25
24
|
- lib/applescript/load_html_with_base_url.scpt
|
26
|
-
- lib/applescript/load_html_with_base_url_in_split.scpt
|
27
25
|
- lib/applescript/load_plugin.scpt
|
28
26
|
- lib/applescript/plugin_has_windows.scpt
|
29
27
|
- lib/applescript/read_from_standard_input.scpt
|
@@ -31,7 +29,7 @@ files:
|
|
31
29
|
- lib/applescript/resource_url_for_plugin.scpt
|
32
30
|
- lib/applescript/run_plugin.scpt
|
33
31
|
- lib/applescript/run_plugin_in_split.scpt
|
34
|
-
- lib/applescript/
|
32
|
+
- lib/applescript/split_id_in_window.scpt
|
35
33
|
- lib/applescript/window_id_for_plugin.scpt
|
36
34
|
- lib/webconsole.rb
|
37
35
|
- lib/webconsole/dependencies.rb
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|