multi_repo 0.2.0 → 0.2.2

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
  SHA256:
3
- metadata.gz: b2f8e962cb396736c017c1dd641f20503dde65b5dadaf20d38bb98a1811d3f4c
4
- data.tar.gz: da90a0d13d0e8c999e80a40979627470f64551d55b89f2a08b629040e07130ef
3
+ metadata.gz: 5f6bfcb82a6c7c9ecb6155693362f6a62969929bf2b545eb02290f7479916b94
4
+ data.tar.gz: a9fe3ea44406b016e01665382b3469f339b3e1c3aed58cbe07e99a3d1018cef6
5
5
  SHA512:
6
- metadata.gz: ffa32e47da1036891d73af604b0ddc1bd9f02d1ab053c1b84c6ba4604ca52ef6c842cb214636020ed1f79e2d6a4d50bc47ffdbd40e22e787a9e2eddce659284f
7
- data.tar.gz: '055905a0eb895e8cfd4377d5f73018465911d3a3a72e88e052acae945619f000b05cfb8264a105b1fada75087c96343ea0aafe860221b37eaee995007418b77a'
6
+ metadata.gz: 86b6e1f73bac7fa2cc6e308bebac1c88fab5d2f1dda3b37d111342b5af35da9b1dcf16867c78a3d333b54ebaf55ed58a1fc6c4df274dad8fa86496b8099d6da5
7
+ data.tar.gz: 558bdc3403403bacab66c49722e77f92bf57a8ffad05015d06e384e2ae6f37bb7c04753b5dbbccefa77c4fad68bf8c26f6cb451da9f25c881d1f8180ce3234c8
data/exe/multi_repo CHANGED
@@ -2,16 +2,26 @@
2
2
 
3
3
  SCRIPT_DIR = File.expand_path("../scripts", __dir__)
4
4
 
5
+ def available_scripts
6
+ @available_scripts ||= Dir.children(SCRIPT_DIR).sort.to_h do |script|
7
+ desc = File.read(File.join(SCRIPT_DIR, script)).match(/synopsis(?:\(|\s+)['"](.*)['"]/)&.captures&.first
8
+ [script, desc]
9
+ end
10
+ end
11
+
5
12
  def usage
6
13
  puts "Usage: multi_repo <script> [args]"
7
14
  puts " script Script to run"
8
15
  puts " args Arguments to pass to the script"
9
16
  puts " -h, --help Show this help message"
10
-
11
- available_scripts = Dir.children(SCRIPT_DIR).sort.map { |f| " #{f}"}
17
+ puts
18
+ puts "For help on a specific script, run:"
19
+ puts " multi_repo <script> --help"
12
20
  puts
13
21
  puts "Available scripts:"
14
- puts available_scripts
22
+
23
+ justify = available_scripts.keys.map(&:length).max + 2
24
+ puts available_scripts.map { |script, desc| " #{script.ljust(justify)} #{desc}" }.join("\n")
15
25
  end
16
26
 
17
27
  script, args = ARGV[0], ARGV[1..]
@@ -1,3 +1,3 @@
1
1
  module MultiRepo
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
data/multi_repo.gemspec CHANGED
@@ -36,6 +36,9 @@ Gem::Specification.new do |spec|
36
36
  spec.add_runtime_dependency "rest-client"
37
37
  spec.add_runtime_dependency "travis"
38
38
 
39
+ # config gem brings in newer versions of dry-configurable that are not compatible with Ruby 2.7
40
+ spec.add_runtime_dependency "dry-configurable", "= 1.0.1"
41
+
39
42
  spec.add_development_dependency "bundler"
40
43
  spec.add_development_dependency "manageiq-style"
41
44
  spec.add_development_dependency "rake"
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Delete labels on all GitHub repos."
11
+
10
12
  opt :labels, "The labels to delete.", :type => :strings, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Destroy a branch on all local git repos."
11
+
10
12
  opt :branch, "The branch to destroy.", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Destroy a remote on all local git repos."
11
+
10
12
  opt :remote, "The remote to destroy", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self)
data/scripts/destroy_tag CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Destroy a tag on all local git repos."
11
+
10
12
  opt :tag, "The tag to destroy", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
data/scripts/each_repo CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Run a command in each repo."
11
+
10
12
  opt :command, "A command to run in each repo", :type => :string, :required => true
11
13
  opt :ref, "Ref to checkout before running the command", :type => :string, :default => "master"
12
14
 
data/scripts/fetch_repos CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Fetch all repos."
11
+
10
12
  opt :checkout, "Branch to checkout after fetching.", :type => :string
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
data/scripts/git_mirror CHANGED
@@ -6,4 +6,8 @@ gemfile do
6
6
  gem "multi_repo", require: "multi_repo/cli", path: File.expand_path("..", __dir__)
7
7
  end
8
8
 
9
+ Optimist.options do
10
+ synopsis "Mirror all GitHub repos into another org."
11
+ end
12
+
9
13
  exit 1 unless MultiRepo::Helpers::GitMirror.new.mirror_all
@@ -7,4 +7,8 @@ gemfile do
7
7
  end
8
8
  require "more_core_extensions/core_ext/array/tableize"
9
9
 
10
+ Optimist.options do
11
+ synopsis "Display the current GitHub rate limit."
12
+ end
13
+
10
14
  puts [MultiRepo::Service::Github.client.rate_limit.to_h].tableize
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Apply the 'hacktoberfest' label to all 'good first issue' labels."
11
+
10
12
  opt :org, "The organization to apply the `hacktoberfest` label to", :type => :string, :required => true
11
13
  opt :apply, "Apply the `hacktoberfest` label to `good first issue` labels. "\
12
14
  "Pass --no-apply to remove the `hacktoberfest` label",
data/scripts/make_alumni CHANGED
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Move a set of GitHub team members to an 'alumni' team."
11
+
10
12
  opt :users, "The users to make alumni.", :type => :strings, :required => true
11
13
  opt :org, "The org in which user belongs", :type => :string, :required => true
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create a stub for a new Ruby gem on rubygems.org."
11
+
10
12
  opt :owners, "Owners to add to the gem stub", :type => :strings, :default => []
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :repo_set)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create a pull request on all repos."
11
+
10
12
  opt :base, "The target branch for the changes.", :type => :string, :required => true
11
13
  opt :head, "The name of the branch to create on your fork.", :type => :string, :required => true
12
14
  opt :script, "The path to the script that will update the desired files.", :type => :string, :required => true
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Add or remove labels on a set of pull requests."
11
+
10
12
  opt :prs, "The list of PRs to merge", :type => :strings, :required => true
11
13
  opt :add, "Labels to add", :type => :strings, :required => true
12
14
  opt :remove, "Labels to remove", :type => :strings, :required => true
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Merge a set of pull requests, also setting assignee and labels."
11
+
10
12
  opt :prs, "The list of PRs to merge", :type => :strings, :required => true
11
13
  opt :assignee, "GitHub user to assign when merging", :type => :string, :required => true
12
14
  opt :labels, "Labels to apply when merging", :type => :strings
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Reenable all disabled workflows in an org."
11
+
10
12
  opt :org, "The organization to reenable workflows in", :type => :string, :required => true
11
13
  opt :extra_repos, "Extra repos to reenable workflows in", :type => :strings, :default => []
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Rename labels on all GitHub repos."
11
+
10
12
  opt :old, "The old label names.", :type => :strings, :required => true
11
13
  opt :new, "The new label names.", :type => :strings, :required => true
12
14
 
@@ -9,6 +9,8 @@ require 'travis'
9
9
  require 'travis/pro/auto_login'
10
10
 
11
11
  opts = Optimist.options do
12
+ synopsis "Restart all Travis builds for a given branch or tag for all GitHub repos."
13
+
12
14
  opt :ref, "The branch or release tag to rebuild.", :type => :string, :required => true
13
15
 
14
16
  MultiRepo::CLI.common_options(self, :except => :dry_run, :repo_set_default => nil)
@@ -11,6 +11,8 @@ require "active_support/core_ext/string/inflections"
11
11
  DISPLAY_FORMATS = %w[commit pr-title pr-label]
12
12
 
13
13
  opts = Optimist.options do
14
+ synopsis "Show the git commit log between two refs for all git repos."
15
+
14
16
  opt :from, "The commit log 'from' ref", :type => :string, :required => true
15
17
  opt :to, "The commit log 'to' ref" , :type => :string, :required => true
16
18
  opt :display, "How to display the history. Valid values are: #{DISPLAY_FORMATS.join(", ")}", :default => "commit"
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Show all members of an org."
11
+
10
12
  opt :org, "The org to list the users for", :type => :string, :required => true
11
13
  opt :team, "Show members of a specific team", :type => :string
12
14
  opt :alumni, "Whether or not to include alumni", :default => false
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "List all repos in an org."
11
+
10
12
  opt :org, "The org to list the repos for", :type => :string, :required => true
11
13
  end
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Show commit and merge stats for all git repos."
11
+
10
12
  opt :since, "Since what date.", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :except => :dry_run)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Show all issues in a GitHub project column."
11
+
10
12
  opt :project_id, "The project ID", :type => :integer, :required => true
11
13
  opt :column, "The column within the project", :type => :string, :required => true
12
14
 
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "List all repos in a repo set."
11
+
10
12
  MultiRepo::CLI.common_options(self, :only => :repo_set)
11
13
  end
12
14
 
data/scripts/show_tag CHANGED
@@ -8,6 +8,8 @@ end
8
8
  require 'more_core_extensions/core_ext/array/tableize'
9
9
 
10
10
  opts = Optimist.options do
11
+ synopsis "Show the commit for a tag in all git repos."
12
+
11
13
  opt :tag, "The tag name.", :type => :string, :required => true
12
14
 
13
15
  MultiRepo::CLI.common_options(self, :except => :dry_run, :repo_set_default => nil)
@@ -13,6 +13,8 @@ require 'travis'
13
13
  require 'travis/pro/auto_login'
14
14
 
15
15
  opts = Optimist.options do
16
+ synopsis "Show the Travis status for a branch or tag for all GitHub repos."
17
+
16
18
  opt :ref, "The branch or release tag to check status for.", :type => :string, :required => true
17
19
 
18
20
  MultiRepo::CLI.common_options(self, :except => :dry_run, :repo_set_default => nil)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Update the branch protection for all GitHub repos."
11
+
10
12
  opt :branch, "The branch to protect.", :type => :string, :required => true
11
13
 
12
14
  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create or update labels on all GitHub repos."
11
+
10
12
  MultiRepo::CLI.common_options(self, :repo_set_default => nil)
11
13
  end
12
14
  opts[:repo] = MultiRepo::Labels.all.keys.sort unless opts[:repo] || opts[:repo_set]
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Create, update, or close a milestone in all GitHub repos."
11
+
10
12
  opt :title, "The milestone title.", :type => :string, :required => true
11
13
  opt :due_on, "The due date.", :type => :string
12
14
  opt :close, "Whether to close the milestone.", :default => false
@@ -7,6 +7,8 @@ gemfile do
7
7
  end
8
8
 
9
9
  opts = Optimist.options do
10
+ synopsis "Update repo settings in all GitHub repos."
11
+
10
12
  MultiRepo::CLI.common_options(self)
11
13
  end
12
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -192,6 +192,20 @@ dependencies:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: dry-configurable
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '='
200
+ - !ruby/object:Gem::Version
201
+ version: 1.0.1
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '='
207
+ - !ruby/object:Gem::Version
208
+ version: 1.0.1
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: bundler
197
211
  requirement: !ruby/object:Gem::Requirement