fue 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db5d73f68b7c73685841e8e2cf7a677ebaea651d4d900fba9ed4986ab16a1ca1
4
- data.tar.gz: 1493b9161cc0a613349cb02901231bbf58dbb2bfb4df67e0773eba3ff0f845dc
3
+ metadata.gz: 6784a7e45c93b1e0622f4e719f58c541246a15fd64927245c97bd0f03574252a
4
+ data.tar.gz: ce2c2b1ef2f06c9cdd56d638ab4bbd7df8e1497ffb26190514d1e4b9f0ab621f
5
5
  SHA512:
6
- metadata.gz: 06cc2b6d34d6d3b0b04526034d87a8b2d588f1018d346da6fbd895b8c7816845194a62096eb1f158994b076b43ca68be08f40e5acde9be9a5e818f3e5422d7a0
7
- data.tar.gz: ce802803afc1595a9eff8ec0bcdbf1ec4a017aa97dc93269c5f5382b870ef6a2eca86576f4cb4a92dc6360d7255292b2dcf933942d1a32af4eb2a5684a4e35ec
6
+ metadata.gz: d503619065aab23dfd208305f1aafd9b8869538662397e6e471008be90c9713d510ac6e6af3ac5bfe2f1c392514749fa7eee8bd175aac2604da6e2223bb41ff4
7
+ data.tar.gz: 4d9ee34e80d5d031b291c4318fdab7733f95a5f5cf19e956078212b0a83e3700f54ee0e5227ee1635dcc2e0169e3d2a74d605a5db118f42d061e3ff0f17631b5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.3.1 (Next)
2
+
3
+ * [#29](https://github.com/dblock/fue/issues/29): Fix: `error: can't modify frozen String` - [@dblock](https://github.com/dblock).
4
+
1
5
  ### 0.3.0 (2020/05/22)
2
6
 
3
7
  * [#25](https://github.com/dblock/fue/pull/25): Added `contributors`, find repo contributors' e-mails - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -78,6 +78,20 @@ The access token will be generated with `public_repo` scope and stored in the ke
78
78
 
79
79
  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
80
 
81
+ ## Debugging
82
+
83
+ If you run into an unexpected error, try getting a stack trace with `GLI_DEBUG=true`.
84
+
85
+ ```
86
+ $ GLI_DEBUG=true fue find dblock
87
+
88
+ FrozenError: can't modify frozen String
89
+ /Users/dblock/source/dblock/fue/lib/fue/auth.rb:97:in `get_secure'
90
+ /Users/dblock/source/dblock/fue/lib/fue/auth.rb:80:in `get_password'
91
+ /Users/dblock/source/dblock/fue/lib/fue/auth.rb:50:in `password'
92
+ /Users/dblock/source/dblock/fue/lib/fue/auth.rb:59:in `block in github'
93
+ ```
94
+
81
95
  ## Contributing
82
96
 
83
97
  There are [a few feature requests and known issues](https://github.com/dblock/fue/issues). Please contribute! See [CONTRIBUTING](CONTRIBUTING.md).
data/lib/fue/auth.rb CHANGED
@@ -28,7 +28,7 @@ module Fue
28
28
  private
29
29
 
30
30
  def get_git_username
31
- Fue::Shell.system!('git config github.user')
31
+ Fue::Shell.system!('git config user.name')
32
32
  rescue RuntimeError
33
33
  nil
34
34
  end
@@ -88,7 +88,7 @@ module Fue
88
88
  def get_secure
89
89
  current_tty = `stty -g`
90
90
  system 'stty raw -echo -icanon isig' if $CHILD_STATUS.success?
91
- input = ''
91
+ input = String.new
92
92
  while (char = $stdin.getbyte) && !((char == 13) || (char == 10))
93
93
  if (char == 127) || (char == 8)
94
94
  input[-1, 1] = '' unless input.empty?
data/lib/fue/finder.rb CHANGED
@@ -58,7 +58,7 @@ module Fue
58
58
  depth: options[:depth] || 1
59
59
  }
60
60
 
61
- STDOUT.write "Searching for emails for #{options[:username]} ." if options[:verbose]
61
+ $stdout.write "Searching for emails for #{options[:username]} ." if options[:verbose]
62
62
 
63
63
  emails = Set.new
64
64
 
@@ -67,8 +67,8 @@ module Fue
67
67
  response = graphql_client.query(query, query_options)
68
68
  repositories = response&.data&.user&.repositories
69
69
  repositories&.nodes&.each do |history|
70
- master_history = history.default_branch_ref&.target&.history
71
- master_history&.nodes&.each do |node|
70
+ default_history = history.default_branch_ref&.target&.history
71
+ default_history&.nodes&.each do |node|
72
72
  emails << "#{node.author.name} <#{node.author.email}>"
73
73
  end
74
74
  end
@@ -78,7 +78,7 @@ module Fue
78
78
  max_breadth -= 100
79
79
  break if max_breadth <= 0
80
80
 
81
- STDOUT.write '.' if options[:verbose]
81
+ $stdout.write '.' if options[:verbose]
82
82
  end
83
83
 
84
84
  puts " found #{emails.size} email address#{emails.size == 1 ? '' : 'es'}." if options[:verbose]
@@ -121,7 +121,7 @@ module Fue
121
121
 
122
122
  logins = Set.new
123
123
 
124
- STDOUT.write 'Fetching contributors .' if options[:verbose]
124
+ $stdout.write 'Fetching contributors .' if options[:verbose]
125
125
 
126
126
  loop do
127
127
  response = graphql_client.query(query, query_options)
@@ -131,19 +131,17 @@ module Fue
131
131
  logins << login if login
132
132
  end
133
133
  query_options[:cursor] = history&.page_info.end_cursor
134
- STDOUT.write '.' if options[:verbose]
134
+ $stdout.write '.' if options[:verbose]
135
135
  break unless query_options[:cursor]
136
136
  end
137
137
 
138
138
  puts " found #{logins.size} contributor#{logins.size == 1 ? '' : 's'}." if options[:verbose]
139
139
 
140
- Hash[logins.map do |login|
141
- begin
142
- [login, emails(options.merge(username: login))]
143
- rescue StandardError => e
144
- warn e.to_s
145
- end
146
- end.compact]
140
+ logins.map do |login|
141
+ [login, emails(options.merge(username: login))]
142
+ rescue StandardError => e
143
+ warn e.to_s
144
+ end.compact.to_h
147
145
  end
148
146
 
149
147
  private
data/lib/fue/security.rb CHANGED
@@ -33,8 +33,8 @@ module Fue
33
33
  def security_path
34
34
  @security_path ||= begin
35
35
  `which security`.chomp
36
- rescue StandardError
37
- 'security'
36
+ rescue StandardError
37
+ 'security'
38
38
  end
39
39
  end
40
40
  end
data/lib/fue/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fue
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-22 00:00:00.000000000 Z
11
+ date: 2021-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github_api
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.3.2
55
- description:
55
+ description:
56
56
  email: dblock@dblock.org
57
57
  executables:
58
58
  - fue
@@ -74,7 +74,7 @@ homepage: http://github.com/dblock/fue
74
74
  licenses:
75
75
  - MIT
76
76
  metadata: {}
77
- post_install_message:
77
+ post_install_message:
78
78
  rdoc_options: []
79
79
  require_paths:
80
80
  - lib
@@ -82,15 +82,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: '0'
85
+ version: '2.5'
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: 1.3.6
91
91
  requirements: []
92
- rubygems_version: 3.1.3
93
- signing_key:
92
+ rubygems_version: 3.0.4
93
+ signing_key:
94
94
  specification_version: 4
95
95
  summary: Find an e-mail address of a GitHub user.
96
96
  test_files: []