circleci-cli 3.0.0 → 4.0.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.
data/Gemfile.lock CHANGED
@@ -1,58 +1,104 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- circleci-cli (3.0.0)
5
- circleci (~> 2.0.2)
6
- faraday (>= 0.14, < 1.1)
7
- highline (>= 1.7.8, < 2.1.0)
8
- launchy (>= 2.4.3, < 2.6.0)
4
+ circleci-cli (4.0.0)
5
+ circleci (>= 2.1.0)
6
+ faraday (>= 0.14, < 2.8)
7
+ highline (>= 1.7.8, < 2.2.0)
8
+ launchy (>= 2.4.3, < 3.1.0)
9
9
  pusher-client (~> 0.6.2)
10
- rugged (>= 0.26, < 1.1)
10
+ rugged (>= 0.26, < 1.8)
11
11
  terminal-notifier (~> 2.0.0)
12
- terminal-table (~> 1.8.0)
13
- thor (>= 0.20, < 1.1)
12
+ terminal-table (>= 1.8, < 3.1)
13
+ thor (>= 0.20, < 1.3)
14
14
 
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activesupport (6.0.3.2)
18
+ abbrev (0.1.2)
19
+ activesupport (6.1.7.6)
19
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (>= 0.7, < 2)
21
- minitest (~> 5.1)
22
- tzinfo (~> 1.1)
23
- zeitwerk (~> 2.2, >= 2.2.2)
24
- addressable (2.7.0)
25
- public_suffix (>= 2.0.2, < 5.0)
26
- ast (2.4.1)
27
- circleci (2.0.3)
28
- codecov (0.2.8)
29
- json
30
- simplecov
21
+ i18n (>= 1.6, < 2)
22
+ minitest (>= 5.1)
23
+ tzinfo (~> 2.0)
24
+ zeitwerk (~> 2.3)
25
+ addressable (2.8.6)
26
+ public_suffix (>= 2.0.2, < 6.0)
27
+ ast (2.4.2)
28
+ async (1.32.1)
29
+ console (~> 1.10)
30
+ nio4r (~> 2.3)
31
+ timers (~> 4.1)
32
+ async-http (0.60.2)
33
+ async (>= 1.25)
34
+ async-io (>= 1.28)
35
+ async-pool (>= 0.2)
36
+ protocol-http (~> 0.24.0)
37
+ protocol-http1 (~> 0.15.0)
38
+ protocol-http2 (~> 0.15.0)
39
+ traces (>= 0.10.0)
40
+ async-http-faraday (0.12.0)
41
+ async-http (~> 0.42)
42
+ faraday
43
+ async-io (1.43.2)
44
+ async
45
+ async-pool (0.4.0)
46
+ async (>= 1.25)
47
+ base64 (0.3.0)
48
+ childprocess (5.0.0)
49
+ circleci (2.1.0)
50
+ codecov (0.6.0)
51
+ simplecov (>= 0.15, < 0.22)
31
52
  coderay (1.1.3)
32
- concurrent-ruby (1.1.7)
33
- diff-lcs (1.4.4)
34
- docile (1.3.2)
35
- faraday (1.0.1)
36
- multipart-post (>= 1.2, < 3)
37
- faraday-http-cache (2.2.0)
53
+ concurrent-ruby (1.3.1)
54
+ console (1.15.3)
55
+ fiber-local
56
+ diff-lcs (1.5.1)
57
+ docile (1.4.0)
58
+ faraday (1.10.3)
59
+ faraday-em_http (~> 1.0)
60
+ faraday-em_synchrony (~> 1.0)
61
+ faraday-excon (~> 1.1)
62
+ faraday-httpclient (~> 1.0)
63
+ faraday-multipart (~> 1.0)
64
+ faraday-net_http (~> 1.0)
65
+ faraday-net_http_persistent (~> 1.0)
66
+ faraday-patron (~> 1.0)
67
+ faraday-rack (~> 1.0)
68
+ faraday-retry (~> 1.0)
69
+ ruby2_keywords (>= 0.0.4)
70
+ faraday-em_http (1.0.0)
71
+ faraday-em_synchrony (1.0.0)
72
+ faraday-excon (1.1.0)
73
+ faraday-http-cache (2.5.1)
38
74
  faraday (>= 0.8)
39
- ffi (1.13.1)
40
- formatador (0.2.5)
41
- github_changelog_generator (1.15.2)
75
+ faraday-httpclient (1.0.1)
76
+ faraday-multipart (1.0.4)
77
+ multipart-post (~> 2)
78
+ faraday-net_http (1.0.1)
79
+ faraday-net_http_persistent (1.2.0)
80
+ faraday-patron (1.0.0)
81
+ faraday-rack (1.0.0)
82
+ faraday-retry (1.0.3)
83
+ ffi (1.17.0)
84
+ fiber-local (1.0.0)
85
+ formatador (1.1.0)
86
+ github_changelog_generator (1.16.4)
42
87
  activesupport
88
+ async (>= 1.25.0)
89
+ async-http-faraday
43
90
  faraday-http-cache
44
91
  multi_json
45
92
  octokit (~> 4.6)
46
93
  rainbow (>= 2.2.1)
47
94
  rake (>= 10.0)
48
- retriable (~> 3.0)
49
- guard (2.16.2)
95
+ guard (2.18.1)
50
96
  formatador (>= 0.2.4)
51
97
  listen (>= 2.7, < 4.0)
52
98
  lumberjack (>= 1.0.12, < 2.0)
53
99
  nenv (~> 0.1)
54
100
  notiffany (~> 0.0)
55
- pry (>= 0.9.12)
101
+ pry (>= 0.13.0)
56
102
  shellany (~> 0.0)
57
103
  thor (>= 0.18.1)
58
104
  guard-compat (1.2.1)
@@ -60,97 +106,113 @@ GEM
60
106
  guard (~> 2.1)
61
107
  guard-compat (~> 1.1)
62
108
  rspec (>= 2.99.0, < 4.0)
63
- guard-rubocop (1.3.0)
109
+ guard-rubocop (1.5.0)
64
110
  guard (~> 2.0)
65
- rubocop (~> 0.20)
66
- highline (2.0.3)
67
- i18n (1.8.5)
111
+ rubocop (< 2.0)
112
+ highline (2.1.0)
113
+ i18n (1.14.5)
68
114
  concurrent-ruby (~> 1.0)
69
- json (2.3.1)
70
- launchy (2.5.0)
71
- addressable (~> 2.7)
72
- listen (3.2.1)
115
+ json (2.7.2)
116
+ launchy (3.0.1)
117
+ addressable (~> 2.8)
118
+ childprocess (~> 5.0)
119
+ listen (3.9.0)
73
120
  rb-fsevent (~> 0.10, >= 0.10.3)
74
121
  rb-inotify (~> 0.9, >= 0.9.10)
75
- lumberjack (1.2.7)
76
- method_source (1.0.0)
77
- minitest (5.14.1)
122
+ lumberjack (1.2.10)
123
+ method_source (1.1.0)
124
+ minitest (5.15.0)
78
125
  multi_json (1.15.0)
79
- multipart-post (2.1.1)
126
+ multipart-post (2.4.1)
80
127
  nenv (0.3.0)
128
+ nio4r (2.7.3)
81
129
  notiffany (0.1.3)
82
130
  nenv (~> 0.1)
83
131
  shellany (~> 0.0)
84
- octokit (4.18.0)
85
- faraday (>= 0.9)
86
- sawyer (~> 0.8.0, >= 0.5.3)
87
- parallel (1.19.2)
88
- parser (2.7.1.4)
132
+ octokit (4.25.1)
133
+ faraday (>= 1, < 3)
134
+ sawyer (~> 0.9)
135
+ parallel (1.24.0)
136
+ parser (3.3.2.0)
89
137
  ast (~> 2.4.1)
90
- pry (0.13.1)
138
+ racc
139
+ protocol-hpack (1.4.2)
140
+ protocol-http (0.24.7)
141
+ protocol-http1 (0.15.1)
142
+ protocol-http (~> 0.22)
143
+ protocol-http2 (0.15.1)
144
+ protocol-hpack (~> 1.4)
145
+ protocol-http (~> 0.18)
146
+ pry (0.14.2)
91
147
  coderay (~> 1.1)
92
148
  method_source (~> 1.0)
93
- public_suffix (4.0.5)
149
+ public_suffix (4.0.7)
94
150
  pusher-client (0.6.2)
95
151
  json
96
152
  websocket (~> 1.0)
97
- rainbow (3.0.0)
98
- rake (13.0.1)
99
- rb-fsevent (0.10.4)
100
- rb-inotify (0.10.1)
153
+ racc (1.8.0)
154
+ rainbow (3.1.1)
155
+ rake (13.2.1)
156
+ rb-fsevent (0.11.2)
157
+ rb-inotify (0.11.1)
101
158
  ffi (~> 1.0)
102
- regexp_parser (1.7.1)
103
- retriable (3.1.2)
104
- rexml (3.2.4)
105
- rspec (3.9.0)
106
- rspec-core (~> 3.9.0)
107
- rspec-expectations (~> 3.9.0)
108
- rspec-mocks (~> 3.9.0)
109
- rspec-core (3.9.2)
110
- rspec-support (~> 3.9.3)
111
- rspec-expectations (3.9.2)
159
+ regexp_parser (2.9.2)
160
+ rexml (3.3.9)
161
+ rspec (3.13.0)
162
+ rspec-core (~> 3.13.0)
163
+ rspec-expectations (~> 3.13.0)
164
+ rspec-mocks (~> 3.13.0)
165
+ rspec-core (3.13.0)
166
+ rspec-support (~> 3.13.0)
167
+ rspec-expectations (3.13.0)
112
168
  diff-lcs (>= 1.2.0, < 2.0)
113
- rspec-support (~> 3.9.0)
114
- rspec-mocks (3.9.1)
169
+ rspec-support (~> 3.13.0)
170
+ rspec-mocks (3.13.1)
115
171
  diff-lcs (>= 1.2.0, < 2.0)
116
- rspec-support (~> 3.9.0)
117
- rspec-support (3.9.3)
118
- rubocop (0.89.1)
172
+ rspec-support (~> 3.13.0)
173
+ rspec-support (3.13.1)
174
+ rubocop (1.28.2)
119
175
  parallel (~> 1.10)
120
- parser (>= 2.7.1.1)
176
+ parser (>= 3.1.0.0)
121
177
  rainbow (>= 2.2.2, < 4.0)
122
- regexp_parser (>= 1.7)
178
+ regexp_parser (>= 1.8, < 3.0)
123
179
  rexml
124
- rubocop-ast (>= 0.3.0, < 1.0)
180
+ rubocop-ast (>= 1.17.0, < 2.0)
125
181
  ruby-progressbar (~> 1.7)
126
- unicode-display_width (>= 1.4.0, < 2.0)
127
- rubocop-ast (0.3.0)
128
- parser (>= 2.7.1.4)
129
- ruby-progressbar (1.10.1)
130
- rugged (1.0.1)
131
- sawyer (0.8.2)
182
+ unicode-display_width (>= 1.4.0, < 3.0)
183
+ rubocop-ast (1.17.0)
184
+ parser (>= 3.1.1.0)
185
+ ruby-progressbar (1.13.0)
186
+ ruby2_keywords (0.0.5)
187
+ rugged (1.7.2)
188
+ sawyer (0.9.2)
132
189
  addressable (>= 2.3.5)
133
- faraday (> 0.8, < 2.0)
190
+ faraday (>= 0.17.3, < 3)
134
191
  shellany (0.0.1)
135
- simplecov (0.19.0)
192
+ simplecov (0.21.2)
136
193
  docile (~> 1.1)
137
194
  simplecov-html (~> 0.11)
138
- simplecov-html (0.12.2)
195
+ simplecov_json_formatter (~> 0.1)
196
+ simplecov-html (0.12.3)
197
+ simplecov_json_formatter (0.1.4)
139
198
  terminal-notifier (2.0.0)
140
- terminal-table (1.8.0)
141
- unicode-display_width (~> 1.1, >= 1.1.1)
142
- thor (1.0.1)
143
- thread_safe (0.3.6)
144
- tzinfo (1.2.7)
145
- thread_safe (~> 0.1)
146
- unicode-display_width (1.7.0)
147
- websocket (1.2.8)
148
- zeitwerk (2.4.0)
199
+ terminal-table (3.0.2)
200
+ unicode-display_width (>= 1.1.1, < 3)
201
+ thor (1.2.2)
202
+ timers (4.3.5)
203
+ traces (0.11.1)
204
+ tzinfo (2.0.6)
205
+ concurrent-ruby (~> 1.0)
206
+ unicode-display_width (2.5.0)
207
+ websocket (1.2.10)
208
+ zeitwerk (2.6.15)
149
209
 
150
210
  PLATFORMS
151
211
  ruby
152
212
 
153
213
  DEPENDENCIES
214
+ abbrev
215
+ base64
154
216
  bundler
155
217
  circleci-cli!
156
218
  codecov
@@ -164,4 +226,4 @@ DEPENDENCIES
164
226
  simplecov
165
227
 
166
228
  BUNDLED WITH
167
- 2.0.2
229
+ 2.4.18
data/Guardfile CHANGED
@@ -17,7 +17,7 @@
17
17
  #
18
18
  # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
19
 
20
- # Note: The cmd option is now required due to the increasing number of ways
20
+ # NOTE: The cmd option is now required due to the increasing number of ways
21
21
  # rspec may be run, below are examples of the most common uses.
22
22
  # * bundler: 'bundle exec rspec'
23
23
  # * bundler binstubs: 'bin/rspec'
data/README.md CHANGED
@@ -1,16 +1,15 @@
1
1
  # circleci-cli
2
2
  [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
3
3
  [![Gem Version](https://badge.fury.io/rb/circleci-cli.svg)](https://badge.fury.io/rb/circleci-cli)
4
- [![Circle CI](https://circleci.com/gh/unhappychoice/circleci-cli.svg?style=shield)](https://circleci.com/gh/unhappychoice/circleci-cli)
5
- [![Code Climate](https://codeclimate.com/github/unhappychoice/circleci-cli/badges/gpa.svg)](https://codeclimate.com/github/unhappychoice/circleci-cli)
6
- [![codecov](https://codecov.io/gh/unhappychoice/circleci-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/unhappychoice/circleci-cli)
7
- [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/unhappychoice/circleci-cli.svg)](https://libraries.io/github/unhappychoice/circleci-cli)
4
+ [![Code Climate](https://codeclimate.com/github/circleci-tools/circleci-cli/badges/gpa.svg)](https://codeclimate.com/github/circleci-tools/circleci-cli)
5
+ [![codecov](https://codecov.io/gh/circleci-tools/circleci-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/circleci-tools/circleci-cli)
6
+ [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/circleci-tools/circleci-cli.svg)](https://libraries.io/github/circleci-tools/circleci-cli)
8
7
  ![](http://ruby-gem-downloads-badge.herokuapp.com/circleci-cli?type=total)
9
- ![GitHub](https://img.shields.io/github/license/unhappychoice/circleci-cli.svg)
8
+ ![GitHub](https://img.shields.io/github/license/circleci-tools/circleci-cli.svg)
10
9
 
11
10
  circleci-cli is a CLI tool for [Circle CI](https://circleci.com).
12
11
 
13
- ![sample.gif](https://github.com/unhappychoice/circler/raw/master/movie/rec.gif)
12
+ ![sample.gif](https://github.com/circleci-tools/circleci-cli/raw/master/movie/rec.gif)
14
13
 
15
14
  ## Installation
16
15
 
@@ -84,7 +83,7 @@ $ circleci-cli browse
84
83
 
85
84
  ## Contributing
86
85
 
87
- Bug reports and pull requests are welcome on GitHub at https://github.com/unhappychoice/circleci-cli.
86
+ Bug reports and pull requests are welcome on GitHub at https://github.com/circleci-tools/circleci-cli.
88
87
 
89
88
  ## License
90
89
 
data/circleci-cli.gemspec CHANGED
@@ -5,18 +5,20 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'circleci/cli/version'
6
6
 
7
7
  def production_dependency(spec)
8
- spec.add_dependency 'circleci', '~> 2.0.2'
9
- spec.add_dependency 'faraday', '>= 0.14', '< 1.1'
10
- spec.add_dependency 'highline', '>= 1.7.8', '< 2.1.0'
11
- spec.add_dependency 'launchy', '>= 2.4.3', '< 2.6.0'
8
+ spec.add_dependency 'circleci', '>= 2.1.0'
9
+ spec.add_dependency 'faraday', '>= 0.14', '< 2.8'
10
+ spec.add_dependency 'highline', '>= 1.7.8', '< 2.2.0'
11
+ spec.add_dependency 'launchy', '>= 2.4.3', '< 3.1.0'
12
12
  spec.add_dependency 'pusher-client', '~> 0.6.2'
13
- spec.add_dependency 'rugged', '>= 0.26', '< 1.1'
13
+ spec.add_dependency 'rugged', '>= 0.26', '< 1.8'
14
14
  spec.add_dependency 'terminal-notifier', '~> 2.0.0'
15
- spec.add_dependency 'terminal-table', '~> 1.8.0'
16
- spec.add_dependency 'thor', '>= 0.20', '< 1.1'
15
+ spec.add_dependency 'terminal-table', '>= 1.8', '< 3.1'
16
+ spec.add_dependency 'thor', '>= 0.20', '< 1.3'
17
17
  end
18
18
 
19
19
  def development_dependency(spec)
20
+ spec.add_development_dependency 'abbrev'
21
+ spec.add_development_dependency 'base64'
20
22
  spec.add_development_dependency 'bundler'
21
23
  spec.add_development_dependency 'codecov'
22
24
  spec.add_development_dependency 'github_changelog_generator'
@@ -36,20 +38,23 @@ def project_files
36
38
  end
37
39
 
38
40
  Gem::Specification.new do |spec|
39
- spec.name = 'circleci-cli'
40
- spec.version = CircleCI::CLI::VERSION
41
- spec.required_ruby_version = '>= 2.5'
42
- spec.authors = ['unhappychoice']
43
- spec.email = ['unhappychoice@gmail.com']
41
+ spec.name = 'circleci-cli'
42
+ spec.version = CircleCI::CLI::VERSION
43
+ spec.required_ruby_version = '>= 3.1'
44
+ spec.authors = ['unhappychoice']
45
+ spec.email = ['unhappychoice@gmail.com']
44
46
 
45
- spec.summary = 'CLI tool for CircleCI'
46
- spec.description = 'A command line tool for CircleCI'
47
- spec.homepage = 'https://github.com/unhappychoice/circleci-cli'
48
- spec.license = 'MIT'
49
- spec.files = project_files
50
- spec.bindir = 'exe'
51
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
52
- spec.require_paths = ['lib']
47
+ spec.summary = 'CLI tool for CircleCI'
48
+ spec.description = 'A command line tool for CircleCI'
49
+ spec.homepage = 'https://github.com/circleci-tools/circleci-cli'
50
+ spec.license = 'MIT'
51
+ spec.files = project_files
52
+ spec.bindir = 'exe'
53
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
54
+ spec.require_paths = ['lib']
55
+ spec.metadata = {
56
+ 'rubygems_mfa_required' => 'true'
57
+ }
53
58
 
54
59
  production_dependency spec
55
60
  development_dependency spec
@@ -7,7 +7,7 @@ module CircleCI
7
7
  class << self
8
8
  def setup_token
9
9
  CircleCi.configure do |config|
10
- config.token = ENV['CIRCLE_CI_TOKEN'] || ask('Circle CI token ? :')
10
+ config.token = ENV.fetch('CIRCLE_CI_TOKEN', nil) || ask('Circle CI token ? :')
11
11
  end
12
12
  end
13
13
 
@@ -11,13 +11,13 @@ module CircleCI
11
11
  socket.connect(true)
12
12
  end
13
13
 
14
- def bind(channel, event, &block)
14
+ def bind(channel, event, &)
15
15
  socket.subscribe(channel)
16
- socket[channel].bind(event, &block)
16
+ socket[channel].bind(event, &)
17
17
  end
18
18
 
19
- def bind_event_json(channel, event, &block)
20
- bind(channel, event) { |data| JSON.parse(data).each(&block) }
19
+ def bind_event_json(channel, event, &)
20
+ bind(channel, event) { |data| JSON.parse(data).each(&) }
21
21
  end
22
22
 
23
23
  def unsubscribe(channel)
@@ -36,10 +36,10 @@ module CircleCI
36
36
  end
37
37
 
38
38
  def auth(socket_id, channel)
39
- token = ENV['CIRCLE_CI_TOKEN'] || ask('Circle CI token ? :')
39
+ token = ENV.fetch('CIRCLE_CI_TOKEN', nil) || ask('Circle CI token ? :')
40
40
  res = connection.post(
41
41
  "/auth/pusher?circle-token=#{token}",
42
- { socket_id: socket_id, channel_name: channel.name }
42
+ { socket_id:, channel_name: channel.name }
43
43
  )
44
44
  JSON.parse(res.body)['auth']
45
45
  end
@@ -12,7 +12,7 @@ module CircleCI
12
12
  ["Author: #{build.author_name}"],
13
13
  ["Workflow: #{build.workflow_name}/#{build.workflow_job_name}"]
14
14
  ]
15
- Terminal::Table.new(title: title, rows: texts, style: { width: 120 }).to_s
15
+ Terminal::Table.new(title:, rows: texts, style: { width: 120 }).to_s
16
16
  end
17
17
  end
18
18
 
@@ -33,7 +33,7 @@ module CircleCI
33
33
  end
34
34
 
35
35
  def print_pretty
36
- Terminal::Table.new(title: title, headings: headings, rows: rows).to_s
36
+ Terminal::Table.new(title:, headings:, rows:).to_s
37
37
  end
38
38
 
39
39
  def title
@@ -26,7 +26,7 @@ module CircleCI
26
26
  step.actions.map do |a|
27
27
  "#{colorize_by_status(a.name.slice(0..120), a.status)}\n#{"#{a.log}\n" if a.failed? && a.log}"
28
28
  end
29
- end.flatten.join('')
29
+ end.flatten.join
30
30
  end.join("\n")
31
31
  end
32
32
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CircleCI
4
4
  module CLI
5
- VERSION = '3.0.0'
5
+ VERSION = '4.0.0'
6
6
  end
7
7
  end
data/lib/circleci/cli.rb CHANGED
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'thor'
3
+ require 'circleci'
4
4
  require 'faraday'
5
- require 'launchy'
6
- require 'terminal-table'
7
5
  require 'highline/import'
6
+ require 'launchy'
7
+ require 'ostruct'
8
8
  require 'rugged'
9
- require 'circleci'
10
9
  require 'terminal-notifier'
10
+ require 'terminal-table'
11
+ require 'thor'
11
12
 
12
13
  require 'circleci/cli/version'
13
14
  require 'circleci/cli/command'