repla 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9d072ea3122cc808168f77e02aa527bee84b97f
4
- data.tar.gz: 3425a55a09e166dd54b32d526d295ffff411a106
3
+ metadata.gz: 1c40131156dfdc2aad9c483c50f0331a1aeea000
4
+ data.tar.gz: a39543f121d7c44dae0f5d942a00e733ca117293
5
5
  SHA512:
6
- metadata.gz: 2b410101c334239ea91222c48ec893a4ee9187266a57e46748a4c64b6418bcda4778c11a35b8b27a030bdf4df4e54ce720ed8e3d921b5f514a3c65488d104e01
7
- data.tar.gz: df7a9f1397e818791db811fbba2efff84a38b5c36e2b6f68c82f66eba1ce6f2b25c5a3996ae4740f46ad5e922c83a5f651f4bd14026f954ab6feed8b1065f6e6
6
+ metadata.gz: c45fecb1079553c8070d6fcf9816c3ab154c14bf39f51b9269d3c76dab063b3577138d8e7db11a794ea9f1ff5e75c8b0bbcaec6eb91fa103965abad7dbc24694
7
+ data.tar.gz: 07526cf5246d604768f25e4cd7ee0923e7300f4aaf448a3c7c5b3f6ac8fac5ea2b1ac79df3175d405dc5bb682a5ab36753a81d693312754d4de12f69bd0818c3
@@ -20,7 +20,9 @@ module Repla
20
20
  @view.add_missing_dependency(name, type, installation_instructions)
21
21
  end
22
22
 
23
- private_class_method def self.string_for_type(type)
23
+ # TODO: `self.run_applescript` should be private but now all of a sudden
24
+ # instances method can't call private class methods?
25
+ def self.string_for_type(type)
24
26
  case type
25
27
  when :shell_command
26
28
  return 'shell command'
@@ -10,7 +10,10 @@ module Repla
10
10
  end
11
11
 
12
12
  require 'shellwords'
13
- private_class_method def self.check_shell_command(name)
13
+
14
+ # TODO: `self.run_applescript` should be private but now all of a sudden
15
+ # instances method can't call private class methods?
16
+ def self.check_shell_command(name)
14
17
  command = "type -a #{Shellwords.escape(name)} > /dev/null 2>&1"
15
18
  system(command)
16
19
  end
@@ -47,11 +47,15 @@ module Escape
47
47
  replace(StringEscape.shell_escape(self))
48
48
  end
49
49
 
50
- private_class_method def self.javascript_escape(string)
50
+ # TODO: `self.javascript_escape` and `self.shell_escape` should be private,
51
+ # but instance methods can't call private class methods in Ruby? Or can
52
+ # they this only fails when the code imported into the `gem`?
53
+
54
+ def self.javascript_escape(string)
51
55
  string.gsub('\\', '\\\\\\\\').gsub("\n", '\\\\n').gsub("'", "\\\\'")
52
56
  end
53
57
 
54
- private_class_method def self.shell_escape(string)
58
+ def self.shell_escape(string)
55
59
  Shellwords.escape(string)
56
60
  end
57
61
  end
@@ -71,7 +71,9 @@ module Repla
71
71
  run_applescript(RESOURCE_URL_FOR_PLUGIN_SCRIPT, [name])
72
72
  end
73
73
 
74
- private_class_method def self.run_applescript(script, arguments = nil)
74
+ # TODO: `self.run_applescript` should be private but now all of a sudden
75
+ # instances method can't call private class methods?
76
+ def self.run_applescript(script, arguments = nil)
75
77
  command = "osascript #{script.shell_escape}"
76
78
 
77
79
  if arguments
@@ -71,9 +71,9 @@ module Repla
71
71
  run_applescript(SETWINDOWBOUNDSAPPLESCRIPT_FILE, arguments)
72
72
  end
73
73
 
74
- private
75
-
76
- private_class_method def self.run_applescript(script, arguments = nil)
74
+ # TODO: `self.run_applescript` should be private but now all of a sudden
75
+ # instances method can't call private class methods?
76
+ def self.run_applescript(script, arguments = nil)
77
77
  command = "osascript #{Shellwords.escape(script)}"
78
78
  if arguments
79
79
  arguments.each do |argument|
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.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roben Kleene