qbash 0.2.1 → 0.2.2
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 +7 -3
- 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: 83183014aa9cde18aa4c0924665c2f1d18940d4f4ff64a66602a0ba973aa1aa0
|
|
4
|
+
data.tar.gz: 69881b928dbf2526c9e89542620d27d1cc90ffde48dd369ed2dfbe4051c0e724
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4800029b521eb3372ca256ccb874b816207d589753977ede31afb293b9922e7ab477057fdeaca94aa435e0e8ecb47a677fd2e6be39c14a7aacbd0f14aad1d07
|
|
7
|
+
data.tar.gz: 0d87c04e4f0e2d85b1208da0824161d6c720a39268e1e3838791d2776b41a331c0f6086429d680ddf1c46429db4b2fb3e211aeac50ef175c9804057a491b6db9
|
data/lib/qbash.rb
CHANGED
|
@@ -50,7 +50,7 @@ module Kernel
|
|
|
50
50
|
# @param [String] cmd The command to run, for example +echo "Hello, world!"+
|
|
51
51
|
# @param [String] stdin The +stdin+ to provide to the command
|
|
52
52
|
# @param [Hash] env Hash of environment variables
|
|
53
|
-
# @param [Loog|IO] log Logging facility with +.debug()+ method (or +$stdout+)
|
|
53
|
+
# @param [Loog|IO] log Logging facility with +.debug()+ method (or +$stdout+, or nil if should go to +/dev/null+)
|
|
54
54
|
# @param [Array] accept List of accepted exit codes (accepts all if the list is +nil+)
|
|
55
55
|
# @param [Boolean] both If set to TRUE, the function returns an array +(stdout, code)+
|
|
56
56
|
# @param [Integer] level Logging level (use +Logger::DEBUG+, +Logger::INFO+, +Logger::WARN+, or +Logger::ERROR+)
|
|
@@ -71,7 +71,9 @@ module Kernel
|
|
|
71
71
|
else
|
|
72
72
|
raise "Unknown log level #{level}"
|
|
73
73
|
end
|
|
74
|
-
if log.
|
|
74
|
+
if log.nil?
|
|
75
|
+
# nothing to print
|
|
76
|
+
elsif log.respond_to?(mtd)
|
|
75
77
|
log.__send__(mtd, "+ #{cmd}")
|
|
76
78
|
else
|
|
77
79
|
log.print("+ #{cmd}\n")
|
|
@@ -90,7 +92,9 @@ module Kernel
|
|
|
90
92
|
rescue IOError => e
|
|
91
93
|
ln = Backtrace.new(e).to_s
|
|
92
94
|
end
|
|
93
|
-
if log.
|
|
95
|
+
if log.nil?
|
|
96
|
+
# no logging
|
|
97
|
+
elsif log.respond_to?(mtd)
|
|
94
98
|
log.__send__(mtd, ln)
|
|
95
99
|
else
|
|
96
100
|
log.print("#{ln}\n")
|
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.2.
|
|
29
|
+
s.version = '0.2.2'
|
|
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