ember-cli-rails 0.7.2 → 0.7.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: 7f0547176e2856d0b34ef53d83724a6d5dbdb741
4
- data.tar.gz: 5edaffcc86f429e1dcdc2085414fa4824b78b795
3
+ metadata.gz: d157a938817929f1ba712ece97d2d011589b9277
4
+ data.tar.gz: 2e813694b87a48835a810a87d7f6344f2f68b8d2
5
5
  SHA512:
6
- metadata.gz: fec38204f90ffac056042df6d658a11e4099ff29b45b4702bfb48e002e7114818772d6ed6f4f6b92e57f159cebe1b96b8c0c7fbe28f20f831df31d94eb693a39
7
- data.tar.gz: cc713397c80da2e9d4b1449666707fe5d247cc9ad282ff9fa41958b67e9abdf07736487663d06185de073853dd9a9300593b568ff2d74eb33d23704737fff612
6
+ metadata.gz: 081d7613d112ce8bd739a13f6fd236e4e921d7ee5d2dae204774415558271d528fdda723b7579414e65c7e3a6d3f0562424e6971b9682528155b6d08ef4bdeab
7
+ data.tar.gz: b37e4cba19eb651a5e4d4240a6c22ec365327c4604a99a7c5fc98616f58a63dfb46a833bfa310d465e588d5f19b2b1776fb12fbf81cffde5c77389b37af4d6e5
@@ -1,6 +1,20 @@
1
1
  master
2
2
  ------
3
3
 
4
+ 0.7.3
5
+ -----
6
+
7
+ * Stream output instead of waiting until subprocesses finish. [#423]
8
+ * Update `ember-cli-rails-assets` dependency. [#422]
9
+ * Only write errors to `STDERR`. [#421]
10
+ * Remove dependency on `tee`. Fixes bug [#417]. [#420]
11
+
12
+ [#423]: https://github.com/thoughtbot/ember-cli-rails/pull/423
13
+ [#422]: https://github.com/thoughtbot/ember-cli-rails/pull/422
14
+ [#421]: https://github.com/thoughtbot/ember-cli-rails/issues/421
15
+ [#420]: https://github.com/thoughtbot/ember-cli-rails/issues/420
16
+ [#417]: https://github.com/thoughtbot/ember-cli-rails/issues/417
17
+
4
18
  0.7.2
5
19
  -----
6
20
 
@@ -36,9 +36,10 @@ module EmberCli
36
36
  def compile
37
37
  @compiled ||= begin
38
38
  prepare
39
- @shell.compile
39
+ exit_status = @shell.compile
40
40
  @build.check!
41
- true
41
+
42
+ exit_status.success?
42
43
  end
43
44
  end
44
45
 
@@ -71,7 +72,7 @@ module EmberCli
71
72
  def test
72
73
  prepare
73
74
 
74
- @shell.test
75
+ @shell.test.success?
75
76
  end
76
77
 
77
78
  def check_for_errors!
@@ -14,7 +14,7 @@ module EmberCli
14
14
  end
15
15
 
16
16
  def build(watch: false)
17
- "#{ember_build(watch: watch)} | #{tee}"
17
+ ember_build(watch: watch)
18
18
  end
19
19
 
20
20
  private
@@ -25,12 +25,6 @@ module EmberCli
25
25
  options.fetch(:watcher) { EmberCli.configuration.watcher }
26
26
  end
27
27
 
28
- def tee
29
- Cocaine::CommandLine.
30
- new(paths.tee, "-a :log").
31
- command(log: paths.log)
32
- end
33
-
34
28
  def ember_build(watch: false)
35
29
  line = Cocaine::CommandLine.new(paths.ember, [
36
30
  "build",
@@ -2,35 +2,48 @@ require "open3"
2
2
 
3
3
  module EmberCli
4
4
  class Runner
5
- def initialize(env: {}, out:, err:, options: {})
5
+ def initialize(out:, err:, env: {}, options: {})
6
6
  @env = env
7
- @out = out
8
- @err = err
7
+ @output_streams = Array(out)
8
+ @error_streams = Array(err)
9
9
  @options = options
10
+ @threads = []
10
11
  end
11
12
 
12
13
  def run(command)
13
- output, status = Open3.capture2e(@env, command, @options)
14
+ Open3.popen3(env, command, options) do |stdin, stdout, stderr, process|
15
+ stdin.close
14
16
 
15
- @out.write(output)
17
+ threads << redirect_stream_in_thread(stdout, write_to: output_streams)
18
+ threads << redirect_stream_in_thread(stderr, write_to: error_streams)
16
19
 
17
- [output, status]
20
+ threads.each(&:join)
21
+ process.value
22
+ end
18
23
  end
19
24
 
20
25
  def run!(command)
21
- output, status = run(command)
26
+ run(command).tap do |status|
27
+ unless status.success?
28
+ exit status.exitstatus
29
+ end
30
+ end
31
+ end
22
32
 
23
- unless status.success?
24
- @err.write <<-MSG.strip_heredoc
25
- ERROR: Failed command: `#{command}`
26
- OUTPUT:
27
- #{output}
28
- MSG
33
+ protected
29
34
 
30
- exit status.exitstatus
31
- end
35
+ attr_reader :env, :error_streams, :options, :output_streams, :threads
32
36
 
33
- true
37
+ private
38
+
39
+ def redirect_stream_in_thread(stream, write_to:)
40
+ Thread.new do
41
+ Thread.current.abort_on_exception = true
42
+
43
+ while line = stream.gets
44
+ write_to.each { |redirection_stream| redirection_stream.puts(line) }
45
+ end
46
+ end
34
47
  end
35
48
  end
36
49
  end
@@ -85,8 +85,8 @@ module EmberCli
85
85
  def runner
86
86
  Runner.new(
87
87
  options: { chdir: paths.root.to_s },
88
- out: paths.log,
89
- err: $stderr,
88
+ out: [$stdout, paths.log.open("a")],
89
+ err: [$stderr],
90
90
  env: env,
91
91
  )
92
92
  end
@@ -1,3 +1,3 @@
1
1
  module EmberCli
2
- VERSION = "0.7.2".freeze
2
+ VERSION = "0.7.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-cli-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-17 00:00:00.000000000 Z
13
+ date: 2016-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ember-cli-rails-assets
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 0.6.1
21
+ version: 0.6.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 0.6.1
28
+ version: 0.6.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: railties
31
31
  requirement: !ruby/object:Gem::Requirement