git-multi 2.6.1 → 2.7.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
  SHA256:
3
- metadata.gz: 97d58d5d1665855c2297ef0621a06775b05d93e4c32bb57a13f32855617cca68
4
- data.tar.gz: a3600a70e589ddff71ac7f02ad5d6b3f9b7dd2a66a8d087345845375c60e4edf
3
+ metadata.gz: 1d67da6065deb617ec35011956c6c726d31da7fcb32f1672326f6de23bab2613
4
+ data.tar.gz: d522c33fce1d1d53b785bca1b13bde697b9391c328bf717f90430016bb5f4e14
5
5
  SHA512:
6
- metadata.gz: 8bcad95ab175d8882c53b991bfcb7ef8c32535f72eb08b3e2a9974239119dbbf531489f7cb8ea24a65c7b73ec7af85e095389ac4687059da80d2ce5831f80809
7
- data.tar.gz: a80e9fa77758f8af11722cc5f1f542cb1c20dac96fc26bf0529abada1bc6e9d3693fd71a1aa62fca192aba50945ede04abe245cd36710f34dbe075a148f65e13
6
+ metadata.gz: 979d1a098da4582eb08dbd5183fc7af0f697484bb949d52b435b94d9d8163e23a405241a74a71fd8e8ebfea7a520c820f2a899c5693a789c9c71f2cc3d155896
7
+ data.tar.gz: 2039285af97431a8704579d750f2e14a2a00e48225454db71b19a4f7f1450168bd1d2982965e9cc569a781527b7c05a2a3631a1f5002a8803d91a59a5ce53444
data/.rubocop.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 2.3
2
3
  Exclude:
3
4
  - 'doc/*'
4
5
  - 'tmp/*'
data/Gemfile.lock CHANGED
@@ -1,53 +1,50 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-multi (2.6.1)
5
- octokit (~> 4.13)
4
+ git-multi (2.7.0)
5
+ faraday (~> 0.15.0)
6
+ octokit (~> 4)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- addressable (2.6.0)
11
- public_suffix (>= 2.0.2, < 4.0)
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
12
13
  ast (2.4.0)
13
14
  coderay (1.1.2)
14
15
  faraday (0.15.4)
15
16
  multipart-post (>= 1.2, < 3)
16
17
  interception (0.5)
17
- jaro_winkler (1.5.2)
18
+ jaro_winkler (1.5.3)
18
19
  method_source (0.9.2)
19
- minitest (5.11.3)
20
+ minitest (5.12.2)
20
21
  multipart-post (2.1.1)
21
22
  octokit (4.14.0)
22
23
  sawyer (~> 0.8.0, >= 0.5.3)
23
- parallel (1.13.0)
24
- parser (2.6.0.0)
24
+ parallel (1.17.0)
25
+ parser (2.6.4.1)
25
26
  ast (~> 2.4.0)
26
- powerpack (0.1.2)
27
27
  pry (0.12.2)
28
28
  coderay (~> 1.1.0)
29
29
  method_source (~> 0.9.0)
30
30
  pry-rescue (1.5.0)
31
31
  interception (>= 0.5)
32
32
  pry (>= 0.12.0)
33
- psych (3.1.0)
34
- public_suffix (3.1.1)
33
+ public_suffix (4.0.1)
35
34
  rainbow (3.0.0)
36
- rake (12.3.2)
37
- rubocop (0.65.0)
35
+ rake (13.0.0)
36
+ rubocop (0.74.0)
38
37
  jaro_winkler (~> 1.5.1)
39
38
  parallel (~> 1.10)
40
- parser (>= 2.5, != 2.5.1.1)
41
- powerpack (~> 0.1)
42
- psych (>= 3.1.0)
39
+ parser (>= 2.6)
43
40
  rainbow (>= 2.2.2, < 4.0)
44
41
  ruby-progressbar (~> 1.7)
45
- unicode-display_width (~> 1.4.0)
46
- ruby-progressbar (1.10.0)
42
+ unicode-display_width (>= 1.4.0, < 1.7)
43
+ ruby-progressbar (1.10.1)
47
44
  sawyer (0.8.2)
48
45
  addressable (>= 2.3.5)
49
46
  faraday (> 0.8, < 2.0)
50
- unicode-display_width (1.4.1)
47
+ unicode-display_width (1.6.0)
51
48
 
52
49
  PLATFORMS
53
50
  ruby
data/git-multi.gemspec CHANGED
@@ -25,7 +25,8 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.post_install_message = Git::Multi::PIM
27
27
 
28
- spec.add_dependency 'octokit', '~> 4.13'
28
+ spec.add_dependency 'faraday', '~> 0.15.0'
29
+ spec.add_dependency 'octokit', '~> 4'
29
30
 
30
31
  spec.add_development_dependency 'bundler'
31
32
  spec.add_development_dependency 'minitest'
@@ -94,6 +94,7 @@ module Git
94
94
  ->(repo) {
95
95
  Kernel.system "git clone -q #{repo.rels[:ssh].href.shellescape}"
96
96
  },
97
+ nil, # captured
97
98
  in: 'parent_dir'
98
99
  )
99
100
  end
@@ -176,7 +177,20 @@ module Git
176
177
  Kernel.system cmd
177
178
  },
178
179
  ->(repo) {
179
- Kernel.system "#{cmd} 2>&1 | sed -e 's#^##{repo.full_name.shellescape}: #'"
180
+ prefix = "sed -e 's#^##{repo.full_name.shellescape}: #'"
181
+ Kernel.system "#{cmd} 2>&1 | #{prefix} ;"
182
+ },
183
+ ->(repo, errors) {
184
+ #
185
+ # because `Kernel.system()` uses the standard shell,
186
+ # which always means "/bin/sh" on Unix-like systems,
187
+ # the following version using "process substitution"
188
+ # doesn't work:
189
+ #
190
+ # Kernel.system "#{cmd} 2> >(#{prefix}) | #{prefix} ;"
191
+ #
192
+ prefix = "sed -e 's#^##{repo.full_name.shellescape}: #'"
193
+ Kernel.system "#{cmd} 2> #{errors} | #{prefix} ;"
180
194
  },
181
195
  in: 'local_path'
182
196
  )
@@ -84,20 +84,22 @@ module Git
84
84
  private_class_method def symbolize(token)
85
85
  case token
86
86
  when Git::Multi.env_var('OCTOKIT_ACCESS_TOKEN')
87
- then '${OCTOKIT_ACCESS_TOKEN}'
87
+ '${OCTOKIT_ACCESS_TOKEN}'
88
88
  when Git::Multi.global_option('github.token')
89
- then 'github.token'
90
- else '(unset)'
89
+ 'github.token'
90
+ else
91
+ '(unset)'
91
92
  end
92
93
  end
93
94
 
94
95
  private_class_method def abbreviate(directory, root_dir = nil)
95
96
  case root_dir
96
97
  when :home
97
- then directory.gsub(Git::Multi::HOME, '${HOME}')
98
+ directory.gsub(Git::Multi::HOME, '${HOME}')
98
99
  when :workarea
99
- then directory.gsub(Git::Multi::WORKAREA, '${WORKAREA}')
100
- else abbreviate(abbreviate(directory, :workarea), :home)
100
+ directory.gsub(Git::Multi::WORKAREA, '${WORKAREA}')
101
+ else
102
+ abbreviate(abbreviate(directory, :workarea), :home)
101
103
  end
102
104
  end
103
105
 
@@ -1,7 +1,7 @@
1
1
  module Git
2
2
  module Multi
3
3
  NAME = 'git-multi'.freeze
4
- VERSION = '2.6.1'.freeze
4
+ VERSION = '2.7.0'.freeze
5
5
 
6
6
  def self.version
7
7
  "#{NAME} v#{VERSION}"
data/lib/git/multi.rb CHANGED
@@ -4,6 +4,8 @@ require 'pathname'
4
4
  require 'fileutils'
5
5
  require 'shellwords'
6
6
 
7
+ require 'English'
8
+
7
9
  require 'octokit'
8
10
  require 'sawyer'
9
11
  require 'faraday'
@@ -11,7 +13,6 @@ require 'addressable'
11
13
 
12
14
  require 'ext/dir'
13
15
  require 'ext/string'
14
- require 'ext/kernel'
15
16
  require 'ext/commify'
16
17
  require 'ext/sawyer/resource'
17
18
 
@@ -144,21 +145,34 @@ module Git
144
145
 
145
146
  module Nike
146
147
 
147
- def just_do_it(interactive, pipeline, options = {})
148
+ # rubocop:disable Metrics/PerceivedComplexity
149
+ # rubocop:disable Metrics/CyclomaticComplexity
150
+ def just_do_it(interactive, pipelined, captured = nil, options = {})
148
151
  working_dir = case (options[:in] || '').to_sym
149
152
  when :parent_dir then parent_dir
150
153
  when :local_path then local_path
151
154
  else Dir.pwd
152
155
  end
153
156
  Dir.chdir(working_dir) do
154
- if interactive?
155
- puts "#{full_name.invert} (#{fractional_index})"
157
+ if STDOUT.tty? && STDERR.tty?
158
+ STDOUT.puts "#{full_name.invert} (#{fractional_index})"
156
159
  interactive.call(self)
160
+ elsif STDERR.tty?
161
+ errors = File.join(ENV['TMPDIR'], "git-multi.#{$PID}")
162
+ captured.call(self, errors)
163
+ unless File.zero?(errors)
164
+ # rubocop:disable Style/StderrPuts
165
+ STDERR.puts "#{full_name.invert} (#{fractional_index})"
166
+ Kernel.system "cat #{errors} > /dev/tty ;"
167
+ # rubocop:enable Style/StderrPuts
168
+ end
157
169
  else
158
- pipeline.call(self)
170
+ pipelined.call(self)
159
171
  end
160
172
  end
161
173
  end
174
+ # rubocop:enable Metrics/CyclomaticComplexity
175
+ # rubocop:enable Metrics/PerceivedComplexity
162
176
 
163
177
  def spputs(*args)
164
178
  # split, prefix and puts
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-multi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-18 00:00:00.000000000 Z
11
+ date: 2019-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.15.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.15.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: octokit
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '4.13'
33
+ version: '4'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '4.13'
40
+ version: '4'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +149,6 @@ files:
135
149
  - git-multi.gemspec
136
150
  - lib/ext/commify.rb
137
151
  - lib/ext/dir.rb
138
- - lib/ext/kernel.rb
139
152
  - lib/ext/sawyer/resource.rb
140
153
  - lib/ext/string.rb
141
154
  - lib/git/hub.rb
@@ -174,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
187
  - !ruby/object:Gem::Version
175
188
  version: '0'
176
189
  requirements: []
177
- rubygems_version: 3.0.4
190
+ rubygems_version: 3.0.6
178
191
  signing_key:
179
192
  specification_version: 4
180
193
  summary: The ultimate multi-repo utility for git!
data/lib/ext/kernel.rb DELETED
@@ -1,5 +0,0 @@
1
- module Kernel
2
- def interactive?
3
- STDOUT.tty? && STDERR.tty?
4
- end
5
- end