ruby-zoom 3.4.0 → 3.5.0

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.
Files changed (10) hide show
  1. checksums.yaml +4 -4
  2. data/bin/z +9 -1
  3. data/bin/zc +9 -1
  4. data/bin/zf +9 -1
  5. data/bin/zg +9 -1
  6. data/bin/zl +9 -1
  7. data/bin/zr +9 -1
  8. data/lib/zoom.rb +4 -2
  9. data/lib/zoom/profile.rb +8 -1
  10. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b0167d84e86358ed277f8967bdb634e3038b4f3
4
- data.tar.gz: 20c8158ecff707794d5711caeea8f305b930f46d
3
+ metadata.gz: 517419dd8be17242c6cfc38d97135a8ddfec8aa7
4
+ data.tar.gz: df6fbd65cf6a222d5b1563ea00b546142ffea688
5
5
  SHA512:
6
- metadata.gz: d16ae4eca8e12c6ce49a31e9a6f054e53bc9126f30b0e71640b0f7587ffebf1c4586a1bfc759dc14ec4bcf7282a45607235dcee0a89e185047743af1ba308f45
7
- data.tar.gz: 8b1e9e636145a1c4ab3823a6b7772e948171ed890e592e67b1834e6bfce7dad03d460d3371cf5eea4c551a1d31910711bbdb02ad194fe2dd3db6d2e154bd4b47
6
+ metadata.gz: 94e7090be2059ec13abf0b4ef1f766b23ec52ab2612a87f413afa17405670222fdac7efc38042622f65ec398e29c6a3be466206a91dc28574c33201c0d017be9
7
+ data.tar.gz: d5a75653eb943b6c3211f218d42b154d9c15198647a45e5574a62f2508ec0e44748685d15b8f6b45b496a3c8111014a1f61a0c69e650d9e61fac8054da686626
data/bin/z CHANGED
@@ -14,6 +14,7 @@ end
14
14
  def parse(args)
15
15
  options = Hash.new
16
16
  options["action"] = "exec"
17
+ options["cache_file"] = nil
17
18
  options["use"] = nil
18
19
 
19
20
  info = "Do you like to search through code using ag, ack, or " \
@@ -46,6 +47,13 @@ def parse(args)
46
47
  options["action"] = "cache"
47
48
  end
48
49
 
50
+ opts.on(
51
+ "--cache-file=FILE",
52
+ "Use the specified cache file"
53
+ ) do |file|
54
+ options["cache_file"] = file
55
+ end
56
+
49
57
  opts.on(
50
58
  "-d",
51
59
  "--delete=NAME",
@@ -200,7 +208,7 @@ end
200
208
 
201
209
  options = parse(ARGV)
202
210
 
203
- zoom = Zoom.new
211
+ zoom = Zoom.new(options["cache_file"])
204
212
  begin
205
213
  case options["action"]
206
214
  when "add"
data/bin/zc CHANGED
@@ -14,6 +14,7 @@ end
14
14
  def parse(args)
15
15
  options = Hash.new
16
16
  options["action"] = "exec"
17
+ options["cache_file"] = nil
17
18
  options["use"] = nil
18
19
 
19
20
  info = "Do you like to search through code using ag, ack, or " \
@@ -46,6 +47,13 @@ def parse(args)
46
47
  options["action"] = "cache"
47
48
  end
48
49
 
50
+ opts.on(
51
+ "--cache-file=FILE",
52
+ "Use the specified cache file"
53
+ ) do |file|
54
+ options["cache_file"] = file
55
+ end
56
+
49
57
  opts.on(
50
58
  "-d",
51
59
  "--delete=NAME",
@@ -200,7 +208,7 @@ end
200
208
 
201
209
  options = parse(ARGV)
202
210
 
203
- zoom = Zoom.new
211
+ zoom = Zoom.new(options["cache_file"])
204
212
  begin
205
213
  case options["action"]
206
214
  when "add"
data/bin/zf CHANGED
@@ -14,6 +14,7 @@ end
14
14
  def parse(args)
15
15
  options = Hash.new
16
16
  options["action"] = "exec"
17
+ options["cache_file"] = nil
17
18
  options["use"] = nil
18
19
 
19
20
  info = "Do you like to search through code using ag, ack, or " \
@@ -46,6 +47,13 @@ def parse(args)
46
47
  options["action"] = "cache"
47
48
  end
48
49
 
50
+ opts.on(
51
+ "--cache-file=FILE",
52
+ "Use the specified cache file"
53
+ ) do |file|
54
+ options["cache_file"] = file
55
+ end
56
+
49
57
  opts.on(
50
58
  "-d",
51
59
  "--delete=NAME",
@@ -200,7 +208,7 @@ end
200
208
 
201
209
  options = parse(ARGV)
202
210
 
203
- zoom = Zoom.new
211
+ zoom = Zoom.new(options["cache_file"])
204
212
  begin
205
213
  case options["action"]
206
214
  when "add"
data/bin/zg CHANGED
@@ -14,6 +14,7 @@ end
14
14
  def parse(args)
15
15
  options = Hash.new
16
16
  options["action"] = "exec"
17
+ options["cache_file"] = nil
17
18
  options["use"] = nil
18
19
 
19
20
  info = "Do you like to search through code using ag, ack, or " \
@@ -46,6 +47,13 @@ def parse(args)
46
47
  options["action"] = "cache"
47
48
  end
48
49
 
50
+ opts.on(
51
+ "--cache-file=FILE",
52
+ "Use the specified cache file"
53
+ ) do |file|
54
+ options["cache_file"] = file
55
+ end
56
+
49
57
  opts.on(
50
58
  "-d",
51
59
  "--delete=NAME",
@@ -200,7 +208,7 @@ end
200
208
 
201
209
  options = parse(ARGV)
202
210
 
203
- zoom = Zoom.new
211
+ zoom = Zoom.new(options["cache_file"])
204
212
  begin
205
213
  case options["action"]
206
214
  when "add"
data/bin/zl CHANGED
@@ -14,6 +14,7 @@ end
14
14
  def parse(args)
15
15
  options = Hash.new
16
16
  options["action"] = "exec"
17
+ options["cache_file"] = nil
17
18
  options["use"] = nil
18
19
 
19
20
  info = "Do you like to search through code using ag, ack, or " \
@@ -46,6 +47,13 @@ def parse(args)
46
47
  options["action"] = "cache"
47
48
  end
48
49
 
50
+ opts.on(
51
+ "--cache-file=FILE",
52
+ "Use the specified cache file"
53
+ ) do |file|
54
+ options["cache_file"] = file
55
+ end
56
+
49
57
  opts.on(
50
58
  "-d",
51
59
  "--delete=NAME",
@@ -200,7 +208,7 @@ end
200
208
 
201
209
  options = parse(ARGV)
202
210
 
203
- zoom = Zoom.new
211
+ zoom = Zoom.new(options["cache_file"])
204
212
  begin
205
213
  case options["action"]
206
214
  when "add"
data/bin/zr CHANGED
@@ -14,6 +14,7 @@ end
14
14
  def parse(args)
15
15
  options = Hash.new
16
16
  options["action"] = "exec"
17
+ options["cache_file"] = nil
17
18
  options["use"] = nil
18
19
 
19
20
  info = "Do you like to search through code using ag, ack, or " \
@@ -46,6 +47,13 @@ def parse(args)
46
47
  options["action"] = "cache"
47
48
  end
48
49
 
50
+ opts.on(
51
+ "--cache-file=FILE",
52
+ "Use the specified cache file"
53
+ ) do |file|
54
+ options["cache_file"] = file
55
+ end
56
+
49
57
  opts.on(
50
58
  "-d",
51
59
  "--delete=NAME",
@@ -200,7 +208,7 @@ end
200
208
 
201
209
  options = parse(ARGV)
202
210
 
203
- zoom = Zoom.new
211
+ zoom = Zoom.new(options["cache_file"])
204
212
  begin
205
213
  case options["action"]
206
214
  when "add"
@@ -221,8 +221,10 @@ class Zoom
221
221
  end
222
222
  private :get_new_value
223
223
 
224
- def initialize
225
- @cache_file = Pathname.new("~/.zoom_cache").expand_path
224
+ def initialize(cache_file = nil)
225
+ cache_file ||= "~/.zoom_cache"
226
+ Zoom::Profile.cache_file(cache_file)
227
+ @cache_file = Pathname.new(cache_file).expand_path
226
228
  @info_file = Pathname.new("~/.zoominfo").expand_path
227
229
  @rc_file = Pathname.new("~/.zoomrc").expand_path
228
230
  @shortcut_file = Pathname.new("~/.zoom_shortcuts").expand_path
@@ -6,11 +6,18 @@ class Zoom::Profile < Hash
6
6
  attr_accessor :immutable
7
7
  attr_accessor :taggable
8
8
 
9
+ @@cache_file = "~/.zoom_cache"
10
+
9
11
  def append(append = nil)
10
12
  self["append"] = append if (append)
11
13
  return self["append"]
12
14
  end
13
15
 
16
+ def self.cache_file(cache_file)
17
+ @@cache_file = cache_file
18
+ @@cache_file ||= "~/.zoom_cache"
19
+ end
20
+
14
21
  def colors
15
22
  # TODO color support
16
23
  ""
@@ -63,7 +70,7 @@ class Zoom::Profile < Hash
63
70
  self.operator(operator)
64
71
 
65
72
  @immutable = false
66
- @pager = "z --pager"
73
+ @pager = "z --pager --cache-file #{@@cache_file}"
67
74
  @taggable = false
68
75
  end
69
76
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-zoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker