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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b532893c1bae2db948ec51a710f0da4b0085eabdeffed8846f957a6b4db4fefa
4
- data.tar.gz: 1dcc6028c1008ffb86f38bce950a0b1230bfa79360ffc0bba78d1a5874ac7df7
3
+ metadata.gz: 3755b79234e3c33b89c36428590015bcd56c76ffc666993d95bcc6578d7326b3
4
+ data.tar.gz: 34d14ecd4c85fe8fb3a9e8ae4e7980dfa0a09d1c216bfe47953056835d569610
5
5
  SHA512:
6
- metadata.gz: 0a46eafb339d8a1e7f3fd3e96aa0097fbe935dafaa1dbefacf52b6b6646784d9542ba673b2530b342c141a6e1b94694653cab2d2679f3216143c647ec787bee9
7
- data.tar.gz: 19315bf79e83ba2ee87bfca164d2a97dc79e287eabe3a5de07c89943447ce9035f23f346d70f119f9d0e6ddd32373b822359dcf63bed65ae4c7e5645b4f922b9
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.current_profile_name})> ".white
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.get_profiles
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.current_profile_name)
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.default_config # Redundant
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.current_profile_name
383
- profile = zoom.config.get_profiles[name]
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.current_profile_name})> ".white
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.get_profiles
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.current_profile_name)
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.default_config # Redundant
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.current_profile_name
383
- profile = zoom.config.get_profiles[name]
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.current_profile_name})> ".white
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.get_profiles
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.current_profile_name)
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.default_config # Redundant
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.current_profile_name
383
- profile = zoom.config.get_profiles[name]
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.current_profile_name})> ".white
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.get_profiles
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.current_profile_name)
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.default_config # Redundant
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.current_profile_name
383
- profile = zoom.config.get_profiles[name]
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.current_profile_name})> ".white
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.get_profiles
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.current_profile_name)
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.default_config # Redundant
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.current_profile_name
383
- profile = zoom.config.get_profiles[name]
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.current_profile_name})> ".white
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.get_profiles
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.current_profile_name)
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.default_config # Redundant
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.current_profile_name
383
- profile = zoom.config.get_profiles[name]
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)
@@ -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.current_profile_name
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.editor).open(results)
96
+ Zoom::Editor.new(@config.get_editor).open(results)
97
97
  end
98
98
 
99
99
  def repeat(shortcut = true)
@@ -13,11 +13,14 @@ class Zoom::Cache
13
13
  end
14
14
 
15
15
  def clear
16
- @cache_file.delete if (@cache_file.exist?)
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?
@@ -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 = get("profiles")
18
+ profiles = parse_profiles
8
19
  Zoom::ProfileManager::security_profiles.each do |profile|
9
20
  profiles[profile.name] = profile
10
21
  end
11
- set("profiles", profiles)
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 get("profiles").has_key?(name)
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
- color_filename.split(".").inject(str, :send)
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
- color_lineno.split(".").inject(str, :send)
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
- color_match.split(".").inject(str, :send)
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
- color_tag.split(".").inject(str, :send)
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 ||= "~/.zoomrc"
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 get_profiles(false)[name]
67
+ return parse_profiles(false)[name]
128
68
  end
129
69
 
130
70
  def get_profile_names
131
- return get("profiles").keys.sort do |a, b|
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 get_profiles(display_error = true)
76
+ def parse_profiles(display_error = true)
137
77
  profiles = Hash.new
138
- get("profiles").each do |name, prof|
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 set_profiles(profiles)
149
- set("profiles", profiles)
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
- color_filename
164
- color_lineno
165
- color_match
166
- color_tag
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
@@ -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)
@@ -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.get_profiles
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
@@ -23,9 +23,9 @@ class ColorWish < Djinni::Wish
23
23
 
24
24
  case f
25
25
  when "off"
26
- config.hilight(false)
26
+ config.no_hilight
27
27
  when "on"
28
- config.hilight(true)
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("color_#{f}", c)
47
+ config.send("set_color_#{f}", c)
48
48
  end
49
49
  end
50
50
 
@@ -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.get_profiles
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"].get_profiles
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.get_profiles
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.current_profile_name == arg)
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"].get_profiles
28
+ profiles = djinni_env["config"].parse_profiles
29
29
  completions = Hash.new
30
30
 
31
31
  profiles.keys.sort do |a, b|
@@ -33,7 +33,7 @@ class EditWish < Djinni::Wish
33
33
  end
34
34
  end
35
35
 
36
- profiles = config.get_profiles
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"].get_profiles
83
+ profiles = djinni_env["config"].parse_profiles
84
84
  completions = Hash.new
85
85
 
86
86
  profiles.keys.sort do |a, b|
@@ -15,7 +15,7 @@ class EditorWish < Djinni::Wish
15
15
  return
16
16
  end
17
17
 
18
- djinni_env["config"].editor(args)
18
+ djinni_env["config"].use_editor(args)
19
19
  end
20
20
 
21
21
  def usage
@@ -21,14 +21,16 @@ class ListWish < Djinni::Wish
21
21
 
22
22
  case input
23
23
  when "la"
24
- profiles = config.get_profiles
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.get_profiles[config.current_profile_name]
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.get_profiles
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.current_profile_name == old)
33
- config.current_profile_name(new)
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"].get_profiles
48
+ profiles = djinni_env["config"].parse_profiles
49
49
  completions = Hash.new
50
50
 
51
51
  profiles.keys.sort do |a, b|
@@ -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.default_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.current_profile_name
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)
@@ -22,7 +22,7 @@ class UseWish < Djinni::Wish
22
22
  return
23
23
  end
24
24
 
25
- config.current_profile_name(args)
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"].get_profiles
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.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-09 00:00:00.000000000 Z
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.1
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.1
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.1'
59
+ version: '2.2'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 2.2.1
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.1'
69
+ version: '2.2'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 2.2.1
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.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.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.2.0
119
+ version: 1.0.0
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: '0.2'
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.2.0
129
+ version: 1.0.0
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '0.2'
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.1.6
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.1.6
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