shells 0.1.12 → 0.1.13

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: b8ce1479a5f2cf6fb8e8c529c92e74eb01bfb060
4
- data.tar.gz: 81d5db302e9090470be0f6372ab3e5b6d37a5cfc
3
+ metadata.gz: e7ae14a70d9a7a00a245ea4ae19094bed8e1677b
4
+ data.tar.gz: 762e167c5daca6b2e378fd74a1bd540804949550
5
5
  SHA512:
6
- metadata.gz: 27e194bfd7653f47a0bf98fb4e3a9186947df74a5b85947fd3f8677480f81eb857f930a1e96cbd848a5ab2799fa87b6a78c53ac05cdfa92beecae19939a09914
7
- data.tar.gz: 46fd5021248dfe908cdb4c411393c0a972d57bdb2800cdf0ba5663306c42606de7c608bc606e1ca89fd11124fe4315d9a75ee697bf55e454255088d4adae1709
6
+ metadata.gz: 35c3b0460654bf793e01c0bf38723f3263c08a07eac6c4c11a6b7a8ad1196125dd5704521cb2643ce8bf5c68776619e5f7192dc0de4c75b8208006494baa1a3c
7
+ data.tar.gz: 499fc9f2ca47528ed82223606b18dff28a78d1ec8eab57bd3874b722c4d38ea877febe3ed7b84421da2873accc479a9cab873e18917d53802b966b622e619419
@@ -64,6 +64,25 @@ module Shells
64
64
  ret.gsub(sudo_strip, '')
65
65
  end
66
66
 
67
+ ##
68
+ # Executes a command specifically for the exit code.
69
+ #
70
+ # Does not return the output of the command, only the exit code.
71
+ def sudo_exec_for_code(command, options = {}, &block)
72
+ options = (options || {}).merge(retrieve_exit_code: true, on_non_zero_exit_code: :ignore)
73
+ sudo_exec command, options, &block
74
+ last_exit_code
75
+ end
76
+
77
+ ##
78
+ # Executes a command ignoring any exit code.
79
+ #
80
+ # Returns the output of the command and does not even retrieve the exit code.
81
+ def sudo_exec_ignore_code(command, options = {}, &block)
82
+ options = (options || {}).merge(retrieve_exit_code: false, on_non_zero_exit_code: :ignore)
83
+ sudo_exec command, options, &block
84
+ end
85
+
67
86
 
68
87
  protected
69
88
 
@@ -403,7 +403,15 @@ module Shells
403
403
  exec command, options, &block
404
404
  last_exit_code
405
405
  end
406
-
406
+
407
+ ##
408
+ # Executes a command ignoring any exit code.
409
+ #
410
+ # Returns the output of the command and does not even retrieve the exit code.
411
+ def exec_ignore_code(command, options = {}, &block)
412
+ options = (options || {}).merge(retrieve_exit_code: false, on_non_zero_exit_code: :ignore)
413
+ exec command, options, &block
414
+ end
407
415
 
408
416
  ##
409
417
  # Reads from a file on the device.
@@ -419,9 +427,7 @@ module Shells
419
427
 
420
428
 
421
429
  protected
422
-
423
-
424
-
430
+
425
431
  ##
426
432
  # Validates the options provided to the class.
427
433
  #
@@ -1,3 +1,3 @@
1
1
  module Shells
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shells
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beau Barker
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubyforge_project:
156
- rubygems_version: 2.6.11
156
+ rubygems_version: 2.5.2
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: A set of simple shells for interacting with other devices.