qbash 0.0.6 → 0.0.7
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/qbash.rb +1 -1
- data/qbash.gemspec +1 -1
- data/test/test_qbash.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 413276b3af88e8343fc3a872a6c41141525cf5a9977e4a78bf4f51954f949ef9
|
4
|
+
data.tar.gz: 2dccf907789c415829801f0fc3c6caec76a19e98fb2f86009c56e2097778d7c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43bd520c7e65fe1a9124beea490c45fb416927b79399892de8c58ff7ddde1ea65ef9dcf1a5c1e759cec0b8b8037c7378a37559e211d36d6d4f632bb67db43e4d
|
7
|
+
data.tar.gz: bf9eea333fa3f58a275b23e5ee8d8ae899bc4ce28c686ab32e158265b49be6a4b945a81115286b1f0bd7801bb77d900d8e6c88efcde8f64db36dbdb4a9f58101
|
data/lib/qbash.rb
CHANGED
@@ -55,7 +55,7 @@ module Kernel
|
|
55
55
|
# @param [Integer] timeout If it's set to non-NIL, the execution will fail after this number of seconds
|
56
56
|
# @return [String] Everything that was printed to the +stdout+ by the command
|
57
57
|
def qbash(cmd, stdin: '', env: {}, log: Loog::NULL, accept: [0], both: false, timeout: nil)
|
58
|
-
cmd = cmd.join(' ') if cmd.is_a?(Array)
|
58
|
+
cmd = cmd.reject { |a| a.nil? || a.empty? }.join(' ') if cmd.is_a?(Array)
|
59
59
|
if log.respond_to?(:debug)
|
60
60
|
log.debug("+ #{cmd}")
|
61
61
|
else
|
data/qbash.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
27
27
|
s.required_ruby_version = '>=3.2'
|
28
28
|
s.name = 'qbash'
|
29
|
-
s.version = '0.0.
|
29
|
+
s.version = '0.0.7'
|
30
30
|
s.license = 'MIT'
|
31
31
|
s.summary = 'Quick Executor of a BASH Command'
|
32
32
|
s.description =
|
data/test/test_qbash.rb
CHANGED
@@ -48,6 +48,10 @@ class TestQbash < Minitest::Test
|
|
48
48
|
qbash('echo Hello world!', log: $stdout)
|
49
49
|
end
|
50
50
|
|
51
|
+
def test_skip_nil
|
52
|
+
assert_equal('Hi!', qbash(['printf', nil, 'Hi!', '']))
|
53
|
+
end
|
54
|
+
|
51
55
|
def test_with_stdin
|
52
56
|
Dir.mktmpdir do |home|
|
53
57
|
f = File.join(home, 'a b c.txt')
|