shells 0.1.12 → 0.1.13
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.
- checksums.yaml +4 -4
- data/lib/shells/bash_common.rb +19 -0
- data/lib/shells/shell_base.rb +10 -4
- data/lib/shells/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7ae14a70d9a7a00a245ea4ae19094bed8e1677b
|
4
|
+
data.tar.gz: 762e167c5daca6b2e378fd74a1bd540804949550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35c3b0460654bf793e01c0bf38723f3263c08a07eac6c4c11a6b7a8ad1196125dd5704521cb2643ce8bf5c68776619e5f7192dc0de4c75b8208006494baa1a3c
|
7
|
+
data.tar.gz: 499fc9f2ca47528ed82223606b18dff28a78d1ec8eab57bd3874b722c4d38ea877febe3ed7b84421da2873accc479a9cab873e18917d53802b966b622e619419
|
data/lib/shells/bash_common.rb
CHANGED
@@ -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
|
|
data/lib/shells/shell_base.rb
CHANGED
@@ -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
|
#
|
data/lib/shells/version.rb
CHANGED
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.
|
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.
|
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.
|