githuh 0.2.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 511863db2788e1b18cb2dfa73b3f4547191cbc0ed3420d02f7da840cd39c3baf
4
- data.tar.gz: 81d396dea2a067c736225149f213c99a528cf6e4fa17ce7ecc1662b0649c5034
3
+ metadata.gz: b85ccd845fbf4f02072b566abd362adc5656eff6746c092ee1591011c69da0ab
4
+ data.tar.gz: 7becd01e22f79e9a6c79dcb9292f5003d48a4fc57596c9ace415d1bff44f8e6a
5
5
  SHA512:
6
- metadata.gz: 7dddbd8c7e9c878be15af398d89150d0d1c72ef73fb780f85f7e126b7a42b41fc9b902828518580a6e7fe4ba37898dae104dec49380be70d73529977a228939f
7
- data.tar.gz: 5524851da5c59ffe9009502d1d0366a414406e79583cefd0826a0c9f6ba9440e35ed8d6208d7bc20900953f309a8942b14d0c19e60df32ef4ecd13f780b769f5
6
+ metadata.gz: d425dec858b7587d373b30a8c1dbdeddcdfda625230e32a0cc49ec9d4a28574c164d2330a01ff77c69f5bb57c164aa7c3b6cedfb37e27506dce28910eb176442
7
+ data.tar.gz: dba51e9fa2685db0978cdb051801ec573f97fd43f740c28fea5250afba8b7e121e265d3f962ca5466a4138eb43344bd81c99558f5a7f7c7859323d2c7f916c84
data/.envrc CHANGED
@@ -1,4 +1,4 @@
1
-
2
- export GITHUB_TOKEN=47b933ddfdc4696f27b67299bf9fe59ce0925a78
3
-
1
+ # vim: ft=bash
4
2
  export PATH=$(pwd)/exe:${PATH}
3
+ [[ -f .envrc.local ]] && source .envrc.local
4
+
@@ -21,5 +21,5 @@ jobs:
21
21
  run: |
22
22
  gem install bundler
23
23
  bundle install --jobs 4 --retry 3
24
- bundle exec rspec
25
- bundle exec rubocop
24
+ RUBYOPT=-W0 bundle exec rspec
25
+ RUBYOPT=-W0 bundle exec rubocop
data/.gitignore CHANGED
@@ -23,3 +23,5 @@ pkg
23
23
  .yardoc
24
24
  .ruby-version
25
25
  *.csv
26
+ .envrc.local
27
+ tmp/**
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-09-09 20:59:51 UTC using RuboCop version 0.90.0.
3
+ # on 2020-09-11 02:48:55 UTC using RuboCop version 0.90.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -35,7 +35,7 @@ Layout/EndAlignment:
35
35
  - 'lib/githuh/cli/commands/issue/export.rb'
36
36
  - 'lib/githuh/cli/commands/repo/list.rb'
37
37
 
38
- # Offense count: 9
38
+ # Offense count: 1
39
39
  # Cop supports --auto-correct.
40
40
  # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
41
41
  # SupportedHashRocketStyles: key, separator, table
@@ -52,22 +52,6 @@ Layout/IndentationWidth:
52
52
  Exclude:
53
53
  - 'lib/githuh/cli/commands/issue/export.rb'
54
54
 
55
- # Offense count: 1
56
- # Cop supports --auto-correct.
57
- # Configuration parameters: EnforcedStyle, IndentationWidth.
58
- # SupportedStyles: aligned, indented
59
- Layout/MultilineOperationIndentation:
60
- Exclude:
61
- - 'lib/githuh/cli/commands/issue/export.rb'
62
-
63
- # Offense count: 1
64
- # Cop supports --auto-correct.
65
- # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
66
- # SupportedStylesForExponentOperator: space, no_space
67
- Layout/SpaceAroundOperators:
68
- Exclude:
69
- - 'lib/githuh/cli/commands/issue/export.rb'
70
-
71
55
  # Offense count: 1
72
56
  # Cop supports --auto-correct.
73
57
  # Configuration parameters: EnforcedStyle.
@@ -82,6 +66,13 @@ Lint/NonDeterministicRequireOrder:
82
66
  Exclude:
83
67
  - 'spec/spec_helper.rb'
84
68
 
69
+ # Offense count: 1
70
+ # Configuration parameters: AllowedMethods.
71
+ # AllowedMethods: present?, blank?, presence, try, try!
72
+ Lint/SafeNavigationChain:
73
+ Exclude:
74
+ - 'lib/githuh/cli/commands/repo/list.rb'
75
+
85
76
  # Offense count: 1
86
77
  # Cop supports --auto-correct.
87
78
  Lint/ScriptPermission:
@@ -100,16 +91,9 @@ Style/ExpandPathArguments:
100
91
  Style/FormatStringToken:
101
92
  EnforcedStyle: unannotated
102
93
 
103
- # Offense count: 1
104
- # Cop supports --auto-correct.
105
- # Configuration parameters: EnforcedStyle.
106
- # SupportedStyles: always, always_true, never
107
- Style/FrozenStringLiteralComment:
108
- Exclude:
109
- - 'lib/githuh/cli/commands/issue/export_paginated.rb'
110
-
111
- # Offense count: 1
94
+ # Offense count: 2
112
95
  # Configuration parameters: MinBodyLength.
113
96
  Style/GuardClause:
114
97
  Exclude:
98
+ - 'lib/githuh/cli/commands/base.rb'
115
99
  - 'lib/githuh/cli/launcher.rb'
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- githuh (0.2.1)
4
+ githuh (0.3.0)
5
5
  activesupport
6
6
  colored2 (~> 3)
7
7
  dry-cli (~> 0.6)
8
+ hashie
8
9
  octokit (~> 4)
9
10
  tty-box
10
11
  tty-progressbar
@@ -56,11 +57,11 @@ GEM
56
57
  docile (1.3.2)
57
58
  dry-cli (0.6.0)
58
59
  concurrent-ruby (~> 1.0)
59
- equatable (0.6.1)
60
60
  faraday (1.0.1)
61
61
  multipart-post (>= 1.2, < 3)
62
62
  ffi (1.13.1)
63
63
  gherkin (5.1.0)
64
+ hashie (4.1.0)
64
65
  i18n (1.8.5)
65
66
  concurrent-ruby (~> 1.0)
66
67
  minitest (5.14.2)
@@ -73,8 +74,7 @@ GEM
73
74
  parallel (1.19.2)
74
75
  parser (2.7.1.4)
75
76
  ast (~> 2.4.1)
76
- pastel (0.7.3)
77
- equatable (~> 0.6)
77
+ pastel (0.8.0)
78
78
  tty-color (~> 0.5)
79
79
  public_suffix (4.0.6)
80
80
  rainbow (3.0.0)
@@ -117,25 +117,22 @@ GEM
117
117
  simplecov-html (~> 0.11)
118
118
  simplecov-formatter-badge (0.1.0)
119
119
  simplecov-html (0.12.2)
120
- strings (0.1.8)
121
- strings-ansi (~> 0.1)
120
+ strings (0.2.0)
121
+ strings-ansi (~> 0.2)
122
122
  unicode-display_width (~> 1.5)
123
123
  unicode_utils (~> 1.4)
124
- strings-ansi (0.1.0)
124
+ strings-ansi (0.2.0)
125
125
  thor (1.0.1)
126
126
  thread_safe (0.3.6)
127
- tty-box (0.5.0)
128
- pastel (~> 0.7.2)
129
- strings (~> 0.1.6)
127
+ tty-box (0.6.0)
128
+ pastel (~> 0.8)
129
+ strings (~> 0.2.0)
130
130
  tty-cursor (~> 0.7)
131
131
  tty-color (0.5.2)
132
132
  tty-cursor (0.7.1)
133
- tty-progressbar (0.17.0)
134
- strings-ansi (~> 0.1.0)
135
- tty-cursor (~> 0.7)
136
- tty-screen (~> 0.7)
137
- unicode-display_width (~> 1.6)
138
- tty-screen (0.8.1)
133
+ tty-progressbar (0.11.0)
134
+ tty-screen (~> 0.5.0)
135
+ tty-screen (0.5.1)
139
136
  tzinfo (1.2.7)
140
137
  thread_safe (~> 0.1)
141
138
  unicode-display_width (1.7.0)
@@ -75,9 +75,25 @@ Options:
75
75
  --[no-]verbose # Print additional debugging info, default: false
76
76
  --file=VALUE # Output file, overrides <username>.<repo>.issues.<format>
77
77
  --format=VALUE # Output format: (json/csv), default: "csv"
78
+ --mapping=VALUE # YAML file with label to estimates mapping
78
79
  --help, -h # Print this help
79
80
  ----
80
81
 
82
+ ==== Label Mappings
83
+
84
+ The export suppots a configurable mapping of Github labels to Pivotal Tracker points. To use this feature, create a YAML file similar to the xref:config/label-mapping.yml[config/label-mapping.yml] provided:
85
+
86
+ [source,yaml]
87
+ ----
88
+ ---
89
+ label-to-estimates:
90
+ Large: 5
91
+ Medium: 3
92
+ Small: 1
93
+ ----
94
+
95
+ Then add `--mapping=<filename>` argument to the export command.
96
+
81
97
  ==== Example
82
98
 
83
99
  Eg, to export all issues of this repo into Pivotal Tracker compatibel CSV:
@@ -0,0 +1,12 @@
1
+ ---
2
+ label-to-estimates:
3
+ "XXL(13 eng day)": 15
4
+ "XL(8 eng day)": 15
5
+ "xs(<=1 eng day)": 3
6
+ "L(5 eng day)": 15
7
+ "m(3 eng day)": 9
8
+ "s(2 eng day)": 6
9
+ labels-to-remove:
10
+ implemented: false
11
+ labels-to-rename:
12
+ implemented: false
@@ -8,10 +8,10 @@
8
8
  <rect rx="5" width="130" height="20" fill="url(#a)"/>
9
9
  <rect rx="5" x="80" width="50" height="20" fill="#4BAF00"/>
10
10
  <rect rx="5" x="80" width="50" height="20" fill="url(#a)"/>
11
- <g fill="#fff" text-anchor="middle" font-weight="800" font-family="Consolas,DejaVu Sans,Verdana,Geneva,sans-serif" font-size="12">
11
+ <g fill="#fff" text-anchor="middle" font-weight="500" font-family="Consolas,DejaVu Sans,Verdana,Geneva,sans-serif" font-size="10">
12
12
  <text x="40.5" y="15" fill="#010101" fill-opacity=".3">COVERAGE</text>
13
13
  <text x="41.5" y="14">COVERAGE</text>
14
- <text x="105.5" y="15" fill="#010101" fill-opacity=".3">61%</text>
15
- <text x="106.5" y="14">61%</text>
14
+ <text x="105.5" y="15" fill="#010101" fill-opacity=".3">68%</text>
15
+ <text x="106.5" y="14">68%</text>
16
16
  </g>
17
17
  </svg>
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency 'activesupport'
28
28
  spec.add_dependency 'colored2', '~> 3'
29
29
  spec.add_dependency 'dry-cli', '~> 0.6'
30
+ spec.add_dependency 'hashie'
30
31
  spec.add_dependency 'octokit', '~> 4'
31
32
  spec.add_dependency 'tty-box'
32
33
  spec.add_dependency 'tty-progressbar'
@@ -28,7 +28,7 @@ module Githuh
28
28
  end
29
29
  end
30
30
 
31
- attr_accessor :client, :token, :per_page, :verbose, :info, :box, :context
31
+ attr_accessor :token, :per_page, :verbose, :info, :box, :context
32
32
 
33
33
  def call(api_token: nil,
34
34
  per_page: DEFAULT_PAGE_SIZE,
@@ -38,11 +38,20 @@ module Githuh
38
38
  self.context = Githuh
39
39
  self.verbose = verbose
40
40
  self.info = info
41
- self.token = api_token || token_from_gitconfig
41
+ self.token = api_token || determine_github_token
42
42
  self.per_page = per_page.to_i || DEFAULT_PAGE_SIZE
43
- self.client = Octokit::Client.new(access_token: token)
44
43
 
45
- print_userinfo if info
44
+ if info
45
+ begin
46
+ print_userinfo
47
+ rescue StandardError
48
+ nil
49
+ end
50
+ end
51
+ end
52
+
53
+ def client
54
+ @client ||= Octokit::Client.new(access_token: token)
46
55
  end
47
56
 
48
57
  protected
@@ -83,6 +92,17 @@ module Githuh
83
92
  complete: '▉'.magenta)
84
93
  end
85
94
 
95
+ def determine_github_token
96
+ @github_token ||= (ENV['GITHUB_TOKEN'] || `git config --global --get user.token`.chomp)
97
+
98
+ return @github_token unless @github_token.empty?
99
+
100
+ raise "No token was found in your ~/.gitconfig.\n" \
101
+ "To add, run the following command: \n" \
102
+ "git config --global --set user.token YOUR_GITHUB_TOKEN\n" \
103
+ "or set environment variable GITHUB_TOKEN"
104
+ end
105
+
86
106
  private
87
107
 
88
108
  def print_userinfo
@@ -116,16 +136,6 @@ module Githuh
116
136
  def h(arg)
117
137
  arg.to_s
118
138
  end
119
-
120
- def token_from_gitconfig
121
- @token_from_gitconfig ||= `git config --global --get user.token`.chomp
122
-
123
- return @token_from_gitconfig unless @token_from_gitconfig.empty?
124
-
125
- raise "No token was found in your ~/.gitconfig.\n" \
126
- "To add, run the following command: \n" \
127
- "git config --global --set user.token YOUR_GITHUB_TOKEN"
128
- end
129
139
  end
130
140
  end
131
141
  end
@@ -2,14 +2,15 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # vim: ft=ruby
5
- require 'bundler/setup'
6
- require 'dry/cli'
7
- require 'json'
8
- require 'tty/progressbar'
9
- require 'csv'
10
- require 'active_support/inflector'
5
+ require "bundler/setup"
6
+ require "dry/cli"
7
+ require "json"
8
+ require "tty/progressbar"
9
+ require "csv"
10
+ require "active_support/inflector"
11
+ require "yaml"
11
12
 
12
- require_relative '../base'
13
+ require_relative "../base"
13
14
 
14
15
  module Githuh
15
16
  module CLI
@@ -17,40 +18,50 @@ module Githuh
17
18
  module Issue
18
19
  class Export < Base
19
20
  FORMATS = {
20
- json: 'json',
21
- csv: 'csv'
21
+ json: "json",
22
+ csv: "csv",
22
23
  }.freeze
23
24
 
24
- DEFAULT_FORMAT = :csv
25
+ DEFAULT_FORMAT = :csv
25
26
  DEFAULT_OUTPUT_FORMAT = "<username>.<repo>.issues.<format>"
26
27
 
27
- attr_accessor :filename, :file, :output, :repo, :issues, :format, :record_count
28
+ attr_accessor :filename, :file, :output, :repo, :issues, :format, :record_count, :mapping
28
29
 
29
30
  desc "Export Repo issues into a CSV or JSON format\n" \
30
31
  " Default output file is " + DEFAULT_OUTPUT_FORMAT.bold.yellow
31
32
 
32
33
  argument :repo, type: :string, required: true, desc: 'Name of the repo, eg "rails/rails"'
33
- option :file, required: false, desc: 'Output file, overrides ' + DEFAULT_OUTPUT_FORMAT
34
- option :format, values: FORMATS.keys.map(&:to_s), default: DEFAULT_FORMAT.to_s, required: false, desc: 'Output format'
34
+ option :file, required: false, desc: "Output file, overrides " + DEFAULT_OUTPUT_FORMAT
35
+ option :format, values: FORMATS.keys.map(&:to_s), default: DEFAULT_FORMAT.to_s, required: false, desc: "Output format"
36
+ option :mapping, type: :string, require: false, desc: "YAML file with label to estimates mapping"
35
37
 
36
- def call(repo: nil, file: nil, format: nil, **opts)
38
+ def call(repo: nil, file: nil, format: nil, mapping: nil, **opts)
37
39
  super(**opts)
38
40
 
39
41
  self.record_count = 0
40
- self.repo = repo
42
+ self.repo = repo
41
43
 
42
44
  raise ArgumentError, "argument <repo> is required" unless repo
43
45
  raise ArgumentError, "argument <repo> is not a repository, expected eg 'rails/rails'" unless repo =~ %r{/}
44
46
 
47
+ self.mapping = {}
48
+ if mapping && ::File.exist?(mapping)
49
+ self.mapping = ::YAML.safe_load(::File.read(mapping))['label-to-estimates'] || {}
50
+ end
51
+
52
+ Export.const_set(:LabelEstimates, self.mapping)
53
+
45
54
  self.issues = []
46
55
  self.output = StringIO.new
47
56
  self.format = (format || DEFAULT_FORMAT).to_sym
48
57
 
49
58
  self.filename = file || file_name(repo)
50
- self.file = File.open(filename, 'w')
59
+ self.file = File.open(filename, "w")
51
60
 
52
61
  print_summary
53
62
 
63
+ raise ArgumentError, "Format is not provided" unless FORMATS.key?(format&.to_sym)
64
+
54
65
  # —————————— actually get all issues ———————————————
55
66
  self.file.write send("render_as_#{format}", fetch_issues)
56
67
  # ————————————————————————————————————————————————————————
@@ -62,9 +73,9 @@ module Githuh
62
73
 
63
74
  def fetch_issues
64
75
  client.auto_paginate = true
65
- self.issues = filter_issues(client.issues(repo, query: default_options)).tap do |issue_list|
76
+ self.issues = filter_issues(client.issues(repo, query: default_options)).tap do |issue_list|
66
77
  self.record_count = issue_list.size
67
- bar('Issues')&.advance
78
+ bar("Issues")&.advance
68
79
  end
69
80
  end
70
81
 
@@ -79,7 +90,7 @@ module Githuh
79
90
  end
80
91
 
81
92
  def default_options
82
- { state: 'open' }
93
+ { state: "open" }
83
94
  end
84
95
 
85
96
  def self.issue_labels(issue)
@@ -87,42 +98,33 @@ module Githuh
87
98
  end
88
99
 
89
100
  def self.find_user(client, username)
90
- @user_cache ||= {}
101
+ @user_cache ||= {}
91
102
  @user_cache[username] ||= client.user(username).name
92
103
  end
93
104
 
94
105
  CSV_MAP = {
95
- 'Labels' => ->(_client, issue) { issue_labels(issue).reject { |l| LABEL_ESTIMATES.key?(l) }.join(',').downcase },
96
- 'Type' => ->(*) { 'feature' },
97
- 'Estimate' => ->(_client, issue) do
98
- el = issue_labels(issue).find { |l| LABEL_ESTIMATES.key?(l) }
99
- el ? LABEL_ESTIMATES[el] : nil
106
+ "Labels" => ->(_client, issue) { issue_labels(issue).reject { |l| LabelEstimates.key?(l) }.join(",").downcase },
107
+ "Type" => ->(*) { "feature" },
108
+ "Estimate" => ->(_client, issue) do
109
+ el = issue_labels(issue).find { |l| LabelEstimates.key?(l) }
110
+ el ? LabelEstimates[el] : nil
100
111
  end,
101
- 'Current State' => ->(*) { 'unstarted' },
102
- 'Requested By' => ->(client, issue) do
112
+ "Current State" => ->(*) { "unstarted" },
113
+ "Requested By" => ->(client, issue) do
103
114
  find_user(client, issue.user.login)
104
115
  end,
105
- 'Owned By' => ->(client, issue) do
116
+ "Owned By" => ->(client, issue) do
106
117
  find_user(client, issue.user.login)
107
118
  end,
108
- 'Description' => ->(_client, issue) {
119
+ "Description" => ->(_client, issue) {
109
120
  issue.body
110
121
  },
111
- 'Created at' => ->(_client, issue) { issue.created_at },
112
- }.freeze
113
-
114
- LABEL_ESTIMATES = {
115
- 'XXL(13 eng day)' => 15,
116
- 'XL(8 eng day)' => 15,
117
- 'xs(<=1 eng day)' => 3,
118
- 'L(5 eng day)' => 15,
119
- 'm(3 eng day)' => 9,
120
- 's(2 eng day)' => 6
122
+ "Created at" => ->(_client, issue) { issue.created_at },
121
123
  }.freeze
122
124
 
123
125
  CSV_HEADER = %w(Id Title Labels Type Estimate) +
124
- ['Current State', 'Created at', 'Accepted at', 'Deadline', 'Requested By',
125
- 'Owned By', 'Description', 'Comment', 'Comment', 'Comment', 'Comment'].freeze
126
+ ["Current State", "Created at", "Accepted at", "Deadline", "Requested By",
127
+ "Owned By", "Description", "Comment", "Comment", "Comment", "Comment"].freeze
126
128
 
127
129
  # Id,Title,Labels,Type,Estimate,Current State,Created at,Accepted at,Deadline,Requested By,Owned By,Description,Comment,Comment
128
130
  # 100, existing started story,"label one,label two",feature,1,started,"Nov 22, 2007",,,user1,user2,this will update story 100,,
@@ -136,16 +138,16 @@ module Githuh
136
138
  row = []
137
139
  CSV_HEADER.each do |column|
138
140
  method = column.downcase.underscore.to_sym
139
- value = if CSV_MAP[column]
140
- CSV_MAP[column][client, issue]
141
- else
142
- begin
143
- issue.to_h[method]
144
- rescue StandardError
145
- nil
141
+ value = if CSV_MAP[column]
142
+ CSV_MAP[column][client, issue]
143
+ else
144
+ begin
145
+ issue.to_h[method]
146
+ rescue StandardError
147
+ nil
148
+ end
146
149
  end
147
- end
148
- value = value.strip if value.is_a?(String)
150
+ value = value.strip if value.is_a?(String)
149
151
  row << value
150
152
  end
151
153
  csv << row
@@ -164,7 +166,7 @@ module Githuh
164
166
  def print_conclusion
165
167
  puts
166
168
  puts TTY::Box.info("Success: written a total of #{record_count} records to #{filename}",
167
- width: ui_width, padding: 1)
169
+ **{ width: ui_width, padding: 1 })
168
170
  puts
169
171
  end
170
172
 
@@ -173,8 +175,7 @@ module Githuh
173
175
  puts TTY::Box.info("Format : #{self.format}\n" \
174
176
  "File : #{filename}\n" \
175
177
  "Repo : #{repo}\n",
176
- width: ui_width,
177
- padding: 1)
178
+ **{ width: ui_width, padding: 1 })
178
179
  puts
179
180
  end
180
181
 
@@ -184,8 +185,8 @@ module Githuh
184
185
  end
185
186
  end
186
187
 
187
- register 'issue', aliases: ['r'] do |prefix|
188
- prefix.register 'export', Issue::Export
188
+ register "issue", aliases: ["r"] do |prefix|
189
+ prefix.register "export", Issue::Export
189
190
  end
190
191
  end
191
192
  end
@@ -98,7 +98,9 @@ module Githuh
98
98
  end
99
99
 
100
100
  def bar_size
101
- client.last_response.rels[:last].href.match(/page=(\d+).*$/)[1].to_i
101
+ return 1 if client&.last_response.nil?
102
+
103
+ client&.last_response.rels[:last].href.match(/page=(\d+).*$/)[1].to_i
102
104
  end
103
105
 
104
106
  def render_as_markdown(repositories)
@@ -17,7 +17,7 @@ module Githuh
17
17
 
18
18
  def call(**opts)
19
19
  super(**opts)
20
- puts JSON.pretty_generate(client.user.to_hash)
20
+ ap client.user.to_hash
21
21
  end
22
22
  end
23
23
  end
@@ -6,6 +6,8 @@ require 'tty/box'
6
6
  require 'tty/screen'
7
7
 
8
8
  require 'githuh'
9
+ require 'githuh/cli/commands/base'
10
+
9
11
  module Githuh
10
12
  module CLI
11
13
  class Launcher
@@ -33,11 +35,12 @@ module Githuh
33
35
  Githuh.configure_kernel_behavior!
34
36
  end
35
37
 
38
+ # noinspection RubyYardParamTypeMatch
36
39
  self.command = ::Dry::CLI.new(::Githuh::CLI::Commands)
37
40
  command.call(arguments: argv, out: stdout, err: stderr)
38
41
  rescue StandardError => e
39
42
  lines = [e.message.gsub(/\n/, ', ')]
40
- if e.backtrace
43
+ if e.backtrace && !(ARGV & %w[-v --verbose]).empty?
41
44
  lines << ''
42
45
  lines.concat(e.backtrace)
43
46
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Githuh
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githuh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-09 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: hashie
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: octokit
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -256,6 +270,7 @@ files:
256
270
  - Rakefile
257
271
  - WARRANTY.md
258
272
  - codecov.yml
273
+ - config/label-mapping.yml
259
274
  - docs/img/coverage.svg
260
275
  - docs/img/githuh-issue-export.png
261
276
  - exe/githuh