qbash 0.0.6 → 0.0.7

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: ddc357961a48953ee7c479583b6d648d9ad34873510e7ef6d8096a7bd8e596b5
4
- data.tar.gz: 16dfe814c412365131380e239a93e90532419ece6e66fb3ce0c74bf6566cae5b
3
+ metadata.gz: 413276b3af88e8343fc3a872a6c41141525cf5a9977e4a78bf4f51954f949ef9
4
+ data.tar.gz: 2dccf907789c415829801f0fc3c6caec76a19e98fb2f86009c56e2097778d7c3
5
5
  SHA512:
6
- metadata.gz: 15ae921b000efb256d6907b1b69cda9e60a63612d25eccab76b09f0c765d6aa9d1337ed43580b3bf18cfd84a73e69b4f16aaad62065c8df9644a87779c0d8485
7
- data.tar.gz: 6de449a43159e54803266ca16cb960bd09772abbb9a33ad3b5fa77fa25be63cef6e38fa0edb003c342e2c495bfd37b98035365aa76a9a2b9271d99385498ac96
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.6'
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')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qbash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko