samovar 1.3.1 → 1.3.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/.travis.yml +2 -0
- data/lib/samovar/command/system.rb +13 -20
- data/lib/samovar/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: 56d509ee1dea894df84d6608f53cca96e041ab70
|
4
|
+
data.tar.gz: 124f5d28a3803f1761fdfc95cef1b0937d540d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4bf6dcd11d85548541414474527260d7bcbb00beb09eecba2b5b3c1ac16570a57d67f9bb89bdb4f9d39cd08b3417e04c07224aedc8bf63136a424552b65c89f
|
7
|
+
data.tar.gz: 97cd3bb02b891588dfce1f5e61b62f8604190d5b780238ef1b822afe8772bc155530bd4192a7d859c8c9d10fb45f07f75d01c2ea984b91cb6165639c5fc131a2
|
data/.travis.yml
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
require 'time'
|
22
|
+
require 'shellwords'
|
22
23
|
|
23
24
|
module Samovar
|
24
25
|
class SystemError < RuntimeError
|
@@ -26,35 +27,27 @@ module Samovar
|
|
26
27
|
|
27
28
|
class Command
|
28
29
|
def system(*args, **options)
|
29
|
-
|
30
|
+
log_system(args, options)
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
puts Rainbow(command_line).color(:blue)
|
34
|
-
|
35
|
-
status = Process.waitpid2(pid).last
|
36
|
-
|
37
|
-
return status.success?
|
32
|
+
Kernel::system(*args, **options)
|
38
33
|
rescue Errno::ENOENT
|
39
34
|
return false
|
40
35
|
end
|
41
36
|
|
42
37
|
def system!(*args, **options)
|
43
|
-
|
44
|
-
|
45
|
-
pid = Process.spawn(*args, **options)
|
46
|
-
|
47
|
-
puts Rainbow(command_line).color(:blue)
|
48
|
-
|
49
|
-
status = Process.waitpid2(pid).last
|
50
|
-
|
51
|
-
if status.success?
|
38
|
+
if system(*args, **options)
|
52
39
|
return true
|
53
40
|
else
|
54
|
-
raise SystemError.new("Command #{
|
41
|
+
raise SystemError.new("Command #{args.first.inspect} failed: #{$?.to_s}")
|
55
42
|
end
|
56
|
-
|
57
|
-
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def log_system(args, options)
|
48
|
+
# Print out something half-decent:
|
49
|
+
command_line = Shellwords.join(args)
|
50
|
+
puts Rainbow(command_line).color(:blue)
|
58
51
|
end
|
59
52
|
end
|
60
53
|
end
|
data/lib/samovar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samovar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mapping
|