gitgud 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/README.md +2 -2
  4. data/bin/gitgud +15 -3
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12b0735e4349da5e406d979f52578d20a92457924676582a031ae91a68fca497
4
- data.tar.gz: 40db6751b09dbf1aabb4e36e3543d3a82ea0f27d3d54cf45d60bced0ef2ca5d8
3
+ metadata.gz: 109ebe21ee938f51c85b52d74a0fc44417a76ba7ad6bc557af5ad8e1395a3300
4
+ data.tar.gz: bcd248280d58900dc2d8c9eaecdc4c52c9d7ffe7315e549a38eac685012762ed
5
5
  SHA512:
6
- metadata.gz: 0ce5be83ee18781a9ad325815dcce977a049178c88ad5d8e37e37dc0abed3d50623fd2c5132d4fd04f66d6f1e3991459eae1ffd91b9c86d570a92d6329cfd3d2
7
- data.tar.gz: 79164c9b9393d2b17cfc1a0e2ed08d7ac29c1602c00832b0a28d15d55995c7d3657bbfc065690e291c7f748f99f01ea800db7c0a63b1e92eb121d861a6df9866
6
+ metadata.gz: 84dfbd403a1b6dd9877f688afd8681e8c4ef48e30e3374b94b221ec8bd20a6bb06d7567877673c4988da0051ab125d3f336b733bfac9f4f27acf7b1ff78abd8e
7
+ data.tar.gz: 715907ac22ababcc6ee1053e8b8bb599b19a53098b7fefdb12376cbaeaf0aa81e7b1bc272e99ad67fbe5491b6e13f67c45dbb9847332c00100b3dde9dd7117b1
@@ -1,3 +1,6 @@
1
+ ## V0.1.2
2
+ Cleaner UI by using Open3. Gitgud calls are now limited to 20 retries.
3
+
1
4
  ## V0.1.1
2
5
  Support args with spaces and avoid shell escape problems - [@lugray](https://github.com/lugray)
3
6
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # gitgud ![gitgud badge](https://img.shields.io/badge/gitgud%3F-good-brightgreen)
1
+ # gitgud ![gitgud badge](https://img.shields.io/badge/gitgud%3F-good-brightgreen) [![Gem Version](https://badge.fury.io/rb/gitgud.svg)](https://badge.fury.io/rb/gitgud)
2
2
 
3
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
4
 
5
- ![gitgud](https://user-images.githubusercontent.com/4406751/75472054-f3c92680-5960-11ea-9eaa-eff24eb4dfe4.gif)
5
+ ![success after multiple retries](https://user-images.githubusercontent.com/4406751/75736774-1c884d80-5ccc-11ea-9e2c-5436937d38ed.gif)
6
6
 
7
7
 
8
8
  ## `gitgud` is the new `git`
data/bin/gitgud CHANGED
@@ -1,14 +1,26 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'cli/ui'
4
+ require 'open3'
4
5
 
5
6
  def try_to_push_this_thing(spinner)
6
7
  counter = 1
7
- while !system('git', 'push', *ARGV)
8
+ while counter <= 20
8
9
  spinner.update_title(spinner_title(counter))
9
10
  counter += 1
11
+
12
+ output, status = Open3.capture2e('git', 'push', *ARGV)
13
+
14
+ if status.success?
15
+ return spinner.update_title("Successfully git pushed")
16
+ elsif !output.match?(/remote: Internal Server Error\sEverything up-to-date/)
17
+ spinner.update_title("Encountered error while git pushing\n#{output}")
18
+ return :task_failed
19
+ end
10
20
  end
11
- spinner.update_title('Successfully git pushed')
21
+
22
+ spinner.update_title("Unsuccessful after 20 attemps")
23
+ :task_failed
12
24
  end
13
25
 
14
26
  def spinner_title(attempt_number = 1)
@@ -21,7 +33,7 @@ end
21
33
 
22
34
  def plz_push_my_thing_on_git_thx_k_bye
23
35
  CLI::UI::StdoutRouter.enable
24
- spin_group = CLI::UI::SpinGroup.new
36
+ spin_group = CLI::UI::SpinGroup.new(auto_debrief: false)
25
37
  spin_group.add(spinner_title) { |spinner| try_to_push_this_thing(spinner) }
26
38
  spin_group.wait
27
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitgud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Leger
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.0.3
59
+ rubygems_version: 3.1.2
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: When things go wrong, you need to gitgud