repla 0.6.0 → 0.6.1
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/exists.scpt +0 -0
- data/lib/applescript/hide_log.scpt +0 -0
- data/lib/applescript/load.scpt +0 -0
- data/lib/applescript/load_plugin.scpt +0 -0
- data/lib/applescript/load_with_root_access_directory.scpt +0 -0
- data/lib/applescript/read_from_standard_input.scpt +0 -0
- data/lib/applescript/resource_path_for_plugin.scpt +0 -0
- data/lib/applescript/resource_url_for_plugin.scpt +0 -0
- data/lib/applescript/run_plugin.scpt +0 -0
- data/lib/applescript/run_plugin_in_split.scpt +0 -0
- data/lib/applescript/show_log.scpt +0 -0
- data/lib/applescript/split_id_in_window.scpt +0 -0
- data/lib/applescript/split_id_in_window_last.scpt +0 -0
- data/lib/applescript/toggle_log.scpt +0 -0
- data/lib/applescript/window_id_for_plugin.scpt +0 -0
- data/lib/repla/lib/escape.rb +6 -1
- data/lib/repla/test/applescript/cancel_dialog.scpt +0 -0
- data/lib/repla/test/applescript/confirm_dialog.scpt +0 -0
- data/lib/repla/test/applescript/is_running.scpt +0 -0
- data/lib/repla/test/applescript/quit.scpt +0 -0
- data/lib/repla/test/applescript/set_window_bounds.scpt +0 -0
- data/lib/repla/test/applescript/switch_windows.scpt +0 -0
- data/lib/repla/test/applescript/window_bounds.scpt +0 -0
- data/lib/repla/test/applescript/window_id.scpt +0 -0
- data/lib/repla/test/bundles/FileExtension.replabundle/Contents/Info.plist +18 -0
- data/lib/repla/test/bundles/FileExtension.replabundle/Contents/Resources/cat.sh +3 -0
- data/lib/repla/test/bundles/PromptInterrupt.replabundle/Contents/Info.plist +16 -0
- data/lib/repla/test/bundles/PromptInterrupt.replabundle/Contents/Resources/cat.sh +3 -0
- data/lib/repla/test/bundles/TestEnvironment.replabundle/Contents/Resources/test_environment.rb +1 -1
- data/lib/repla/test/lib/helper.rb +8 -8
- metadata +13 -9
- data/lib/repla/test/applescript/cancel_dialog.applescript +0 -2
- data/lib/repla/test/applescript/confirm_dialog.applescript +0 -2
- data/lib/repla/test/applescript/is_running.applescript +0 -5
- data/lib/repla/test/applescript/quit.applescript +0 -3
- data/lib/repla/test/applescript/set_window_bounds.applescript +0 -23
- data/lib/repla/test/applescript/switch_windows.applescript +0 -2
- data/lib/repla/test/applescript/window_bounds.applescript +0 -20
- data/lib/repla/test/applescript/window_id.applescript +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0803f2aea2e54e900f31119d591a1b5efa128f09'
|
4
|
+
data.tar.gz: 47b47687ed0bdf847c6c036eaabb6d4f79c4920e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f62b3713160d59ce955981e98a5d821f0ad4aa81ac43e153905c6cdf986cad8a1fb002f3ad5961da62cf54c240496600d69154d664336734a6fa6f5bf0d54603
|
7
|
+
data.tar.gz: 1e5468c3716e0d98161959935a1fa9c04f7b17a75db11eac40b3165cf535b608325eddab2583ea8c15a456da4a98bc9fd4a47cccbc743faed79c9602491aae3f
|
Binary file
|
Binary file
|
Binary file
|
data/lib/applescript/exists.scpt
CHANGED
Binary file
|
Binary file
|
data/lib/applescript/load.scpt
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/repla/lib/escape.rb
CHANGED
@@ -52,7 +52,12 @@ module Escape
|
|
52
52
|
# they this only fails when the code imported into the `gem`?
|
53
53
|
|
54
54
|
def self.javascript_escape(string)
|
55
|
-
string.gsub('\\', '\\\\\\\\').gsub("\n", '\\\\n').gsub("'", "\\\\'")
|
55
|
+
# string.gsub('\\', '\\\\\\\\').gsub("\n", '\\\\n').gsub("'", "\\\\'")
|
56
|
+
# Combined as one command, comparable in speed:
|
57
|
+
string.gsub(/\\\\|\n|'/,
|
58
|
+
'\\\\' => '\\\\\\\\',
|
59
|
+
"\n" => '\\n',
|
60
|
+
"'" => '\\\'')
|
56
61
|
end
|
57
62
|
|
58
63
|
def self.shell_escape(string)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>WCName</key>
|
6
|
+
<string>FileExtension</string>
|
7
|
+
<key>WCCommand</key>
|
8
|
+
<string>cat.sh</string>
|
9
|
+
<key>WCUUID</key>
|
10
|
+
<string>C4B09ED5-ED60-44FF-A0BB-43EF6F8AF569</string>
|
11
|
+
<key>WCEditable</key>
|
12
|
+
<integer>0</integer>
|
13
|
+
<key>WCFileExtensions</key>
|
14
|
+
<array>
|
15
|
+
<string>txt</string>
|
16
|
+
</array>
|
17
|
+
</dict>
|
18
|
+
</plist>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>WCName</key>
|
6
|
+
<string>PromptInterrupt</string>
|
7
|
+
<key>WCCommand</key>
|
8
|
+
<string>cat.sh</string>
|
9
|
+
<key>WCUUID</key>
|
10
|
+
<string>2565A8F0-56E1-4CE4-AA35-DBDAEB720443</string>
|
11
|
+
<key>WCEditable</key>
|
12
|
+
<integer>0</integer>
|
13
|
+
<key>WCPromptInterrupt</key>
|
14
|
+
<integer>1</integer>
|
15
|
+
</dict>
|
16
|
+
</plist>
|
@@ -18,53 +18,53 @@ module Repla
|
|
18
18
|
end
|
19
19
|
|
20
20
|
CONFIRMDIALOGAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
21
|
-
'confirm_dialog.
|
21
|
+
'confirm_dialog.scpt')
|
22
22
|
def self.confirm_dialog
|
23
23
|
run_applescript(CONFIRMDIALOGAPPLESCRIPT_FILE)
|
24
24
|
sleep TEST_PAUSE_TIME # Give dialog time
|
25
25
|
end
|
26
26
|
|
27
27
|
WINDOWIDAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
28
|
-
'window_id.
|
28
|
+
'window_id.scpt')
|
29
29
|
def self.window_id
|
30
30
|
run_applescript(WINDOWIDAPPLESCRIPT_FILE)
|
31
31
|
end
|
32
32
|
|
33
33
|
CANCELDIALOGAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
34
|
-
'cancel_dialog.
|
34
|
+
'cancel_dialog.scpt')
|
35
35
|
def self.cancel_dialog
|
36
36
|
run_applescript(CANCELDIALOGAPPLESCRIPT_FILE)
|
37
37
|
sleep TEST_PAUSE_TIME # Give dialog time
|
38
38
|
end
|
39
39
|
|
40
40
|
QUITAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
41
|
-
'quit.
|
41
|
+
'quit.scpt')
|
42
42
|
def self.quit
|
43
43
|
run_applescript(QUITAPPLESCRIPT_FILE)
|
44
44
|
end
|
45
45
|
|
46
46
|
ISRUNNINGAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
47
|
-
'is_running.
|
47
|
+
'is_running.scpt')
|
48
48
|
def self.app_running?
|
49
49
|
result = run_applescript(ISRUNNINGAPPLESCRIPT_FILE)
|
50
50
|
result == 'true'
|
51
51
|
end
|
52
52
|
|
53
53
|
SWITCHWINDOWSAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
54
|
-
'switch_windows.
|
54
|
+
'switch_windows.scpt')
|
55
55
|
def self.switch_windows
|
56
56
|
run_applescript(SWITCHWINDOWSAPPLESCRIPT_FILE)
|
57
57
|
end
|
58
58
|
|
59
59
|
WINDOWBOUNDSAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
60
|
-
'window_bounds.
|
60
|
+
'window_bounds.scpt')
|
61
61
|
def self.window_bounds(window_id = nil)
|
62
62
|
run_applescript(WINDOWBOUNDSAPPLESCRIPT_FILE, [window_id])
|
63
63
|
end
|
64
64
|
|
65
65
|
SETWINDOWBOUNDSAPPLESCRIPT_FILE = File.join(APPLESCRIPT_DIRECTORY,
|
66
66
|
'set_window_bounds'\
|
67
|
-
'.
|
67
|
+
'.scpt')
|
68
68
|
def self.set_window_bounds(bounds, window_id = nil)
|
69
69
|
arguments = [bounds]
|
70
70
|
arguments = arguments.push(window_id) if window_id
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roben Kleene
|
@@ -96,16 +96,18 @@ files:
|
|
96
96
|
- lib/repla/resources/js/mousetrap.js
|
97
97
|
- lib/repla/resources/js/zepto.js
|
98
98
|
- lib/repla/test.rb
|
99
|
-
- lib/repla/test/applescript/cancel_dialog.
|
100
|
-
- lib/repla/test/applescript/confirm_dialog.
|
101
|
-
- lib/repla/test/applescript/is_running.
|
102
|
-
- lib/repla/test/applescript/quit.
|
103
|
-
- lib/repla/test/applescript/set_window_bounds.
|
104
|
-
- lib/repla/test/applescript/switch_windows.
|
105
|
-
- lib/repla/test/applescript/window_bounds.
|
106
|
-
- lib/repla/test/applescript/window_id.
|
99
|
+
- lib/repla/test/applescript/cancel_dialog.scpt
|
100
|
+
- lib/repla/test/applescript/confirm_dialog.scpt
|
101
|
+
- lib/repla/test/applescript/is_running.scpt
|
102
|
+
- lib/repla/test/applescript/quit.scpt
|
103
|
+
- lib/repla/test/applescript/set_window_bounds.scpt
|
104
|
+
- lib/repla/test/applescript/switch_windows.scpt
|
105
|
+
- lib/repla/test/applescript/window_bounds.scpt
|
106
|
+
- lib/repla/test/applescript/window_id.scpt
|
107
107
|
- lib/repla/test/bundles/Cat.replabundle/Contents/Info.plist
|
108
108
|
- lib/repla/test/bundles/Cat.replabundle/Contents/Resources/cat.sh
|
109
|
+
- lib/repla/test/bundles/FileExtension.replabundle/Contents/Info.plist
|
110
|
+
- lib/repla/test/bundles/FileExtension.replabundle/Contents/Resources/cat.sh
|
109
111
|
- lib/repla/test/bundles/HelloWorld.replabundle/Contents/Info.plist
|
110
112
|
- lib/repla/test/bundles/HelloWorld.replabundle/Contents/Resources/hello_world.rb
|
111
113
|
- lib/repla/test/bundles/Invalid.replabundle/Contents/Info.plist
|
@@ -116,6 +118,8 @@ files:
|
|
116
118
|
- lib/repla/test/bundles/Print.replabundle/Contents/Resources/lib/controller.rb
|
117
119
|
- lib/repla/test/bundles/Print.replabundle/Contents/Resources/lib/view.rb
|
118
120
|
- lib/repla/test/bundles/Print.replabundle/Contents/Resources/print.rb
|
121
|
+
- lib/repla/test/bundles/PromptInterrupt.replabundle/Contents/Info.plist
|
122
|
+
- lib/repla/test/bundles/PromptInterrupt.replabundle/Contents/Resources/cat.sh
|
119
123
|
- lib/repla/test/bundles/TestEnvironment.replabundle/Contents/Info.plist
|
120
124
|
- lib/repla/test/bundles/TestEnvironment.replabundle/Contents/Resources/constants.rb
|
121
125
|
- lib/repla/test/bundles/TestEnvironment.replabundle/Contents/Resources/test_environment.rb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
on run arguments
|
2
|
-
tell application "Repla"
|
3
|
-
|
4
|
-
set theTextBounds to the first item of arguments
|
5
|
-
|
6
|
-
set originalTextItemDelimiters to AppleScript's text item delimiters
|
7
|
-
set AppleScript's text item delimiters to ", "
|
8
|
-
set theBounds to text items of theTextBounds
|
9
|
-
set AppleScript's text item delimiters to originalTextItemDelimiters
|
10
|
-
|
11
|
-
set arguments to rest of arguments
|
12
|
-
|
13
|
-
if arguments is {} then
|
14
|
-
set theWindow to window 1
|
15
|
-
else
|
16
|
-
set windowid to the first item of arguments
|
17
|
-
set theWindow to window id windowid
|
18
|
-
end if
|
19
|
-
|
20
|
-
|
21
|
-
set the bounds of theWindow to theBounds
|
22
|
-
end tell
|
23
|
-
end run
|
@@ -1,20 +0,0 @@
|
|
1
|
-
on run windowid
|
2
|
-
tell application "Repla"
|
3
|
-
|
4
|
-
if windowid is {} then
|
5
|
-
set theWindow to window 1
|
6
|
-
else
|
7
|
-
set theWindow to window id windowid
|
8
|
-
end if
|
9
|
-
|
10
|
-
set theBounds to bounds of theWindow
|
11
|
-
|
12
|
-
|
13
|
-
set originalTextItemDelimiters to AppleScript's text item delimiters
|
14
|
-
set AppleScript's text item delimiters to ", "
|
15
|
-
set theTextBounds to theBounds as text
|
16
|
-
set AppleScript's text item delimiters to originalTextItemDelimiters
|
17
|
-
|
18
|
-
return theTextBounds
|
19
|
-
end tell
|
20
|
-
end run
|