arcanus 1.0.1 → 1.1.0

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: b146a9b3338ba45ffa36c1d34b1aeadd01b56aab
4
- data.tar.gz: 1780db87e7ad473c8e76083dadb9d8a4859f6b68
3
+ metadata.gz: caa551eb9873f619f5b09832d491fab87a44feda
4
+ data.tar.gz: 24e3149808a4fbdd17a5700cdadf88f2d662680a
5
5
  SHA512:
6
- metadata.gz: a82dcb333535d7f4be08bbfff0fd4be560460829f0d51eb194bf3b608d00c15b0a40591e990bad74818e1429bfa84de60efe93c511e5a86ace0d4a9d792fac81
7
- data.tar.gz: 973ec260539472a58665e31e3e799d30e05b1dfe62b6a4c5a23991e7db094b215bdf8390b2098e1eecef65211401f75fd975b6fa605a4acb237b960300694ffa
6
+ metadata.gz: 37867bf501bceeca3527687ef2ad06fc8cfb5a91faf28a2578045252ec9368a6319e7414c569661be69f016f06421a46ff945f8fa958db8b4c86c8b7a78272b7
7
+ data.tar.gz: 2d51e166a2819307dfbe2ee7f60261e10bd264908735e83d78fe1fb4b3bb4adaa6eef4941c162e8938be10f18e6ba1deb8d24a15cd0941ab1842197c0a2b9292
@@ -75,13 +75,5 @@ module Arcanus::Command
75
75
  def repo
76
76
  @repo ||= Arcanus::Repo.new
77
77
  end
78
-
79
- # Execute a process and return the result including status and output.
80
- #
81
- # @param args [Array<String>]
82
- # @return [#status, #stdout, #stderr]
83
- def spawn(args)
84
- Arcanus::Subprocess.spawn(args)
85
- end
86
78
  end
87
79
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Arcanus
5
- VERSION = '1.0.1'.freeze
5
+ VERSION = '1.1.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcanus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brigade Engineering
@@ -11,20 +11,6 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2017-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: childprocess
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: 0.6.3
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: 0.6.3
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: diffy
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -83,7 +69,6 @@ files:
83
69
  - lib/arcanus/key.rb
84
70
  - lib/arcanus/output.rb
85
71
  - lib/arcanus/repo.rb
86
- - lib/arcanus/subprocess.rb
87
72
  - lib/arcanus/ui.rb
88
73
  - lib/arcanus/utils.rb
89
74
  - lib/arcanus/version.rb
@@ -1,53 +0,0 @@
1
- require 'childprocess'
2
- require 'tempfile'
3
-
4
- module Arcanus
5
- # Manages execution of a child process, collecting the exit status and
6
- # standard out/error output.
7
- class Subprocess
8
- # Encapsulates the result of a process.
9
- #
10
- # @attr_reader status [Integer] exit status code returned by process
11
- # @attr_reader stdout [String] standard output stream output
12
- # @attr_reader stderr [String] standard error stream output
13
- Result = Struct.new(:status, :stdout, :stderr) do
14
- def success?
15
- status == 0
16
- end
17
- end
18
-
19
- class << self
20
- # Spawns a new process using the given array of arguments (the first
21
- # element is the command).
22
- #
23
- # @param args [Array<String>]
24
- # @return [Result]
25
- def spawn(args)
26
- process = ChildProcess.build(*args)
27
-
28
- out, err = assign_output_streams(process)
29
-
30
- process.start
31
- process.wait
32
-
33
- err.rewind
34
- out.rewind
35
-
36
- Result.new(process.exit_code, out.read, err.read)
37
- end
38
-
39
- private
40
-
41
- # @param process [ChildProcess]
42
- # @return [Array<IO>]
43
- def assign_output_streams(process)
44
- %w[out err].map do |stream_name|
45
- ::Tempfile.new(stream_name).tap do |stream|
46
- stream.sync = true
47
- process.io.send("std#{stream_name}=", stream)
48
- end
49
- end
50
- end
51
- end
52
- end
53
- end