git_helper 3.6.2 → 3.6.4

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: 64c4ad9b8acf74b29b341f534243721f4bf168d1d15c524e052a201b867e9c6d
4
- data.tar.gz: '01228b5f41daa653e47e11a33f5cde747edfc795759ab5b7c0b474d655538431'
3
+ metadata.gz: c9226b3191cd9f55de0c9bb238dab97419db8c37e5f77c88d4e6a15898d7618d
4
+ data.tar.gz: 4177017b7370efbd05a7948c5cae06061cf0d6cfd7d9ae8a11bf9400aa547740
5
5
  SHA512:
6
- metadata.gz: 90f31e2053f842aaa9a536de4a79c9e2e066fd08c8703367520b2728e39a3b9aa88374230fbc2211993c709077cc573272e2e79dc996d5009dbdd864986c0541
7
- data.tar.gz: e683017056105ba89126467da7cea039ee7c0d88350f8971ed0e130d85fcc0e2ea383600e7e88c01806d68540e2183bb5e30f6a8130d9fbabdce4bcbba545ab8
6
+ metadata.gz: 30efc1f7f69ce974227d7e1c8bc80ab0fde658626eed6b2bd8fb98ebc628f0ccace6c322ad448574aa981316dd421ff34d3e33ba2b1f2b318bf5b46019b7252b
7
+ data.tar.gz: e1fe72d9ea6bd3766024ac6cddfd5ae7db7d3baa2dd38cc76e30e624cf29b9baea7ac730d3247cb6552660c7451edfd2fd04de46067fd59c6168eaefd396ff3c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_helper (3.6.1.pre.test)
4
+ git_helper (3.6.4)
5
5
  gli (~> 2.13)
6
6
  highline_wrapper (~> 1.1)
7
7
 
@@ -10,9 +10,9 @@ GEM
10
10
  specs:
11
11
  ast (2.4.2)
12
12
  coderay (1.1.3)
13
- concurrent-ruby (1.1.10)
13
+ concurrent-ruby (1.2.2)
14
14
  diff-lcs (1.5.0)
15
- faker (3.0.0)
15
+ faker (3.1.1)
16
16
  i18n (>= 1.8.11, < 2)
17
17
  ffi (1.15.5)
18
18
  formatador (1.1.0)
@@ -31,13 +31,13 @@ GEM
31
31
  guard (~> 2.1)
32
32
  guard-compat (~> 1.1)
33
33
  rspec (>= 2.99.0, < 4.0)
34
- highline (2.0.3)
34
+ highline (2.1.0)
35
35
  highline_wrapper (1.3.1)
36
36
  highline (~> 2.0)
37
37
  i18n (1.12.0)
38
38
  concurrent-ruby (~> 1.0)
39
39
  json (2.6.3)
40
- listen (3.7.1)
40
+ listen (3.8.0)
41
41
  rb-fsevent (~> 0.10, >= 0.10.3)
42
42
  rb-inotify (~> 0.9, >= 0.9.10)
43
43
  lumberjack (1.2.8)
@@ -47,46 +47,46 @@ GEM
47
47
  nenv (~> 0.1)
48
48
  shellany (~> 0.0)
49
49
  parallel (1.22.1)
50
- parser (3.1.3.0)
50
+ parser (3.2.1.1)
51
51
  ast (~> 2.4.1)
52
- pry (0.14.1)
52
+ pry (0.14.2)
53
53
  coderay (~> 1.1)
54
54
  method_source (~> 1.0)
55
55
  rainbow (3.1.1)
56
56
  rb-fsevent (0.11.2)
57
57
  rb-inotify (0.10.1)
58
58
  ffi (~> 1.0)
59
- regexp_parser (2.6.1)
59
+ regexp_parser (2.7.0)
60
60
  rexml (3.2.5)
61
61
  rspec (3.12.0)
62
62
  rspec-core (~> 3.12.0)
63
63
  rspec-expectations (~> 3.12.0)
64
64
  rspec-mocks (~> 3.12.0)
65
- rspec-core (3.12.0)
65
+ rspec-core (3.12.1)
66
66
  rspec-support (~> 3.12.0)
67
- rspec-expectations (3.12.1)
67
+ rspec-expectations (3.12.2)
68
68
  diff-lcs (>= 1.2.0, < 2.0)
69
69
  rspec-support (~> 3.12.0)
70
- rspec-mocks (3.12.1)
70
+ rspec-mocks (3.12.3)
71
71
  diff-lcs (>= 1.2.0, < 2.0)
72
72
  rspec-support (~> 3.12.0)
73
73
  rspec-support (3.12.0)
74
- rubocop (1.40.0)
74
+ rubocop (1.48.0)
75
75
  json (~> 2.3)
76
76
  parallel (~> 1.10)
77
- parser (>= 3.1.2.1)
77
+ parser (>= 3.2.0.0)
78
78
  rainbow (>= 2.2.2, < 4.0)
79
79
  regexp_parser (>= 1.8, < 3.0)
80
80
  rexml (>= 3.2.5, < 4.0)
81
- rubocop-ast (>= 1.23.0, < 2.0)
81
+ rubocop-ast (>= 1.26.0, < 2.0)
82
82
  ruby-progressbar (~> 1.7)
83
- unicode-display_width (>= 1.4.0, < 3.0)
84
- rubocop-ast (1.24.0)
85
- parser (>= 3.1.1.0)
86
- ruby-progressbar (1.11.0)
83
+ unicode-display_width (>= 2.4.0, < 3.0)
84
+ rubocop-ast (1.27.0)
85
+ parser (>= 3.2.1.0)
86
+ ruby-progressbar (1.13.0)
87
87
  shellany (0.0.1)
88
88
  thor (1.2.1)
89
- unicode-display_width (2.3.0)
89
+ unicode-display_width (2.4.2)
90
90
 
91
91
  PLATFORMS
92
92
  arm64-darwin-21
@@ -102,4 +102,4 @@ DEPENDENCIES
102
102
  rubocop (~> 1.10)
103
103
 
104
104
  BUNDLED WITH
105
- 2.3.26
105
+ 2.4.8
data/README.md CHANGED
@@ -6,32 +6,37 @@
6
6
  gem install git_helper
7
7
  ```
8
8
 
9
- Some of the commands in this gem can be used without any additional configuration. However, others utilize special GitHub or GitLab configuration. To provide access tokens for this, create a `~/.git_helper/config.yml` file. The contents should look like this:
10
-
11
- ```
12
- :github_user: GITHUB-USERNAME
13
- :github_token: GITHUB-TOKEN
14
- :gitlab_user: GITLAB-USERNAME
15
- :gitlab_token: GITLAB-TOKEN
16
- ```
17
-
18
- To create or see what access tokens you have, look [here for GitHub personal access tokens](https://github.com/settings/tokens) and [here for GitLab access tokens](https://gitlab.com/profile/personal_access_tokens). You could either have one set of tokens for each computer you use, or just have one set of tokens for all computers that you rotate periodically.
19
-
20
9
  Once the gem is installed, run this to view the help screen:
10
+
21
11
  ```bash
22
12
  git-helper --help
23
13
  ```
24
14
 
25
- To see what version of git_helper you're running, run:
15
+ To see what version of Git Helper you're running, run:
16
+
26
17
  ```bash
27
18
  git-helper --version
28
19
  ```
29
20
 
30
- To help you create the `~/.git_helper/config.yml` file and set up the plugins (see below), run this command and allow the command to walk you through the prompts:
21
+ Some of the commands in this gem can be used without any additional configuration. However, others utilize special GitHub or GitLab configuration. To set up access with GitHub/GitLab, run:
22
+
31
23
  ```bash
32
24
  git-helper setup
33
25
  ```
34
26
 
27
+ This will give you the option to set up credentials at GitHub and/or GitLab, as well as give you the choice to set up Git Helper as a plugin or not (see below).
28
+
29
+ The final result will be a `~/.git_helper/config.yml` file with the contents in this form:
30
+
31
+ ```
32
+ :github_user: GITHUB-USERNAME
33
+ :github_token: GITHUB-TOKEN
34
+ :gitlab_user: GITLAB-USERNAME
35
+ :gitlab_token: GITLAB-TOKEN
36
+ ```
37
+
38
+ To create or see what access tokens you have, look [here for GitHub personal access tokens](https://github.com/settings/tokens) and [here for GitLab access tokens](https://gitlab.com/profile/personal_access_tokens). You could either have one set of tokens for each computer you use, or just have one set of tokens for all computers that you rotate periodically.
39
+
35
40
  ## Plugin Usage
36
41
 
37
42
  As an additional option, you can set each of the following commands to be a git plugin, meaning you can call them in a way that feels even more git-native:
@@ -42,21 +47,12 @@ git-helper clean-branches git clean-branches
42
47
  git-helper code-request git code-request
43
48
  ```
44
49
 
45
- To do this, download the `plugins.zip` file in the root of this directory. Unzip and place the contents in the appropriate location:
50
+ Running the `setup` command will give you the option to set this up:
46
51
 
47
52
  ```bash
48
- mkdir ~/.git_helper
49
- unzip path/to/downloaded/plugins.zip -d ~/.git_helper
50
- ```
51
-
52
- Now, the plugins will live in `~/.git_helper/plugins/*`. Add the following line to your `~/.bash_profile`:
53
-
54
- ```bash
55
- export PATH=/path/to/computer/home/.git_helper/plugins:$PATH
53
+ git-helper setup
56
54
  ```
57
55
 
58
- And then run `source ~/.bash_profile`.
59
-
60
56
  ## Alias Usage
61
57
 
62
58
  To make the commands even shorter, I recommend setting aliases. You can either set aliases through git itself, like this (only possible if you also use the plugin option):
@@ -67,7 +63,7 @@ git config --global alias.nb new-branch
67
63
 
68
64
  And then running `git nb` maps to `git new-branch`, which through the plugin, maps to `git-helper new-branch`.
69
65
 
70
- Or you can set the alias through your `~/.bashrc` (which is my preferred method because it can make the command even shorter, and doesn't require the plugin usage). To do this, add lines like this to the `~/.bashrc` file and run `source ~/.bashrc`:
66
+ Or you can set the alias through your `~/.zshrc` (which is my preferred method because it can make the command even shorter, and doesn't require the plugin usage). To do this, add lines like this to the `~/.zshrc` file and run `source ~/.zshrc`:
71
67
 
72
68
  ```bash
73
69
  alias gnb="git new-branch"
@@ -19,7 +19,7 @@ module GitHelper
19
19
  end
20
20
 
21
21
  def git_config_file_path
22
- "#{Dir.pwd.scan(%r{\A/\w*/\w*/}).first}.git_helper/config.yml"
22
+ "#{Dir.home}/.git_helper/config.yml"
23
23
  end
24
24
 
25
25
  private def config_file
@@ -24,22 +24,22 @@ module GitHelper
24
24
 
25
25
  private def execute_plugins
26
26
  answer = highline.ask_yes_no(
27
- 'Do you wish to set up the Git Helper plugins? (y/n) (This process will ' \
28
- 'attempt to use your GitHub personal access token to authenticate)',
27
+ 'Do you wish to set up the Git Helper plugins? (y/n)',
29
28
  { required: true }
30
29
  )
31
30
 
32
31
  return unless answer
33
32
 
34
33
  create_or_update_plugin_files
35
- puts "\nNow add this line to your ~/.bash_profile:\n " \
36
- 'export PATH=/path/to/computer/home/.git_helper/plugins:$PATH'
34
+ puts "\nNow add this line to your ~/.zshrc:\n " \
35
+ 'export PATH="$HOME/.git_helper/plugins:$PATH"'
37
36
  puts "\nDone!"
38
37
  end
39
38
 
40
39
  private def create_or_update_config_file
41
40
  contents = generate_file_contents
42
41
  puts "Creating or updating your #{config_file} file..."
42
+ FileUtils.mkdir_p("#{Dir.home}/.git_helper")
43
43
  File.open(config_file, 'w') { |file| file.puts contents }
44
44
  puts "\nDone!\n\n"
45
45
  end
@@ -80,24 +80,20 @@ module GitHelper
80
80
  highline.ask(prompt, { required: true, secret: secret })
81
81
  end
82
82
 
83
- # rubocop:disable Metrics/MethodLength
84
83
  private def create_or_update_plugin_files
85
- plugins_dir = "#{Dir.pwd.scan(%r{\A/\w*/\w*/}).first}.git_helper/plugins"
84
+ plugins_dir = "#{Dir.home}/.git_helper/plugins"
86
85
  plugins_url = 'https://api.github.com/repos/emmahsax/git_helper/contents/plugins'
87
86
  header = 'Accept: application/vnd.github.v3.raw'
88
- token = git_config_reader.github_token
89
- user = git_config_reader.github_user
90
87
 
91
88
  FileUtils.mkdir_p(plugins_dir)
92
89
 
93
- all_plugins = JSON.parse(`curl -s -u #{user}:#{token} -H "#{header}" -L "#{plugins_url}"`)
90
+ all_plugins = JSON.parse(`curl -s -H "#{header}" -L "#{plugins_url}"`)
94
91
 
95
92
  all_plugins.each do |plugin|
96
- plugin_content = `curl -s -u #{user}:#{token} -H "#{header}" -L "#{plugins_url}/#{plugin['name']}"`
93
+ plugin_content = `curl -s -H "#{header}" -L "#{plugins_url}/#{plugin['name']}"`
97
94
  File.open("#{plugins_dir}/#{plugin['name']}", 'w') { |file| file.puts plugin_content }
98
95
  end
99
96
  end
100
- # rubocop:enable Metrics/MethodLength
101
97
 
102
98
  private def config_file
103
99
  git_config_reader.git_config_file_path
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitHelper
4
- VERSION = '3.6.2'
4
+ VERSION = '3.6.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.2
4
+ version: 3.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emma Sax
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -153,7 +153,6 @@ files:
153
153
  - lib/git_helper/pull_request.rb
154
154
  - lib/git_helper/setup.rb
155
155
  - lib/git_helper/version.rb
156
- - plugins.zip
157
156
  - renovate.json
158
157
  homepage: https://github.com/emmahsax/git_helper
159
158
  licenses:
@@ -175,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
174
  - !ruby/object:Gem::Version
176
175
  version: '0'
177
176
  requirements: []
178
- rubygems_version: 3.3.26
177
+ rubygems_version: 3.4.8
179
178
  signing_key:
180
179
  specification_version: 4
181
180
  summary: A set of GitHub and GitLab workflow scripts
data/plugins.zip DELETED
Binary file