ruby-zoom 3.1.5 → 3.2.0

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: 1b49bc0a0df6aaa12fdff61147accaa25bd8223b
4
- data.tar.gz: c4b11d42ca20f242dfa4b942ec308896ffee5a5f
3
+ metadata.gz: e066194536e36c82139cf680bcf3b7fcb35e5787
4
+ data.tar.gz: 3ed2196ca2c49ddfb4958b1c519416091041e0d5
5
5
  SHA512:
6
- metadata.gz: f5e0fa4e55cebd7f7941fe9263df06b065fe602da710cfbcbcff3cd929670e5b8f2989885c5efe1d39c07d4a0517aa7c0937d834a070fb9cfb6a5a1f8937f210
7
- data.tar.gz: e20561ae2dbd6304139c6dcc37bb34c155dda35a5749ec4241f2642782d6befe304f188e83feb59979ad38cb4a0ef8b9ddaff57034a7f91667fab2ae89a742a3
6
+ metadata.gz: 9195ae177d3f28ed280e8b682829ba24b1278179c3ccf4cfa860532d67793d9e92e71f00e24d90fb868a7536d3573a5ee1b4e3bc880334da36969f240131bc80
7
+ data.tar.gz: 037b00f17a8ac1ae1a980bf2881ac5970e387cfe9072ccc47d722ab4a689fe086b5b212da75677228234218e5712562944f6dcef7c3e24dc96f23e8a507d8847
data/lib/zoom.rb CHANGED
@@ -21,14 +21,14 @@ class Zoom
21
21
  append = nil
22
22
  )
23
23
  if (@profiles.has_key?(name))
24
- raise Zoom::ProfileAlreadyExistsError.new(name)
24
+ raise Zoom::Error::ProfileAlreadyExistsError.new(name)
25
25
  end
26
26
 
27
27
  default_class = nil
28
28
  begin
29
29
  default_class = Zoom::Profile.profile_by_name(clas).new
30
30
  rescue NameError => e
31
- raise Zoom::ProfileClassUnknownError.new(clas)
31
+ raise Zoom::Error::ProfileClassUnknownError.new(clas)
32
32
  end
33
33
 
34
34
  edit_profile(
@@ -48,7 +48,7 @@ class Zoom
48
48
  def configure_editor(editor)
49
49
  e = ScoobyDoo.where_are_you(editor)
50
50
  if (e.nil?)
51
- raise Zoom::ExecutableNotFoundError.new(editor)
51
+ raise Zoom::Error::ExecutableNotFoundError.new(editor)
52
52
  end
53
53
 
54
54
  @rc["editor"] = e
@@ -135,11 +135,11 @@ class Zoom
135
135
 
136
136
  def delete_profile(name)
137
137
  if (!@profiles.has_key?(name))
138
- raise Zoom::ProfileDoesNotExistError.new(name)
138
+ raise Zoom::Error::ProfileDoesNotExistError.new(name)
139
139
  end
140
140
 
141
141
  if ((name == "default") || @profiles[name].immutable)
142
- raise Zoom::ProfileCanNotBeModifiedError.new(name)
142
+ raise Zoom::Error::ProfileCanNotBeModifiedError.new(name)
143
143
  end
144
144
 
145
145
  @profiles.delete(name)
@@ -162,11 +162,11 @@ class Zoom
162
162
  profile = @profiles[name] if (profile.nil?)
163
163
 
164
164
  if (profile.nil?)
165
- raise Zoom::ProfileDoesNotExistsError.new(name)
165
+ raise Zoom::Error::ProfileDoesNotExistsError.new(name)
166
166
  end
167
167
 
168
168
  if (profile.immutable)
169
- raise Zoom::ProfileCanNotBeModifiedError.new(name)
169
+ raise Zoom::Error::ProfileCanNotBeModifiedError.new(name)
170
170
  end
171
171
 
172
172
  profile.operator(operator) if (operator)
@@ -182,7 +182,7 @@ class Zoom
182
182
  name = @info["profile"] if (name.nil?)
183
183
 
184
184
  if (!@profiles.has_key?(name))
185
- raise Zoom::ProfileDoesNotExistError.new(name)
185
+ raise Zoom::Error::ProfileDoesNotExistError.new(name)
186
186
  end
187
187
 
188
188
  @info["last_command"] = {
@@ -242,7 +242,7 @@ class Zoom
242
242
 
243
243
  def interactive_add_profile(name)
244
244
  if (@profiles.has_key?(name))
245
- raise Zoom::ProfileAlreadyExistsError.new(name)
245
+ raise Zoom::Error::ProfileAlreadyExistsError.new(name)
246
246
  end
247
247
 
248
248
  default_op = "grep"
@@ -287,11 +287,11 @@ class Zoom
287
287
  profile = @profiles[name] if (profile.nil?)
288
288
 
289
289
  if (profile.nil?)
290
- raise Zoom::ProfileDoesNotExistError.new(name)
290
+ raise Zoom::Error::ProfileDoesNotExistError.new(name)
291
291
  end
292
292
 
293
293
  if (profile.immutable)
294
- raise Zoom::ProfileCanNotBeModifiedError.new(name)
294
+ raise Zoom::Error::ProfileCanNotBeModifiedError.new(name)
295
295
  end
296
296
 
297
297
  # Get new operator
@@ -487,15 +487,15 @@ class Zoom
487
487
  name = @info["profile"] if (name.nil?)
488
488
 
489
489
  if ((name == "default") || (name == "zoom_find"))
490
- raise Zoom::ProfileCanNotBeModifiedError.new(name)
490
+ raise Zoom::Error::ProfileCanNotBeModifiedError.new(name)
491
491
  end
492
492
 
493
493
  if (!@profiles.has_key?(name))
494
- raise Zoom::ProfileDoesNotExistError.new(name)
494
+ raise Zoom::Error::ProfileDoesNotExistError.new(name)
495
495
  end
496
496
 
497
497
  if (@profiles.has_key?(rename))
498
- raise Zoom::ProfileAlreadyExistsError.new(rename)
498
+ raise Zoom::Error::ProfileAlreadyExistsError.new(rename)
499
499
  end
500
500
 
501
501
  @profiles[rename] = @profiles[name]
@@ -594,7 +594,7 @@ class Zoom
594
594
 
595
595
  def switch_profile(name)
596
596
  if (!@profiles.has_key?(name))
597
- raise Zoom::ProfileDoesNotExistError.new(name)
597
+ raise Zoom::Error::ProfileDoesNotExistError.new(name)
598
598
  end
599
599
 
600
600
  @info["profile"] = name
@@ -618,12 +618,7 @@ class Zoom
618
618
  end
619
619
 
620
620
  require "zoom/error"
621
- require "zoom/executable_not_found_error"
622
621
  require "zoom/profile"
623
- require "zoom/profile_already_exists_error"
624
- require "zoom/profile_can_not_be_modified_error"
625
- require "zoom/profile_class_unknown_error"
626
- require "zoom/profile_does_not_exist_error"
627
622
  require "zoom/profile/ack"
628
623
  require "zoom/profile/ag"
629
624
  require "zoom/profile/find"
data/lib/zoom/error.rb CHANGED
@@ -1,2 +1,8 @@
1
1
  class Zoom::Error < RuntimeError
2
2
  end
3
+
4
+ require "zoom/error/executable_not_found_error"
5
+ require "zoom/error/profile_already_exists_error"
6
+ require "zoom/error/profile_can_not_be_modified_error"
7
+ require "zoom/error/profile_class_unknown_error"
8
+ require "zoom/error/profile_does_not_exist_error"
@@ -1,6 +1,6 @@
1
1
  require "zoom/error"
2
2
 
3
- class Zoom::ExecutableNotFoundError < Zoom::Error
3
+ class Zoom::Error::ExecutableNotFoundError < Zoom::Error
4
4
  def initialize(exe)
5
5
  super("Executable #{exe} not found!")
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require "zoom/error"
2
2
 
3
- class Zoom::ProfileAlreadyExistsError < Zoom::Error
3
+ class Zoom::Error::ProfileAlreadyExistsError < Zoom::Error
4
4
  def initialize(profile)
5
5
  super("Profile #{profile} already exists!")
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require "zoom/error"
2
2
 
3
- class Zoom::ProfileCanNotBeModifiedError < Zoom::Error
3
+ class Zoom::Error::ProfileCanNotBeModifiedError < Zoom::Error
4
4
  def initialize(profile)
5
5
  super("Profile #{profile} can not be modified!")
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require "zoom/error"
2
2
 
3
- class Zoom::ProfileClassUnknownError < Zoom::Error
3
+ class Zoom::Error::ProfileClassUnknownError < Zoom::Error
4
4
  def initialize(clas)
5
5
  super("Profile class #{clas} unknown!")
6
6
  end
@@ -1,6 +1,6 @@
1
1
  require "zoom/error"
2
2
 
3
- class Zoom::ProfileDoesNotExistError < Zoom::Error
3
+ class Zoom::Error::ProfileDoesNotExistError < Zoom::Error
4
4
  def initialize(profile)
5
5
  super("Profile #{profile} does not exist!")
6
6
  end
data/lib/zoom/profile.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require "scoobydoo"
2
2
  require "shellwords"
3
- require "zoom/profile_class_unknown_error"
3
+ require "zoom/error/profile_class_unknown_error"
4
4
 
5
5
  class Zoom::Profile < Hash
6
6
  attr_accessor :immutable
@@ -34,7 +34,7 @@ class Zoom::Profile < Hash
34
34
  json["append"].nil? ? "" : json["append"]
35
35
  )
36
36
  rescue NameError => e
37
- raise Zoom::ProfileClassUnknownError.new(
37
+ raise Zoom::Error::ProfileClassUnknownError.new(
38
38
  json["class"]
39
39
  )
40
40
  end
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: 3.1.5
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-18 00:00:00.000000000 Z
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -78,17 +78,17 @@ files:
78
78
  - lib/string.rb
79
79
  - lib/zoom.rb
80
80
  - lib/zoom/error.rb
81
- - lib/zoom/executable_not_found_error.rb
81
+ - lib/zoom/error/executable_not_found_error.rb
82
+ - lib/zoom/error/profile_already_exists_error.rb
83
+ - lib/zoom/error/profile_can_not_be_modified_error.rb
84
+ - lib/zoom/error/profile_class_unknown_error.rb
85
+ - lib/zoom/error/profile_does_not_exist_error.rb
82
86
  - lib/zoom/profile.rb
83
87
  - lib/zoom/profile/ack.rb
84
88
  - lib/zoom/profile/ag.rb
85
89
  - lib/zoom/profile/find.rb
86
90
  - lib/zoom/profile/grep.rb
87
91
  - lib/zoom/profile/passwords.rb
88
- - lib/zoom/profile_already_exists_error.rb
89
- - lib/zoom/profile_can_not_be_modified_error.rb
90
- - lib/zoom/profile_class_unknown_error.rb
91
- - lib/zoom/profile_does_not_exist_error.rb
92
92
  homepage: http://mjwhitta.github.io/zoom
93
93
  licenses:
94
94
  - GPL-3.0