fue 0.3.1 → 0.5.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 +4 -4
- data/CHANGELOG.md +12 -1
- data/LICENSE.md +1 -1
- data/README.md +17 -13
- data/bin/fue +1 -1
- data/lib/fue/auth.rb +5 -44
- data/lib/fue/finder.rb +1 -1
- data/lib/fue/security.rb +6 -5
- data/lib/fue/version.rb +1 -1
- data/lib/fue.rb +1 -0
- metadata +38 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5c3f2023a6442f02c444f06b56ad83fc2a56be8efb26cf4dc8fccc78588024f
|
4
|
+
data.tar.gz: f3b4c832901ecb0f24b88b61da78e46b7e6fd283c550a790b829597b9ee7b088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4741da6ec6c69b1c6a4c974a6f7afb8205fbd08889b98cb69e235968dbc65a48859f6a10977d8c3284f8778aefa744e354911e3c7d7267266b5b32ad005eb654
|
7
|
+
data.tar.gz: 2dfee6994be50fd5be14a1930e9397640414b4532ca96d7ac2e3c5a76b2d19158df556db0f12d4dcfadd6bebc5d866fc5280df1dc420dc5500d3d15d81e6abbb
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
-
### 0.
|
1
|
+
### 0.5.0 (2024-11-15)
|
2
|
+
|
3
|
+
* [#33](https://github.com/dblock/fue/pull/33): Fix: shell escape command lines - [@dblock](https://github.com/dblock).
|
4
|
+
* [#32](https://github.com/dblock/fue/pull/32): Upgraded to ruby 3.3 - [@dblock](https://github.com/dblock).
|
5
|
+
|
6
|
+
### 0.4.0 (2022/12/31)
|
7
|
+
|
8
|
+
* [#31](https://github.com/dblock/fue/pull/31): Use Danger - [@dblock](https://github.com/dblock).
|
9
|
+
* [#31](https://github.com/dblock/fue/pull/31): Replace Travis CI with GHA - [@dblock](https://github.com/dblock).
|
10
|
+
* [#31](https://github.com/dblock/fue/pull/31): Remove deprecated GitHub PAT creation workflow - [@dblock](https://github.com/dblock).
|
11
|
+
|
12
|
+
### 0.3.1 (2021/07/19)
|
2
13
|
|
3
14
|
* [#29](https://github.com/dblock/fue/issues/29): Fix: `error: can't modify frozen String` - [@dblock](https://github.com/dblock).
|
4
15
|
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,7 @@ Fue
|
|
2
2
|
===
|
3
3
|
|
4
4
|
[](https://badge.fury.io/rb/fue)
|
5
|
-
[](https://ci.appveyor.com/project/dblock/fue)
|
5
|
+
[](https://github.com/dblock/fue/actions/workflows/test.yml)
|
7
6
|
|
8
7
|
Find e-mail addresses of a Github users from their commit logs.
|
9
8
|
|
@@ -11,6 +10,20 @@ Fue is short for "Finding Unicorn Engineers".
|
|
11
10
|
|
12
11
|

|
13
12
|
|
13
|
+
## Table of Contents
|
14
|
+
|
15
|
+
- [Usage](#usage)
|
16
|
+
- [Commands](#commands)
|
17
|
+
- [Find Someone’s Email](#find-someones-email)
|
18
|
+
- [Find All Repo Contributors’ Emails](#find-all-repo-contributors-emails)
|
19
|
+
- [Options](#options)
|
20
|
+
- [Specify More Depth](#specify-more-depth)
|
21
|
+
- [Get Help](#get-help)
|
22
|
+
- [Access Tokens](#access-tokens)
|
23
|
+
- [Debugging](#debugging)
|
24
|
+
- [Contributing](#contributing)
|
25
|
+
- [Copyright and License](#copyright-and-license)
|
26
|
+
|
14
27
|
## Usage
|
15
28
|
|
16
29
|
```
|
@@ -65,16 +78,7 @@ Displays additional options.
|
|
65
78
|
|
66
79
|
### Access Tokens
|
67
80
|
|
68
|
-
Fue will
|
69
|
-
|
70
|
-
```
|
71
|
-
$ fue find defunkt
|
72
|
-
Enter dblock's GitHub password (never stored): ******************
|
73
|
-
Enter GitHub 2FA code: ******
|
74
|
-
Token saved to keychain.
|
75
|
-
```
|
76
|
-
|
77
|
-
The access token will be generated with `public_repo` scope and stored in the keychain. It can be later deleted from [here](https://github.com/settings/tokens). You can also skip the prompts and use a previously obtained token with `-t` or by setting the `GITHUB_ACCESS_TOKEN` environment variable.
|
81
|
+
Fue will ask you to create a personal access token and will store it in the keychain. The access token should be created with `public_repo` scope [here](https://github.com/settings/tokens). You can also skip the prompts and use a previously obtained token with `-t` or by setting the `GITHUB_ACCESS_TOKEN` environment variable.
|
78
82
|
|
79
83
|
See [Creating a Personal Access Token for the Command Line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) for more information about personal tokens.
|
80
84
|
|
@@ -98,6 +102,6 @@ There are [a few feature requests and known issues](https://github.com/dblock/fu
|
|
98
102
|
|
99
103
|
## Copyright and License
|
100
104
|
|
101
|
-
Copyright (c) 2018-
|
105
|
+
Copyright (c) 2018-2022, Daniel Doubrovkine, [Artsy](http://artsy.github.io), with help from [Orta](https://github.com/orta).
|
102
106
|
|
103
107
|
This project is licensed under the [MIT License](LICENSE.md).
|
data/bin/fue
CHANGED
@@ -11,7 +11,7 @@ class App
|
|
11
11
|
version Fue::VERSION
|
12
12
|
|
13
13
|
switch %i[v verbose], desc: 'Produce verbose output.', default_value: false
|
14
|
-
flag %i[t token], desc: 'GitHub access token.', default_value: ENV
|
14
|
+
flag %i[t token], desc: 'GitHub access token.', default_value: ENV.fetch('GITHUB_ACCESS_TOKEN', nil)
|
15
15
|
flag %i[u username], desc: 'GitHub username.', default_value: Fue::Auth.instance.username
|
16
16
|
|
17
17
|
arguments :strict
|
data/lib/fue/auth.rb
CHANGED
@@ -27,46 +27,17 @@ module Fue
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
+
def github_token(_code = nil)
|
31
|
+
puts 'Create a personal access token on https://github.com/settings/tokens and paste it here: '
|
32
|
+
get_secure
|
33
|
+
end
|
34
|
+
|
30
35
|
def get_git_username
|
31
36
|
Fue::Shell.system!('git config user.name')
|
32
37
|
rescue RuntimeError
|
33
38
|
nil
|
34
39
|
end
|
35
40
|
|
36
|
-
def github_token(code = nil)
|
37
|
-
github(code).auth.create(scopes: ['public_repo'], note: note).token
|
38
|
-
rescue Github::Error::Unauthorized => e
|
39
|
-
case e.response_headers['X-GitHub-OTP']
|
40
|
-
when /required/
|
41
|
-
github_token(get_code)
|
42
|
-
else
|
43
|
-
raise e
|
44
|
-
end
|
45
|
-
rescue Github::Error::UnprocessableEntity => e
|
46
|
-
raise e, 'A fue token already exists! Please revoke all previously-generated fue personal access tokens at https://github.com/settings/tokens.'
|
47
|
-
end
|
48
|
-
|
49
|
-
def password
|
50
|
-
@password ||= get_password
|
51
|
-
end
|
52
|
-
|
53
|
-
def note
|
54
|
-
"Fui (https://github.com/dblock/fue) on #{Socket.gethostname}"
|
55
|
-
end
|
56
|
-
|
57
|
-
def github(code = nil)
|
58
|
-
Github.new do |config|
|
59
|
-
config.basic_auth = [username, password].join(':')
|
60
|
-
if code
|
61
|
-
config.connection_options = {
|
62
|
-
headers: {
|
63
|
-
'X-GitHub-OTP' => code
|
64
|
-
}
|
65
|
-
}
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
41
|
def get_username
|
71
42
|
print 'Enter GitHub username: '
|
72
43
|
username = $stdin.gets
|
@@ -75,16 +46,6 @@ module Fue
|
|
75
46
|
raise e, 'ctrl + c'
|
76
47
|
end
|
77
48
|
|
78
|
-
def get_password
|
79
|
-
print "Enter #{username}'s GitHub password (never stored): "
|
80
|
-
get_secure
|
81
|
-
end
|
82
|
-
|
83
|
-
def get_code
|
84
|
-
print 'Enter GitHub 2FA code: '
|
85
|
-
get_secure
|
86
|
-
end
|
87
|
-
|
88
49
|
def get_secure
|
89
50
|
current_tty = `stty -g`
|
90
51
|
system 'stty raw -echo -icanon isig' if $CHILD_STATUS.success?
|
data/lib/fue/finder.rb
CHANGED
data/lib/fue/security.rb
CHANGED
@@ -18,12 +18,12 @@ module Fue
|
|
18
18
|
def security(command = nil, options = nil)
|
19
19
|
run = [security_path]
|
20
20
|
run << "#{command}-internet-password"
|
21
|
-
run << "-a #{options[:username]}"
|
22
|
-
run << "-s #{options[:server]}"
|
21
|
+
run << "-a #{Shellwords.escape(options[:username])}"
|
22
|
+
run << "-s #{Shellwords.escape(options[:server])}"
|
23
23
|
if command == 'add'
|
24
|
-
run << "-l #{options[:label]}"
|
24
|
+
run << "-l #{Shellwords.escape(options[:label])}"
|
25
25
|
run << '-U'
|
26
|
-
run << "-w #{options[:password]}" if options.key?(:password)
|
26
|
+
run << "-w #{Shellwords.escape(options[:password])}" if options.key?(:password)
|
27
27
|
else
|
28
28
|
run << '-w'
|
29
29
|
end
|
@@ -32,7 +32,8 @@ module Fue
|
|
32
32
|
|
33
33
|
def security_path
|
34
34
|
@security_path ||= begin
|
35
|
-
`which security`.chomp
|
35
|
+
path = `which security`.chomp
|
36
|
+
path.empty? ? 'security' : path
|
36
37
|
rescue StandardError
|
37
38
|
'security'
|
38
39
|
end
|
data/lib/fue/version.rb
CHANGED
data/lib/fue.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "<"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: github_api
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
33
|
+
version: 0.19.0
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
40
|
+
version: 0.19.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: gli
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +58,28 @@ dependencies:
|
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
61
|
+
version: 0.6.0
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
68
|
+
version: 0.6.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: command_line
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description:
|
56
84
|
email: dblock@dblock.org
|
57
85
|
executables:
|
@@ -73,7 +101,8 @@ files:
|
|
73
101
|
homepage: http://github.com/dblock/fue
|
74
102
|
licenses:
|
75
103
|
- MIT
|
76
|
-
metadata:
|
104
|
+
metadata:
|
105
|
+
rubygems_mfa_required: 'true'
|
77
106
|
post_install_message:
|
78
107
|
rdoc_options: []
|
79
108
|
require_paths:
|
@@ -82,14 +111,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
111
|
requirements:
|
83
112
|
- - ">="
|
84
113
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
114
|
+
version: '3.0'
|
86
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
116
|
requirements:
|
88
117
|
- - ">="
|
89
118
|
- !ruby/object:Gem::Version
|
90
119
|
version: 1.3.6
|
91
120
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.5.22
|
93
122
|
signing_key:
|
94
123
|
specification_version: 4
|
95
124
|
summary: Find an e-mail address of a GitHub user.
|