ruby-zoom 4.5.5 → 4.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 141e398dfd381970365f9a7ac9d006d12fbb5e78
4
- data.tar.gz: 6cfe24ba6b90cb368bd24eed6a58805be9ee5c1f
3
+ metadata.gz: 13309634343d322e2a7a1f337ca36ccdd9364a71
4
+ data.tar.gz: 7a92ddabed36807f0431c5b5038afd26c5448a3e
5
5
  SHA512:
6
- metadata.gz: '099bd9cdefabd22a413ec96781aafd202b21e498a7c9cc8cac0024398a02590ce55cf0b2ea6425ed3e9a80ee5aa4cc53e4e8b16b46bd067f884cf8f56961d83e'
7
- data.tar.gz: ad060d42f0f9d2e64010460cd17ce9b9cb938958e9227a6b8b21822d0f3cc9525daf6a4f0e362847853f42297dba9800c881a620e85ddfcf6b02478b19280b05
6
+ metadata.gz: 1ab81d532780f4d669ce66432d524244258f0a5700d2ed0c00a4e6ae4dae568683bfd8b92cb26c0b1fa8fa04813c3160850033ddc270fd9121c02ad319eaccbe
7
+ data.tar.gz: c172029ce54ab7be4faae52d4c37672060be79203a11fd17c1dde06ba99ad6fe9fdc01261d3bc61dc28bb46c536d26dd44b108aab2a805b4c2ab2c25b15c870e
@@ -30,14 +30,15 @@ class Zoom
30
30
 
31
31
  def repeat(shortcut = true)
32
32
  return if (@cache.empty?)
33
- run(@cache.header, shortcut)
33
+ run(@cache.header, shortcut, true)
34
34
  end
35
35
 
36
- def run(header, shortcut = true)
36
+ def run(header, shortcut = true, repeat = false)
37
37
  # Ensure header has no nil
38
- ["args", "paths", "pattern", "profile_name"].each do |key|
38
+ ["args", "pattern", "profile_name"].each do |key|
39
39
  header[key] ||= ""
40
40
  end
41
+ header["paths"] ||= "."
41
42
  header["pwd"] = Dir.pwd
42
43
  header["translate"] ||= Array.new
43
44
 
@@ -52,21 +53,17 @@ class Zoom
52
53
  end
53
54
 
54
55
  profile = @config.get_profile(profile_name)
55
- if (!profile.pattern.empty?)
56
- header["pattern"] = profile.pattern
57
- end
58
-
59
56
  begin
57
+ # This will translate and/or append args such that the
58
+ # output will be something Zoom can process
59
+ header = profile.preprocess(header) if (!repeat)
60
+
60
61
  # Clear cache
61
62
  @cache.clear
62
63
 
63
64
  # Store needed details
64
65
  @cache.header(header)
65
66
 
66
- # This will translate and/or append args such that the
67
- # output will be something Zoom can process
68
- header = profile.preprocess(header)
69
-
70
67
  # Execute profile
71
68
  @cache.write(profile.exe(header))
72
69
 
@@ -62,6 +62,10 @@ class Zoom::Cache
62
62
  return nil if (header.nil? && empty?)
63
63
  return @header if (header.nil?)
64
64
 
65
+ # This causes the cache to be "empty" so don't do it! Leaving
66
+ # this here so I don't forget.
67
+ # @header = header
68
+
65
69
  File.open(@cache_file, "a") do |f|
66
70
  f.write("ZOOM_HEADER=#{JSON.generate(header)}\n")
67
71
  end
@@ -53,7 +53,7 @@ class Zoom::Profile < Hash
53
53
  @format_flags,
54
54
  flags,
55
55
  header["args"],
56
- header["pattern"],
56
+ header["pattern"].shellescape,
57
57
  header["paths"],
58
58
  after
59
59
  ].join(" ").strip
@@ -165,18 +165,29 @@ class Zoom::Profile < Hash
165
165
 
166
166
  def preprocess(header)
167
167
  # Use hard-coded pattern if defined
168
- pattern = header["pattern"]
169
- if (@pattern && !@pattern.empty? && (pattern != @pattern))
170
- header["args"] += " #{pattern}"
168
+ if (
169
+ @pattern &&
170
+ !@pattern.empty? &&
171
+ (header["pattern"] != @pattern)
172
+ )
173
+ header["args"] += " #{header["pattern"]}"
171
174
  header["pattern"] = @pattern
172
175
  end
173
176
 
174
177
  case operator.split("/")[-1]
175
178
  when /^ack(-grep)?$/, "ag", "grep", "pt"
176
- header["pattern"] = header["pattern"].shellescape
179
+ paths = header["paths"].split(" ")
180
+ if (header["pattern"].empty? && !paths.empty?)
181
+ header["pattern"] = paths.delete_at(0)
182
+ header["paths"] = paths.join(" ").strip
183
+ header["paths"] = "." if (header["paths"].empty?)
184
+ end
185
+
186
+ # This isn't done here anymore as it'll break hilighting
187
+ # header["pattern"] = header["pattern"].shellescape
177
188
  when "find"
178
189
  # If additional args are passed, then assume pattern is
179
- # actually and arg
190
+ # actually an arg
180
191
  if (header["args"] && !header["args"].empty?)
181
192
  header["args"] += " #{header["pattern"]}"
182
193
  header["pattern"] = ""
@@ -19,6 +19,7 @@ class Zoom::SecurityProfile::UnsafeJava < Zoom::SecurityProfile
19
19
  "|",
20
20
  "(",
21
21
  [
22
+ "\\.exec",
22
23
  "\\.getRuntime",
23
24
  "readObject",
24
25
  "Runtime"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-zoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.5
4
+ version: 4.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-15 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest