komenda 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 2cb34089ed4a226b54ad18656b90fdf9dcf81371
4
- data.tar.gz: 33655dec5a7047756c1926891adb2052a8caadd1
3
+ metadata.gz: 9f61bfb2ae2678d1a23fb5730df34bfb4da84246
4
+ data.tar.gz: 389179e3dc70aef14515646e2524d8ee3821fc33
5
5
  SHA512:
6
- metadata.gz: 675c3198a12119c5df9b83db8c56eb0b656b005add010049cd3bb0c681af5a08133534276049bfc53185f178797a1ade4135cbd97cbc771a9e5b90c73947ad17
7
- data.tar.gz: 78c9aee39a103f7bb18dd9f84243bc4328335f323c33d6279df6924c0b83c1b50ec654af64c24907392cc0ce8ac01312053b187f1a56ad89a8ee083b17586922
6
+ metadata.gz: 5d4c8315300bd7b46cf1944cba8fa2484bf28666ae2663da1db0ecd20dce44b06cb21beb85f9866be9bb59c03be14118603bf1d7c31cb83d1d0639459e0a7880
7
+ data.tar.gz: ca3a6b8d2fe921315c931439545bdeb3351d3245975a313e91f8a110a2ed73460912ddf5fcd992dadff780e1754de75e263ed2950f760e998c45ef15d5b28721
@@ -74,19 +74,19 @@ module Komenda
74
74
 
75
75
  # @param [ProcessBuilder] process_builder
76
76
  def run_process(process_builder)
77
- if process_builder.cwd.nil?
78
- run_popen3(process_builder)
79
- else
80
- Dir.chdir(process_builder.cwd) { run_popen3(process_builder) }
81
- end
77
+ opts = {}
78
+ opts[:chdir] = process_builder.cwd unless process_builder.cwd.nil?
79
+ run_popen3(process_builder.env, process_builder.command, opts)
82
80
  rescue Exception => exception
83
81
  emit(:error, exception)
84
82
  raise exception
85
83
  end
86
84
 
87
- # @param [ProcessBuilder] process_builder
88
- def run_popen3(process_builder)
89
- Open3.popen3(process_builder.env, *process_builder.command) do |stdin, stdout, stderr, wait_thr|
85
+ # @param [Hash] env
86
+ # @param [Array<String>] command
87
+ # @param [Hash] opts
88
+ def run_popen3(env, command, opts)
89
+ Open3.popen3(env, *command, opts) do |stdin, stdout, stderr, wait_thr|
90
90
  @pid = wait_thr.pid
91
91
  stdin.close
92
92
  read_streams([stdout, stderr]) do |data, stream|
@@ -28,7 +28,7 @@ module Komenda
28
28
  alias_method :status, :exitstatus
29
29
 
30
30
  def success?
31
- @status.success?
31
+ exitstatus == 0
32
32
  end
33
33
 
34
34
  def pid
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: komenda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-30 00:00:00.000000000 Z
12
+ date: 2016-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: events
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0.35'
90
+ version: 0.35.0
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0.35'
97
+ version: 0.35.0
98
98
  description: Convenience wrapper around `Open3` to run shell commands in Ruby.
99
99
  email: hello@cargomedia.ch
100
100
  executables: []
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.5.0
130
+ rubygems_version: 2.6.2
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Convenience wrapper around `Open3` to run shell commands in Ruby.