gitgud 0.1.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 +7 -0
- data/CHANGELOG.md +2 -0
- data/LICENSE +21 -0
- data/README.md +17 -0
- data/bin/gitgud +46 -0
- metadata +63 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d5c71fb8c079e8ff064573d7e832def7cf87aeebaf1f86807e703c6bdf0511fd
|
4
|
+
data.tar.gz: 3450a6c8156c124198e72527c63e78d0ff7e46e3a1f14b7c717f81b0c8567fac
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 621c4f62f3eb8bc9b82b72554a4b024101b3e24ade8f1cbc55cacc6f2688a4d4ef8473212635c52eed7fe58e1502a8d1c0439df79b54cbf35ad2ba14df5186f7
|
7
|
+
data.tar.gz: eaee935b8c17b4607cba2ba68888b82e165ceebc017041cfb31c996f84e93b28ada50f3d407110af6e83db9b982549e6311564667d36d48b6e9eab3e6bb8158b
|
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Justin Léger
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# gitgud 
|
2
|
+
|
3
|
+
When things go wrong, you need to `gitgud`. `gitgud` acts just like `git`, but gives you superpowers when trying to `git push`. It will attempt to `git push` until it succeeds.
|
4
|
+
|
5
|
+
## `gitgud` is the new `git`
|
6
|
+
|
7
|
+
gitgud supports the same commands as `git` as it is effectively calling `git` under the hood.
|
8
|
+
|
9
|
+
## How to install
|
10
|
+
|
11
|
+
```console
|
12
|
+
gem install gitgud
|
13
|
+
```
|
14
|
+
|
15
|
+
## License
|
16
|
+
|
17
|
+
This gem is MIT licensed, please see LICENSE for more information.
|
data/bin/gitgud
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'cli/ui'
|
4
|
+
|
5
|
+
def try_to_push_this_thing(spinner)
|
6
|
+
counter = 1
|
7
|
+
while !system("git push #{all_of_the_args}")
|
8
|
+
spinner.update_title(spinner_title(counter))
|
9
|
+
counter += 1
|
10
|
+
end
|
11
|
+
spinner.update_title('Successfully git pushed')
|
12
|
+
end
|
13
|
+
|
14
|
+
def spinner_title(attempt_number = 1)
|
15
|
+
if attempt_number == 1
|
16
|
+
'Attempting git push'
|
17
|
+
else
|
18
|
+
"Attempting git push (Attempt ##{attempt_number})"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def plz_push_my_thing_on_git_thx_k_bye
|
23
|
+
CLI::UI::StdoutRouter.enable
|
24
|
+
spin_group = CLI::UI::SpinGroup.new
|
25
|
+
spin_group.add(spinner_title) { |spinner| try_to_push_this_thing(spinner) }
|
26
|
+
spin_group.wait
|
27
|
+
end
|
28
|
+
|
29
|
+
def default_to_using_the_plain_git
|
30
|
+
system("git #{all_of_the_args}")
|
31
|
+
end
|
32
|
+
|
33
|
+
def all_of_the_args
|
34
|
+
ARGV.join(" ")
|
35
|
+
end
|
36
|
+
|
37
|
+
def run_da_whole_show
|
38
|
+
if ARGV[0] == 'push'
|
39
|
+
ARGV.shift
|
40
|
+
plz_push_my_thing_on_git_thx_k_bye
|
41
|
+
else
|
42
|
+
default_to_using_the_plain_git
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
run_da_whole_show
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gitgud
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Leger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-02-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cli-ui
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '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'
|
27
|
+
description: Retry git push until it succeeds
|
28
|
+
email: hey@justinleger.ca
|
29
|
+
executables:
|
30
|
+
- gitgud
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- CHANGELOG.md
|
35
|
+
- LICENSE
|
36
|
+
- README.md
|
37
|
+
- bin/gitgud
|
38
|
+
homepage: https://github.com/jusleg/gitgud
|
39
|
+
licenses:
|
40
|
+
- MIT
|
41
|
+
metadata:
|
42
|
+
source_code_uri: https://github.com/jusleg/gitgud
|
43
|
+
changelog_uri: https://github.com/jusleg/gitgud/blob/master/CHANGELOG.md
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
requirements: []
|
59
|
+
rubygems_version: 3.0.3
|
60
|
+
signing_key:
|
61
|
+
specification_version: 4
|
62
|
+
summary: When things go wrong, you need to gitgud
|
63
|
+
test_files: []
|