gitlab-branch-rename 0.2.0 → 0.3.0

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: 60976abc74b540c7fdd90ee169c5c7f49e67d71514728f4ee41194cf2b70c1fc
4
- data.tar.gz: b91a114cbc9603200823ddad6d36c0e0fd8a6d1988c36a9a5fbb67c03a10722e
3
+ metadata.gz: d02aa63f9aa10433d20701e09795bc748f4b642ffe628c9ea5bfbc962939e85f
4
+ data.tar.gz: 5c5b106cd879f3a7f676b6013e6be7dfa2c8005951b75e34f6d09ba52e64462e
5
5
  SHA512:
6
- metadata.gz: 2382c0b192541311af1488e071ee3c1415d24c59b57ff4f512bae9fed1f3d8c479ca2359a6ba6637f3cd0ba5d282d350472bf3b6927bb944462b8eeda255ac47
7
- data.tar.gz: af8db546cbdcd9850f17f3b9944403ff162f053a71ce0c65e4acf7665ade7f8bb0ed570aff174f5c6cd9f8f76dfa0ce601964820a954ab6e0d7a59ed37504a20
6
+ metadata.gz: 626949e870d91827b5901ff5e62ffbe1a93e7972a00918425feba2960b61893ce6b15d0861da45db2e1ba61d7f30b821d51b97b4d908aaf2e703732d07b99a0c
7
+ data.tar.gz: dea4861e80089beb216cf3295d16d61ca3e5e8e5f5f380f4d28ca22514d052d1d3d2b07afbfefe7411fbcd16a8845ea3e04f348c62db5733ae300084f9e99578
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source "https://rubygems.org"
2
2
  ruby "~> 2.6"
3
3
 
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
@@ -1,13 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-branch-rename (0.2.0)
4
+ gitlab-branch-rename (0.3.0)
5
5
  gitlab (~> 4.16)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- diff-lcs (1.4.4)
11
10
  gitlab (4.16.1)
12
11
  httparty (~> 0.14, >= 0.14.0)
13
12
  terminal-table (~> 1.5, >= 1.5.1)
@@ -18,20 +17,6 @@ GEM
18
17
  mime-types-data (~> 3.2015)
19
18
  mime-types-data (3.2020.0512)
20
19
  multi_xml (0.6.0)
21
- rake (12.3.3)
22
- rspec (3.9.0)
23
- rspec-core (~> 3.9.0)
24
- rspec-expectations (~> 3.9.0)
25
- rspec-mocks (~> 3.9.0)
26
- rspec-core (3.9.2)
27
- rspec-support (~> 3.9.3)
28
- rspec-expectations (3.9.2)
29
- diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.9.0)
31
- rspec-mocks (3.9.1)
32
- diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.9.0)
34
- rspec-support (3.9.3)
35
20
  terminal-table (1.8.0)
36
21
  unicode-display_width (~> 1.1, >= 1.1.1)
37
22
  unicode-display_width (1.7.0)
@@ -41,8 +26,6 @@ PLATFORMS
41
26
 
42
27
  DEPENDENCIES
43
28
  gitlab-branch-rename!
44
- rake (~> 12.0)
45
- rspec (~> 3.0)
46
29
 
47
30
  RUBY VERSION
48
31
  ruby 2.7.0p0
data/Makefile CHANGED
@@ -1,16 +1,12 @@
1
- all:
2
- rake
3
-
4
1
  build:
5
- rake
6
2
  gem build ./gitlab-branch-rename.gemspec
7
3
 
8
4
  clean:
9
- rm .rspec_status
10
5
  rm gitlab-branch-rename-*.gem
11
6
 
12
7
  install: build
13
8
  gem install ./gitlab-branch-rename-*.gem
14
9
 
15
10
  push: clean build
16
- gem push gitlab-branch-rename-*.gem
11
+ gem push gitlab-branch-rename-*.gem
12
+ open https://rubygems.org/gems/gitlab-branch-rename
data/README.md CHANGED
@@ -1,48 +1,68 @@
1
- # Gitlab::Branch::Rename
1
+ # Gitlab Branch Rename
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gitlab/branch/rename`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This is a simple tool to rename your Gitlab project branches en-mass.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ## Motivation
6
6
 
7
- ## Installation
7
+ To support Black Lives Matter and create safer spaces, I wanted to rename all of the default branches in my Gitlab
8
+ account. I wasn't able to find any tools to do that, so I wrote this one. If you're unsure why this is important or
9
+ want to better understand why I wanted to make these changes, see this great [Twitter thread].
8
10
 
9
- Add this line to your application's Gemfile:
11
+ ## Installation
10
12
 
11
- ```ruby
12
- gem 'gitlab-branch-rename'
13
- ```
13
+ This gem is designed to be used from the command line and not currently incorporated into your own projects. If you
14
+ wish to do that, happy to help make that happen.
14
15
 
15
- And then execute:
16
+ Install this with RVM:
16
17
 
17
- $ bundle install
18
+ $ rvm @global do gem install gitlab-branch-rename
18
19
 
19
- Or install it yourself as:
20
+ or install to your system ruby installation:
20
21
 
21
- $ gem install gitlab-branch-rename
22
+ $ sudo gem install gitlab-branch-rename
22
23
 
23
24
  ## Usage
24
25
 
25
- TODO: Write usage instructions here
26
+ ```
27
+ Usage: gitlab-branch-rename --from <branch to rename> --to <new branch name> [options]
28
+
29
+ Specific options:
30
+ --from OLD_BRANCH Branch to rename
31
+ --to NEW_BRANCH New branch name
32
+ --endpoint ENDPOINT Gitlab server endpoint. default: Gitlab cloud
33
+ --token-env-var ENV_VAR_NAME Environment variable to pull token out of
34
+ --only-if-default Rename only if it is the default branch
35
+ --visibility VISIBILITIES Comma-separated list of project visibilities default: public,internal,private
36
+ --skip-confirm Skip confirmation before executing rename
37
+ --pretend Pretend to perform actions. Overrides confirm option
38
+ --logfile LOGFILE Logfile destination. Use - for STDOUT
39
+ ```
26
40
 
27
41
  ## Development
28
42
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
43
+ To setup your development environment, run `bundle install` and `make` to run tests.
30
44
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
45
+ To release a new version, update the version number in `lib/gitlab_branch_rename/version.rb`, and then run `make push`.
32
46
 
33
47
  During development, I used these references:
34
- - https://docs.gitlab.com/ce/api/projects.html#edit-project
35
- - https://www.rubydoc.info/gems/gitlab/Gitlab/Client/Projects
48
+ * https://docs.gitlab.com/ce/api/projects.html#edit-project
49
+ * https://www.rubydoc.info/gems/gitlab/Gitlab/Client/Projects
36
50
 
37
51
  ## Contributing
38
52
 
39
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gitlab-branch-rename. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/gitlab-branch-rename/blob/master/CODE_OF_CONDUCT.md).
40
-
53
+ Bug reports and pull requests are welcome on [Gitlab]. This project is intended to be a safe, welcoming space for
54
+ collaboration, and contributors are expected to adhere to the [code of conduct].
41
55
 
42
56
  ## License
43
57
 
44
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
58
+ The gem is available as open source under the terms of the [MIT License].
45
59
 
46
60
  ## Code of Conduct
47
61
 
48
- Everyone interacting in the Gitlab::Branch::Rename project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/gitlab-branch-rename/blob/master/CODE_OF_CONDUCT.md).
62
+ Everyone interacting in the Gitlab::Branch::Rename project's codebases, issue trackers, chat rooms and mailing lists
63
+ is expected to follow the [code of conduct].
64
+
65
+ [code of conduct]: https://gitlab.com/apfritts/gitlab-branch-rename/blob/master/CODE_OF_CONDUCT.md
66
+ [Gitlab]: https://gitlab.com/apfritts/gitlab-branch-rename
67
+ [MIT License]: https://opensource.org/licenses/MIT
68
+ [Twitter thread]: https://twitter.com/mislav/status/1270388510684598272
@@ -23,11 +23,9 @@ Gem::Specification.new do |spec|
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
25
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
26
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ `git ls-files -z`.split("\x0")
27
27
  end
28
28
  spec.bindir = "exe"
29
- executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
- puts executables
31
- spec.executables = executables
29
+ spec.executables = "gitlab-branch-rename"
32
30
  spec.require_paths = ["lib"]
33
31
  end
@@ -1,4 +1,5 @@
1
1
  require "optparse"
2
+ require "gitlab_branch_rename/version"
2
3
 
3
4
  module GitlabBranchRename
4
5
  class Configuration
@@ -61,6 +62,10 @@ module GitlabBranchRename
61
62
  configuration.logfile = logfile
62
63
  end
63
64
  end
65
+ opts.on("--version", "Print version and exit") do
66
+ puts(GitlabBranchRename::VERSION)
67
+ exit 0
68
+ end
64
69
  opts.separator ""
65
70
  opts.separator "Visit https://gitlab.com/apfritts/gitlab-branch-rename for more details."
66
71
  end
@@ -1,3 +1,3 @@
1
1
  module GitlabBranchRename
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-branch-rename
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AP Fritts
@@ -37,18 +37,14 @@ extensions: []
37
37
  extra_rdoc_files: []
38
38
  files:
39
39
  - ".gitignore"
40
- - ".rspec"
41
40
  - ".ruby-version"
42
- - ".travis.yml"
43
41
  - CODE_OF_CONDUCT.md
44
42
  - Gemfile
45
43
  - Gemfile.lock
46
44
  - LICENSE.txt
47
45
  - Makefile
48
46
  - README.md
49
- - Rakefile
50
47
  - bin/console
51
- - bin/setup
52
48
  - exe/gitlab-branch-rename
53
49
  - gitlab-branch-rename.gemspec
54
50
  - gitlab-branch-rename.gemspec.lock
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.7.0
6
- before_install: gem install bundler -v 2.1.2
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install