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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3070cbdb75798f0de4ffe24bce2003b8e549babf
4
- data.tar.gz: 51353ddfd9d8657312fb89db48ca98c9f670afe8
3
+ metadata.gz: 56d509ee1dea894df84d6608f53cca96e041ab70
4
+ data.tar.gz: 124f5d28a3803f1761fdfc95cef1b0937d540d44
5
5
  SHA512:
6
- metadata.gz: '088de4b61f52e89c1579febedfc1398425eca8d21751ee5d28d748b2e93d4f135dfc9020c299933234778095da3874d2591ff1e4fcbab38cf7a95e44566fa9d9'
7
- data.tar.gz: 95dd49ac603de4967f711ae38ecd8d86f74cf8bf5caac5899c5d8553689114d954c1cd8f3bd0833e92eacb1d56b6384eee2be3631a9603a0910348a49260bd6b
6
+ metadata.gz: d4bf6dcd11d85548541414474527260d7bcbb00beb09eecba2b5b3c1ac16570a57d67f9bb89bdb4f9d39cd08b3417e04c07224aedc8bf63136a424552b65c89f
7
+ data.tar.gz: 97cd3bb02b891588dfce1f5e61b62f8604190d5b780238ef1b822afe8772bc155530bd4192a7d859c8c9d10fb45f07f75d01c2ea984b91cb6165639c5fc131a2
data/.travis.yml CHANGED
@@ -6,10 +6,12 @@ rvm:
6
6
  - 2.3.0
7
7
  - 2.4.0
8
8
  - ruby-head
9
+ - jruby-head
9
10
  - rbx-2
10
11
  env: COVERAGE=true
11
12
  matrix:
12
13
  fast_finish: true
13
14
  allow_failures:
15
+ - rvm: jruby-head
14
16
  - rvm: ruby-head
15
17
  - rvm: "rbx-2"
@@ -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
- command_line = args.join(' ')
30
+ log_system(args, options)
30
31
 
31
- pid = Process.spawn(*args, **options)
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
- command_line = args.join(' ')
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 #{command_line.dump} failed: #{status.to_s}")
41
+ raise SystemError.new("Command #{args.first.inspect} failed: #{$?.to_s}")
55
42
  end
56
- rescue Errno::ENOENT
57
- raise SystemError.new("Command #{command_line.dump} failed: #{$!}")
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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Samovar
22
- VERSION = "1.3.1"
22
+ VERSION = "1.3.2"
23
23
  end
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.1
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-06 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mapping