git-bundle 1.0.7 → 1.0.8

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: cc213a9a96e4df28ae91c20989a06431fd3202ce
4
- data.tar.gz: 7be0ca2bca7c8d53a275b8d5ecd2fcfc63cd5951
3
+ metadata.gz: 5fd3dff341b34d70c5e00235262bb39cfe394cbf
4
+ data.tar.gz: 36f3501f1d8cda04c76e556728bec30c0c305917
5
5
  SHA512:
6
- metadata.gz: 23105fce66785c11cbd80adf4635251a77db4e5aaa4326f635cc739a1a141c01a2f6837cc25203655aa633ab7a857d1e6e3f1b8775f28f378a8385a5f3aa3ba7
7
- data.tar.gz: 9b8e0e887bc405c619015524b4a5038b89df568ccbbdebdb855b0f8dc189d3b797711b4bafd58cbeba949d7704b24de48f1f3b7067c607b1e45fb7624bc60073
6
+ metadata.gz: 852ec697b4e298057ddaffa3e72f9816336496e9aac114fc2f3385ba1e5d9e19147d4921eb0290b1dbc3fc96db98c30fef818cfd2e03b9de2fb7e96c3e32b605
7
+ data.tar.gz: 61749820a89a6694db8f698f858ae5f3478666cc5a7cdd4b4897138870e6185095a9658fcded76abe25b66eef703fe6d8597f0b59f8b681920f5021255562774
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-bundle (1.0.2)
4
+ git-bundle (1.0.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -15,4 +15,4 @@ DEPENDENCIES
15
15
  git-bundle!
16
16
 
17
17
  BUNDLED WITH
18
- 1.12.5
18
+ 1.15.3
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Pierre Pretorius
3
+ Copyright (c) 2017 Pierre Pretorius
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -8,14 +8,44 @@ module GitBundle
8
8
  @args = args
9
9
  end
10
10
 
11
+ def print_wait_line(names)
12
+ STDOUT.print "Waiting for #{names.map {|name| colorize(name, COLORS[:highlight], true)}.join(', ')}"
13
+ STDOUT.flush
14
+ end
15
+
11
16
  def invoke
12
- errors = []
13
- @repositories.each do |repo|
14
- puts_repo_heading(repo)
15
- puts repo.execute_git(@args, color: true)
16
- errors << repo.name unless $?.exitstatus == 0
17
+ repository_results = @repositories.map {|repo| {repository: repo, output: '', error: false, complete: false, thread: nil}}
18
+
19
+ @repositories.each_with_index do |repo, index|
20
+ results = repository_results[index]
21
+ results[:thread] = Thread.new do
22
+ results[:output] = repo.execute_git(@args, color: true)
23
+ results[:error] = true unless $?.exitstatus == 0
24
+ end
25
+ end
26
+
27
+ waiting_for_repositories = @repositories.map(&:name)
28
+ print_wait_line(waiting_for_repositories)
29
+
30
+ until waiting_for_repositories.empty?
31
+ repository_results.each do |result|
32
+ next if result[:complete]
33
+
34
+ if result[:thread].join(0.1)
35
+ result[:complete] = true
36
+ clear_line
37
+
38
+ puts_repo_heading(result[:repository])
39
+ puts result[:output]
40
+
41
+ waiting_for_repositories.delete(result[:repository].name)
42
+ print_wait_line(waiting_for_repositories) unless waiting_for_repositories.empty?
43
+ end
44
+ end
17
45
  end
18
46
 
47
+ puts ''
48
+ errors = repository_results.select {|r| r[:error]}.map {|r| r[:repository].name}
19
49
  puts_error "Command failed in #{errors.join(', ')}." unless errors.empty?
20
50
  end
21
51
  end
@@ -3,7 +3,13 @@ module GitBundle
3
3
  COLORS = {error: 31,
4
4
  attention: 32,
5
5
  prompt: 33,
6
- heading: 34}
6
+ heading: 34,
7
+ highlight: 36}
8
+
9
+ def clear_line
10
+ STDOUT.print "\r\e[0K"
11
+ STDOUT.flush
12
+ end
7
13
 
8
14
  def puts_repo_heading(repo)
9
15
  puts colorize("\n=== #{repo.name} (#{repo.branch})", COLORS[:heading], true)
@@ -1,3 +1,3 @@
1
1
  module GitBundle
2
- VERSION = '1.0.7'
2
+ VERSION = '1.0.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Pretorius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-28 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler