ruby-zoom 5.2.2 → 5.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/z +6 -6
- data/bin/zc +6 -6
- data/bin/zf +6 -6
- data/bin/zg +6 -6
- data/bin/zl +6 -6
- data/bin/zr +6 -6
- data/lib/zoom.rb +3 -3
- data/lib/zoom/cache.rb +5 -2
- data/lib/zoom/config.rb +51 -105
- data/lib/zoom/editor.rb +7 -1
- data/lib/zoom/wish/add_wish.rb +1 -1
- data/lib/zoom/wish/color_wish.rb +3 -3
- data/lib/zoom/wish/copy_wish.rb +2 -2
- data/lib/zoom/wish/delete_wish.rb +3 -3
- data/lib/zoom/wish/edit_wish.rb +2 -2
- data/lib/zoom/wish/editor_wish.rb +1 -1
- data/lib/zoom/wish/list_wish.rb +4 -2
- data/lib/zoom/wish/rename_wish.rb +4 -4
- data/lib/zoom/wish/reset_wish.rb +2 -2
- data/lib/zoom/wish/use_wish.rb +2 -2
- metadata +22 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3755b79234e3c33b89c36428590015bcd56c76ffc666993d95bcc6578d7326b3
|
4
|
+
data.tar.gz: 34d14ecd4c85fe8fb3a9e8ae4e7980dfa0a09d1c216bfe47953056835d569610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ddd9c9d48e785a22d0bea94a0b071eb318a3555e7e20168b669f546d2fbeaee29262ba9ca5a68bf13b24910b611ff377fb5fb813242946813877c98133d7d76
|
7
|
+
data.tar.gz: 65d3f32034b839c110f731d5f960a2b48e994e79e4d5366b0522b67e65bf6c39ce8a317a3e4ad094f29e32fe3446c2f3b063ab0b9d4c036728f905f5e707bbc6
|
data/bin/z
CHANGED
@@ -343,7 +343,7 @@ begin
|
|
343
343
|
"prompt_color" => "white",
|
344
344
|
"zoom" => zoom
|
345
345
|
},
|
346
|
-
"zoom(#{zoom.config.
|
346
|
+
"zoom(#{zoom.config.get_current_profile_name})> ".white
|
347
347
|
)
|
348
348
|
when "go"
|
349
349
|
if (options["use"])
|
@@ -351,11 +351,11 @@ begin
|
|
351
351
|
zoom.open(results)
|
352
352
|
end
|
353
353
|
when "list_profiles"
|
354
|
-
profiles = zoom.config.
|
354
|
+
profiles = zoom.config.parse_profiles
|
355
355
|
profiles.keys.sort do |a, b|
|
356
356
|
a.downcase <=> b.downcase
|
357
357
|
end.each do |name|
|
358
|
-
if (name == zoom.config.
|
358
|
+
if (name == zoom.config.get_current_profile_name)
|
359
359
|
print "*".red
|
360
360
|
end
|
361
361
|
|
@@ -374,13 +374,13 @@ begin
|
|
374
374
|
when "repeat"
|
375
375
|
zoom.repeat
|
376
376
|
when "rc"
|
377
|
-
# zoom.config.
|
377
|
+
# zoom.config.default # Redundant
|
378
378
|
zoom.cache.clear
|
379
379
|
when "secprofs"
|
380
380
|
zoom.config.add_security_profiles
|
381
381
|
when "which"
|
382
|
-
name = zoom.config.
|
383
|
-
profile = zoom.config.
|
382
|
+
name = zoom.config.get_current_profile_name
|
383
|
+
profile = zoom.config.get_profile(name)
|
384
384
|
|
385
385
|
lines = profile.to_s.scan(/\S.{0,76}\S(?=\s|$)|\S+/)
|
386
386
|
puts lines.delete_at(0)
|
data/bin/zc
CHANGED
@@ -343,7 +343,7 @@ begin
|
|
343
343
|
"prompt_color" => "white",
|
344
344
|
"zoom" => zoom
|
345
345
|
},
|
346
|
-
"zoom(#{zoom.config.
|
346
|
+
"zoom(#{zoom.config.get_current_profile_name})> ".white
|
347
347
|
)
|
348
348
|
when "go"
|
349
349
|
if (options["use"])
|
@@ -351,11 +351,11 @@ begin
|
|
351
351
|
zoom.open(results)
|
352
352
|
end
|
353
353
|
when "list_profiles"
|
354
|
-
profiles = zoom.config.
|
354
|
+
profiles = zoom.config.parse_profiles
|
355
355
|
profiles.keys.sort do |a, b|
|
356
356
|
a.downcase <=> b.downcase
|
357
357
|
end.each do |name|
|
358
|
-
if (name == zoom.config.
|
358
|
+
if (name == zoom.config.get_current_profile_name)
|
359
359
|
print "*".red
|
360
360
|
end
|
361
361
|
|
@@ -374,13 +374,13 @@ begin
|
|
374
374
|
when "repeat"
|
375
375
|
zoom.repeat
|
376
376
|
when "rc"
|
377
|
-
# zoom.config.
|
377
|
+
# zoom.config.default # Redundant
|
378
378
|
zoom.cache.clear
|
379
379
|
when "secprofs"
|
380
380
|
zoom.config.add_security_profiles
|
381
381
|
when "which"
|
382
|
-
name = zoom.config.
|
383
|
-
profile = zoom.config.
|
382
|
+
name = zoom.config.get_current_profile_name
|
383
|
+
profile = zoom.config.get_profile(name)
|
384
384
|
|
385
385
|
lines = profile.to_s.scan(/\S.{0,76}\S(?=\s|$)|\S+/)
|
386
386
|
puts lines.delete_at(0)
|
data/bin/zf
CHANGED
@@ -343,7 +343,7 @@ begin
|
|
343
343
|
"prompt_color" => "white",
|
344
344
|
"zoom" => zoom
|
345
345
|
},
|
346
|
-
"zoom(#{zoom.config.
|
346
|
+
"zoom(#{zoom.config.get_current_profile_name})> ".white
|
347
347
|
)
|
348
348
|
when "go"
|
349
349
|
if (options["use"])
|
@@ -351,11 +351,11 @@ begin
|
|
351
351
|
zoom.open(results)
|
352
352
|
end
|
353
353
|
when "list_profiles"
|
354
|
-
profiles = zoom.config.
|
354
|
+
profiles = zoom.config.parse_profiles
|
355
355
|
profiles.keys.sort do |a, b|
|
356
356
|
a.downcase <=> b.downcase
|
357
357
|
end.each do |name|
|
358
|
-
if (name == zoom.config.
|
358
|
+
if (name == zoom.config.get_current_profile_name)
|
359
359
|
print "*".red
|
360
360
|
end
|
361
361
|
|
@@ -374,13 +374,13 @@ begin
|
|
374
374
|
when "repeat"
|
375
375
|
zoom.repeat
|
376
376
|
when "rc"
|
377
|
-
# zoom.config.
|
377
|
+
# zoom.config.default # Redundant
|
378
378
|
zoom.cache.clear
|
379
379
|
when "secprofs"
|
380
380
|
zoom.config.add_security_profiles
|
381
381
|
when "which"
|
382
|
-
name = zoom.config.
|
383
|
-
profile = zoom.config.
|
382
|
+
name = zoom.config.get_current_profile_name
|
383
|
+
profile = zoom.config.get_profile(name)
|
384
384
|
|
385
385
|
lines = profile.to_s.scan(/\S.{0,76}\S(?=\s|$)|\S+/)
|
386
386
|
puts lines.delete_at(0)
|
data/bin/zg
CHANGED
@@ -343,7 +343,7 @@ begin
|
|
343
343
|
"prompt_color" => "white",
|
344
344
|
"zoom" => zoom
|
345
345
|
},
|
346
|
-
"zoom(#{zoom.config.
|
346
|
+
"zoom(#{zoom.config.get_current_profile_name})> ".white
|
347
347
|
)
|
348
348
|
when "go"
|
349
349
|
if (options["use"])
|
@@ -351,11 +351,11 @@ begin
|
|
351
351
|
zoom.open(results)
|
352
352
|
end
|
353
353
|
when "list_profiles"
|
354
|
-
profiles = zoom.config.
|
354
|
+
profiles = zoom.config.parse_profiles
|
355
355
|
profiles.keys.sort do |a, b|
|
356
356
|
a.downcase <=> b.downcase
|
357
357
|
end.each do |name|
|
358
|
-
if (name == zoom.config.
|
358
|
+
if (name == zoom.config.get_current_profile_name)
|
359
359
|
print "*".red
|
360
360
|
end
|
361
361
|
|
@@ -374,13 +374,13 @@ begin
|
|
374
374
|
when "repeat"
|
375
375
|
zoom.repeat
|
376
376
|
when "rc"
|
377
|
-
# zoom.config.
|
377
|
+
# zoom.config.default # Redundant
|
378
378
|
zoom.cache.clear
|
379
379
|
when "secprofs"
|
380
380
|
zoom.config.add_security_profiles
|
381
381
|
when "which"
|
382
|
-
name = zoom.config.
|
383
|
-
profile = zoom.config.
|
382
|
+
name = zoom.config.get_current_profile_name
|
383
|
+
profile = zoom.config.get_profile(name)
|
384
384
|
|
385
385
|
lines = profile.to_s.scan(/\S.{0,76}\S(?=\s|$)|\S+/)
|
386
386
|
puts lines.delete_at(0)
|
data/bin/zl
CHANGED
@@ -343,7 +343,7 @@ begin
|
|
343
343
|
"prompt_color" => "white",
|
344
344
|
"zoom" => zoom
|
345
345
|
},
|
346
|
-
"zoom(#{zoom.config.
|
346
|
+
"zoom(#{zoom.config.get_current_profile_name})> ".white
|
347
347
|
)
|
348
348
|
when "go"
|
349
349
|
if (options["use"])
|
@@ -351,11 +351,11 @@ begin
|
|
351
351
|
zoom.open(results)
|
352
352
|
end
|
353
353
|
when "list_profiles"
|
354
|
-
profiles = zoom.config.
|
354
|
+
profiles = zoom.config.parse_profiles
|
355
355
|
profiles.keys.sort do |a, b|
|
356
356
|
a.downcase <=> b.downcase
|
357
357
|
end.each do |name|
|
358
|
-
if (name == zoom.config.
|
358
|
+
if (name == zoom.config.get_current_profile_name)
|
359
359
|
print "*".red
|
360
360
|
end
|
361
361
|
|
@@ -374,13 +374,13 @@ begin
|
|
374
374
|
when "repeat"
|
375
375
|
zoom.repeat
|
376
376
|
when "rc"
|
377
|
-
# zoom.config.
|
377
|
+
# zoom.config.default # Redundant
|
378
378
|
zoom.cache.clear
|
379
379
|
when "secprofs"
|
380
380
|
zoom.config.add_security_profiles
|
381
381
|
when "which"
|
382
|
-
name = zoom.config.
|
383
|
-
profile = zoom.config.
|
382
|
+
name = zoom.config.get_current_profile_name
|
383
|
+
profile = zoom.config.get_profile(name)
|
384
384
|
|
385
385
|
lines = profile.to_s.scan(/\S.{0,76}\S(?=\s|$)|\S+/)
|
386
386
|
puts lines.delete_at(0)
|
data/bin/zr
CHANGED
@@ -343,7 +343,7 @@ begin
|
|
343
343
|
"prompt_color" => "white",
|
344
344
|
"zoom" => zoom
|
345
345
|
},
|
346
|
-
"zoom(#{zoom.config.
|
346
|
+
"zoom(#{zoom.config.get_current_profile_name})> ".white
|
347
347
|
)
|
348
348
|
when "go"
|
349
349
|
if (options["use"])
|
@@ -351,11 +351,11 @@ begin
|
|
351
351
|
zoom.open(results)
|
352
352
|
end
|
353
353
|
when "list_profiles"
|
354
|
-
profiles = zoom.config.
|
354
|
+
profiles = zoom.config.parse_profiles
|
355
355
|
profiles.keys.sort do |a, b|
|
356
356
|
a.downcase <=> b.downcase
|
357
357
|
end.each do |name|
|
358
|
-
if (name == zoom.config.
|
358
|
+
if (name == zoom.config.get_current_profile_name)
|
359
359
|
print "*".red
|
360
360
|
end
|
361
361
|
|
@@ -374,13 +374,13 @@ begin
|
|
374
374
|
when "repeat"
|
375
375
|
zoom.repeat
|
376
376
|
when "rc"
|
377
|
-
# zoom.config.
|
377
|
+
# zoom.config.default # Redundant
|
378
378
|
zoom.cache.clear
|
379
379
|
when "secprofs"
|
380
380
|
zoom.config.add_security_profiles
|
381
381
|
when "which"
|
382
|
-
name = zoom.config.
|
383
|
-
profile = zoom.config.
|
382
|
+
name = zoom.config.get_current_profile_name
|
383
|
+
profile = zoom.config.get_profile(name)
|
384
384
|
|
385
385
|
lines = profile.to_s.scan(/\S.{0,76}\S(?=\s|$)|\S+/)
|
386
386
|
puts lines.delete_at(0)
|
data/lib/zoom.rb
CHANGED
@@ -19,7 +19,7 @@ class Zoom
|
|
19
19
|
# If no profile name, use the current profile
|
20
20
|
profile_name = header["profile_name"]
|
21
21
|
if (profile_name.empty?)
|
22
|
-
profile_name = @config.
|
22
|
+
profile_name = @config.get_current_profile_name
|
23
23
|
header["profile_name"] = profile_name
|
24
24
|
end
|
25
25
|
|
@@ -88,12 +88,12 @@ class Zoom
|
|
88
88
|
def initialize(cache = nil, rc = nil)
|
89
89
|
@config = Zoom::Config.new(rc)
|
90
90
|
@cache = Zoom::Cache.new(@config, cache)
|
91
|
-
@@hilight = @config.hilight
|
91
|
+
@@hilight = @config.hilight?
|
92
92
|
end
|
93
93
|
|
94
94
|
def open(results)
|
95
95
|
return if (results.nil? || results.empty?)
|
96
|
-
Zoom::Editor.new(@config.
|
96
|
+
Zoom::Editor.new(@config.get_editor).open(results)
|
97
97
|
end
|
98
98
|
|
99
99
|
def repeat(shortcut = true)
|
data/lib/zoom/cache.rb
CHANGED
@@ -13,11 +13,14 @@ class Zoom::Cache
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def clear
|
16
|
-
|
17
|
-
@results = nil
|
16
|
+
# Kill thread first since it was using the file
|
18
17
|
@thread.kill if (@thread)
|
19
18
|
@thread = nil
|
19
|
+
|
20
|
+
# Delete cache file and reset header and results
|
21
|
+
@cache_file.delete if (@cache_file.exist?)
|
20
22
|
@header = nil
|
23
|
+
@results = nil
|
21
24
|
end
|
22
25
|
|
23
26
|
def empty?
|
data/lib/zoom/config.rb
CHANGED
@@ -3,139 +3,79 @@ require "json_config"
|
|
3
3
|
require "scoobydoo"
|
4
4
|
|
5
5
|
class Zoom::Config < JSONConfig
|
6
|
+
extend JSONConfig::Keys
|
7
|
+
|
8
|
+
add_bool_key("hilight")
|
9
|
+
add_key("color_filename")
|
10
|
+
add_key("color_lineno")
|
11
|
+
add_key("color_match")
|
12
|
+
add_key("color_tag")
|
13
|
+
add_key("current_profile_name")
|
14
|
+
add_key("editor")
|
15
|
+
add_key("profiles")
|
16
|
+
|
6
17
|
def add_security_profiles
|
7
|
-
profiles =
|
18
|
+
profiles = parse_profiles
|
8
19
|
Zoom::ProfileManager::security_profiles.each do |profile|
|
9
20
|
profiles[profile.name] = profile
|
10
21
|
end
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def color(key, value)
|
15
|
-
if (value)
|
16
|
-
validate_color(value)
|
17
|
-
set(key, value)
|
18
|
-
end
|
19
|
-
|
20
|
-
value = get(key)
|
21
|
-
validate_color(value)
|
22
|
-
return value
|
23
|
-
end
|
24
|
-
private :color
|
25
|
-
|
26
|
-
def color_filename(clr = nil)
|
27
|
-
return color("color_filename", clr)
|
28
|
-
end
|
29
|
-
private :color_filename
|
30
|
-
|
31
|
-
def color_lineno(clr = nil)
|
32
|
-
return color("color_lineno", clr)
|
33
|
-
end
|
34
|
-
private :color_lineno
|
35
|
-
|
36
|
-
def color_match(clr = nil)
|
37
|
-
return color("color_match", clr)
|
38
|
-
end
|
39
|
-
private :color_match
|
40
|
-
|
41
|
-
def color_tag(clr = nil)
|
42
|
-
return color("color_tag", clr)
|
43
|
-
end
|
44
|
-
private :color_tag
|
45
|
-
|
46
|
-
def current_profile_name(name = nil)
|
47
|
-
set("current_profile_name", name) if (name)
|
48
|
-
return get("current_profile_name")
|
49
|
-
end
|
50
|
-
|
51
|
-
def default_config
|
52
|
-
default = Zoom::ProfileManager.default_tool
|
53
|
-
profiles = Zoom::ProfileManager.default_profiles
|
54
|
-
|
55
|
-
clear
|
56
|
-
set("color", true)
|
57
|
-
set("color_filename", "green")
|
58
|
-
set("color_lineno", "white")
|
59
|
-
set("color_match", "black.on_white")
|
60
|
-
set("color_tag", "red")
|
61
|
-
set("current_profile_name", default)
|
62
|
-
set("editor", "")
|
63
|
-
set("profiles", profiles)
|
64
|
-
end
|
65
|
-
|
66
|
-
def editor(ed = nil)
|
67
|
-
if (ed && !ed.empty?)
|
68
|
-
e = ed.split(" ")[0]
|
69
|
-
if (ScoobyDoo.where_are_you(e).nil?)
|
70
|
-
raise Zoom::Error::ExecutableNotFound.new(e)
|
71
|
-
end
|
72
|
-
set("editor", ed)
|
73
|
-
end
|
74
|
-
|
75
|
-
e = get("editor")
|
76
|
-
e = ENV["EDITOR"] if (e.nil? || e.empty?)
|
77
|
-
e = "vim" if (e.nil? || e.empty?)
|
78
|
-
|
79
|
-
e, _, f = e.partition(" ")
|
80
|
-
e = ScoobyDoo.where_are_you(e)
|
81
|
-
|
82
|
-
if (e.nil?)
|
83
|
-
e = ScoobyDoo.where_are_you("vi")
|
84
|
-
f = ""
|
85
|
-
end
|
86
|
-
|
87
|
-
raise Zoom::Error::ExecutableNotFound.new("vi") if (e.nil?)
|
88
|
-
|
89
|
-
return "#{e} #{f}".strip
|
22
|
+
set_profiles(profiles)
|
90
23
|
end
|
91
24
|
|
92
25
|
def has_profile?(name)
|
93
|
-
return
|
94
|
-
end
|
95
|
-
|
96
|
-
def hilight(flag = nil)
|
97
|
-
set("color", flag) if (!flag.nil?)
|
98
|
-
return get("color")
|
26
|
+
return profiles? && get_profiles.has_key?(name)
|
99
27
|
end
|
100
28
|
|
101
29
|
def hilight_filename(str)
|
102
|
-
return str if (!hilight)
|
103
|
-
|
30
|
+
return str if (!hilight?)
|
31
|
+
get_color_filename.split(".").inject(str, :send)
|
104
32
|
end
|
105
33
|
|
106
34
|
def hilight_lineno(str)
|
107
|
-
return str if (!hilight)
|
108
|
-
|
35
|
+
return str if (!hilight?)
|
36
|
+
get_color_lineno.split(".").inject(str, :send)
|
109
37
|
end
|
110
38
|
|
111
39
|
def hilight_match(str)
|
112
|
-
return str if (!hilight)
|
113
|
-
|
40
|
+
return str if (!hilight?)
|
41
|
+
get_color_match.split(".").inject(str, :send)
|
114
42
|
end
|
115
43
|
|
116
44
|
def hilight_tag(str)
|
117
|
-
return str if (!hilight)
|
118
|
-
|
45
|
+
return str if (!hilight?)
|
46
|
+
get_color_tag.split(".").inject(str, :send)
|
119
47
|
end
|
120
48
|
|
121
49
|
def initialize(file = nil)
|
122
|
-
file ||= "~/.
|
50
|
+
file ||= "~/.config/zoom/rc"
|
51
|
+
defaultprof = Zoom::ProfileManager.default_tool
|
52
|
+
profiles = Zoom::ProfileManager.default_profiles
|
53
|
+
@defaults = {
|
54
|
+
"color_filename" => "green",
|
55
|
+
"color_lineno" => "white",
|
56
|
+
"color_match" => "black.on_white",
|
57
|
+
"color_tag" => "red",
|
58
|
+
"current_profile_name" => defaultprof,
|
59
|
+
"editor" => nil,
|
60
|
+
"hilight" => true,
|
61
|
+
"profiles" => profiles
|
62
|
+
}
|
123
63
|
super(file)
|
124
64
|
end
|
125
65
|
|
126
66
|
def get_profile(name)
|
127
|
-
return
|
67
|
+
return parse_profiles(false)[name]
|
128
68
|
end
|
129
69
|
|
130
70
|
def get_profile_names
|
131
|
-
return
|
71
|
+
return get_profiles.keys.sort do |a, b|
|
132
72
|
a.downcase <=> b.downcase
|
133
73
|
end
|
134
74
|
end
|
135
75
|
|
136
|
-
def
|
76
|
+
def parse_profiles(display_error = true)
|
137
77
|
profiles = Hash.new
|
138
|
-
|
78
|
+
get_profiles.each do |name, prof|
|
139
79
|
begin
|
140
80
|
profiles[name] = Zoom::Profile.from_json(prof)
|
141
81
|
rescue Zoom::Error => e
|
@@ -145,8 +85,14 @@ class Zoom::Config < JSONConfig
|
|
145
85
|
return profiles
|
146
86
|
end
|
147
87
|
|
148
|
-
def
|
149
|
-
|
88
|
+
def use_editor(editor)
|
89
|
+
if (editor && !editor.empty?)
|
90
|
+
ed, _, _ = editor.partition(" ")
|
91
|
+
if (ScoobyDoo.where_are_you(ed).nil?)
|
92
|
+
raise Zoom::Error::ExecutableNotFound.new(ed)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
set_editor(editor)
|
150
96
|
end
|
151
97
|
|
152
98
|
def validate_color(clr)
|
@@ -160,9 +106,9 @@ class Zoom::Config < JSONConfig
|
|
160
106
|
|
161
107
|
def validate_colors
|
162
108
|
# Validate colors
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
109
|
+
validate_color(get_color_filename)
|
110
|
+
validate_color(get_color_lineno)
|
111
|
+
validate_color(get_color_match)
|
112
|
+
validate_color(get_color_tag)
|
167
113
|
end
|
168
114
|
end
|
data/lib/zoom/editor.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "fileutils"
|
2
2
|
require "io/wait"
|
3
|
+
require "scoobydoo"
|
3
4
|
|
4
5
|
class Zoom::Editor
|
5
6
|
def default(results)
|
@@ -42,7 +43,12 @@ class Zoom::Editor
|
|
42
43
|
private :default
|
43
44
|
|
44
45
|
def initialize(editor)
|
45
|
-
@editor, _, @flags = editor.partition(" ")
|
46
|
+
@editor, _, @flags = editor.partition(" ") if (editor)
|
47
|
+
if (editor.nil?)
|
48
|
+
@editor = ENV["EDITOR"] || "vim"
|
49
|
+
@editor= "vi" if (ScoobyDoo.where_are_you(@editor).nil?)
|
50
|
+
@flags = ""
|
51
|
+
end
|
46
52
|
end
|
47
53
|
|
48
54
|
def open(results)
|
data/lib/zoom/wish/add_wish.rb
CHANGED
@@ -23,7 +23,7 @@ class AddWish < Djinni::Wish
|
|
23
23
|
elsif (!@classes.has_key?(c))
|
24
24
|
puts "Class does not exist: #{c}"
|
25
25
|
else
|
26
|
-
profiles = config.
|
26
|
+
profiles = config.parse_profiles
|
27
27
|
profiles[n] = Zoom::Profile.profile_by_name(c).new(n)
|
28
28
|
config.set_profiles(profiles)
|
29
29
|
end
|
data/lib/zoom/wish/color_wish.rb
CHANGED
@@ -23,9 +23,9 @@ class ColorWish < Djinni::Wish
|
|
23
23
|
|
24
24
|
case f
|
25
25
|
when "off"
|
26
|
-
config.
|
26
|
+
config.no_hilight
|
27
27
|
when "on"
|
28
|
-
config.hilight
|
28
|
+
config.hilight
|
29
29
|
else
|
30
30
|
usage
|
31
31
|
end
|
@@ -44,7 +44,7 @@ class ColorWish < Djinni::Wish
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
config.send("
|
47
|
+
config.send("set_color_#{f}", c)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
data/lib/zoom/wish/copy_wish.rb
CHANGED
@@ -23,7 +23,7 @@ class CopyWish < Djinni::Wish
|
|
23
23
|
elsif (config.has_profile?(new))
|
24
24
|
puts "Profile already exists: #{new}"
|
25
25
|
else
|
26
|
-
profiles = config.
|
26
|
+
profiles = config.parse_profiles
|
27
27
|
profiles[new] = profiles[name].clone
|
28
28
|
profiles[new].name(new)
|
29
29
|
config.set_profiles(profiles)
|
@@ -33,7 +33,7 @@ class CopyWish < Djinni::Wish
|
|
33
33
|
def tab_complete(input, djinni_env = {})
|
34
34
|
return [{}, "", ""] if (input.include?(" "))
|
35
35
|
|
36
|
-
profiles = djinni_env["config"].
|
36
|
+
profiles = djinni_env["config"].parse_profiles
|
37
37
|
completions = Hash.new
|
38
38
|
|
39
39
|
profiles.keys.sort do |a, b|
|
@@ -11,11 +11,11 @@ class DeleteWish < Djinni::Wish
|
|
11
11
|
|
12
12
|
def execute(args, djinni_env = {})
|
13
13
|
config = djinni_env["config"]
|
14
|
-
profiles = config.
|
14
|
+
profiles = config.parse_profiles
|
15
15
|
args.split(" ").each do |arg|
|
16
16
|
if (!config.has_profile?(arg))
|
17
17
|
puts "Profile does not exist: #{arg}"
|
18
|
-
elsif (config.
|
18
|
+
elsif (config.get_current_profile_name == arg)
|
19
19
|
puts "Can't delete current profile: #{arg}"
|
20
20
|
else
|
21
21
|
profiles.delete(arg)
|
@@ -25,7 +25,7 @@ class DeleteWish < Djinni::Wish
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def tab_complete(input, djinni_env = {})
|
28
|
-
profiles = djinni_env["config"].
|
28
|
+
profiles = djinni_env["config"].parse_profiles
|
29
29
|
completions = Hash.new
|
30
30
|
|
31
31
|
profiles.keys.sort do |a, b|
|
data/lib/zoom/wish/edit_wish.rb
CHANGED
@@ -33,7 +33,7 @@ class EditWish < Djinni::Wish
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
profiles = config.
|
36
|
+
profiles = config.parse_profiles
|
37
37
|
profile = profiles[n]
|
38
38
|
|
39
39
|
case f
|
@@ -80,7 +80,7 @@ class EditWish < Djinni::Wish
|
|
80
80
|
n ||= ""
|
81
81
|
|
82
82
|
if (input.nil?)
|
83
|
-
profiles = djinni_env["config"].
|
83
|
+
profiles = djinni_env["config"].parse_profiles
|
84
84
|
completions = Hash.new
|
85
85
|
|
86
86
|
profiles.keys.sort do |a, b|
|
data/lib/zoom/wish/list_wish.rb
CHANGED
@@ -21,14 +21,16 @@ class ListWish < Djinni::Wish
|
|
21
21
|
|
22
22
|
case input
|
23
23
|
when "la"
|
24
|
-
profiles = config.
|
24
|
+
profiles = config.parse_profiles
|
25
25
|
profiles.keys.sort do |a, b|
|
26
26
|
a.downcase <=> b.downcase
|
27
27
|
end.each do |name|
|
28
28
|
print_profile(profiles[name])
|
29
29
|
end
|
30
30
|
else
|
31
|
-
profile = config.
|
31
|
+
profile = config.get_profile(
|
32
|
+
config.get_current_profile_name
|
33
|
+
)
|
32
34
|
print_profile(profile)
|
33
35
|
end
|
34
36
|
end
|
@@ -23,14 +23,14 @@ class RenameWish < Djinni::Wish
|
|
23
23
|
elsif (config.has_profile?(new))
|
24
24
|
puts "Profile already exists: #{new}"
|
25
25
|
else
|
26
|
-
profiles = config.
|
26
|
+
profiles = config.parse_profiles
|
27
27
|
profiles[new] = profiles.delete(old)
|
28
28
|
profiles[new].name(new)
|
29
29
|
config.set_profiles(profiles)
|
30
30
|
|
31
31
|
# Update prompt
|
32
|
-
if (config.
|
33
|
-
config.
|
32
|
+
if (config.get_current_profile_name == old)
|
33
|
+
config.set_current_profile_name(new)
|
34
34
|
prompt_color = djinni_env["prompt_color"]
|
35
35
|
if (prompt_color)
|
36
36
|
prompt = "zoom(#{new})> ".send(prompt_color)
|
@@ -45,7 +45,7 @@ class RenameWish < Djinni::Wish
|
|
45
45
|
def tab_complete(input, djinni_env = {})
|
46
46
|
return [{}, "", ""] if (input.include?(" "))
|
47
47
|
|
48
|
-
profiles = djinni_env["config"].
|
48
|
+
profiles = djinni_env["config"].parse_profiles
|
49
49
|
completions = Hash.new
|
50
50
|
|
51
51
|
profiles.keys.sort do |a, b|
|
data/lib/zoom/wish/reset_wish.rb
CHANGED
@@ -17,13 +17,13 @@ class ResetWish < Djinni::Wish
|
|
17
17
|
|
18
18
|
FileUtils.rm_f(Pathname.new("~/.zoomrc").expand_path)
|
19
19
|
config = djinni_env["config"]
|
20
|
-
config.
|
20
|
+
config.default
|
21
21
|
|
22
22
|
cache = djinni_env["cache"]
|
23
23
|
cache.clear
|
24
24
|
|
25
25
|
# Update prompt
|
26
|
-
default = config.
|
26
|
+
default = config.get_current_profile_name
|
27
27
|
prompt_color = djinni_env["prompt_color"]
|
28
28
|
if (prompt_color)
|
29
29
|
prompt = "zoom(#{default})> ".send(prompt_color)
|
data/lib/zoom/wish/use_wish.rb
CHANGED
@@ -22,7 +22,7 @@ class UseWish < Djinni::Wish
|
|
22
22
|
return
|
23
23
|
end
|
24
24
|
|
25
|
-
config.
|
25
|
+
config.set_current_profile_name(args)
|
26
26
|
|
27
27
|
# Update prompt
|
28
28
|
prompt_color = djinni_env["prompt_color"]
|
@@ -37,7 +37,7 @@ class UseWish < Djinni::Wish
|
|
37
37
|
def tab_complete(input, djinni_env = {})
|
38
38
|
return [{}, "", ""] if (input.include?(" "))
|
39
39
|
|
40
|
-
profiles = djinni_env["config"].
|
40
|
+
profiles = djinni_env["config"].parse_profiles
|
41
41
|
completions = Hash.new
|
42
42
|
|
43
43
|
profiles.keys.sort do |a, b|
|
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: 5.2.
|
4
|
+
version: 5.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '12.3'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 12.3.
|
42
|
+
version: 12.3.2
|
43
43
|
type: :development
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,27 +49,27 @@ dependencies:
|
|
49
49
|
version: '12.3'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 12.3.
|
52
|
+
version: 12.3.2
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: djinni
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '2.
|
59
|
+
version: '2.2'
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 2.2.
|
62
|
+
version: 2.2.4
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '2.
|
69
|
+
version: '2.2'
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 2.2.
|
72
|
+
version: 2.2.4
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: fagin
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '1.
|
99
|
+
version: '1.2'
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: 1.2.3
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '1.
|
109
|
+
version: '1.2'
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 1.2.3
|
@@ -116,40 +116,40 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.
|
119
|
+
version: 1.0.0
|
120
120
|
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: '0
|
122
|
+
version: '1.0'
|
123
123
|
type: :runtime
|
124
124
|
prerelease: false
|
125
125
|
version_requirements: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 0.
|
129
|
+
version: 1.0.0
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '0
|
132
|
+
version: '1.0'
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: scoobydoo
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0.1'
|
140
137
|
- - ">="
|
141
138
|
- !ruby/object:Gem::Version
|
142
|
-
version: 0.
|
139
|
+
version: 1.0.0
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '1.0'
|
143
143
|
type: :runtime
|
144
144
|
prerelease: false
|
145
145
|
version_requirements: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- - "~>"
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0.1'
|
150
147
|
- - ">="
|
151
148
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
149
|
+
version: 1.0.0
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '1.0'
|
153
153
|
description: Do you like to search through code using ag, ack, grep, pt, or rg? Good!
|
154
154
|
This tool is for you! Zoom adds some convenience to grep-like search tools by allowing
|
155
155
|
you to quickly open your search results in your editor of choice. When looking at
|