circleci-cli 2.3.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,61 +1,104 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- circleci-cli (2.3.0)
5
- circleci (~> 2.0.2)
6
- colorize (~> 0.8.1)
7
- faraday (>= 0.14, < 0.17)
8
- highline (>= 1.7.8, < 2.1.0)
9
- launchy (~> 2.4.3)
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)
10
9
  pusher-client (~> 0.6.2)
11
- rugged (>= 0.26, < 0.29)
10
+ rugged (>= 0.26, < 1.8)
12
11
  terminal-notifier (~> 2.0.0)
13
- terminal-table (~> 1.8.0)
14
- thor (~> 0.20.0)
12
+ terminal-table (>= 1.8, < 3.1)
13
+ thor (>= 0.20, < 1.3)
15
14
 
16
15
  GEM
17
16
  remote: https://rubygems.org/
18
17
  specs:
19
- activesupport (6.0.0)
18
+ abbrev (0.1.2)
19
+ activesupport (6.1.7.6)
20
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
21
- i18n (>= 0.7, < 2)
22
- minitest (~> 5.1)
23
- tzinfo (~> 1.1)
24
- zeitwerk (~> 2.1, >= 2.1.8)
25
- addressable (2.7.0)
26
- public_suffix (>= 2.0.2, < 5.0)
27
- ast (2.4.0)
28
- circleci (2.0.2)
29
- codecov (0.1.15)
30
- json
31
- simplecov
32
- url
33
- coderay (1.1.2)
34
- colorize (0.8.1)
35
- concurrent-ruby (1.1.5)
36
- diff-lcs (1.3)
37
- docile (1.3.2)
38
- faraday (0.16.2)
39
- multipart-post (>= 1.2, < 3)
40
- faraday-http-cache (2.0.0)
41
- faraday (~> 0.8)
42
- ffi (1.11.1)
43
- formatador (0.2.5)
44
- github_changelog_generator (1.14.3)
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)
52
+ coderay (1.1.3)
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)
74
+ faraday (>= 0.8)
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)
45
87
  activesupport
88
+ async (>= 1.25.0)
89
+ async-http-faraday
46
90
  faraday-http-cache
47
91
  multi_json
48
92
  octokit (~> 4.6)
49
- rainbow (>= 2.1)
93
+ rainbow (>= 2.2.1)
50
94
  rake (>= 10.0)
51
- retriable (~> 2.1)
52
- guard (2.15.1)
95
+ guard (2.18.1)
53
96
  formatador (>= 0.2.4)
54
97
  listen (>= 2.7, < 4.0)
55
98
  lumberjack (>= 1.0.12, < 2.0)
56
99
  nenv (~> 0.1)
57
100
  notiffany (~> 0.0)
58
- pry (>= 0.9.12)
101
+ pry (>= 0.13.0)
59
102
  shellany (~> 0.0)
60
103
  thor (>= 0.18.1)
61
104
  guard-compat (1.2.1)
@@ -63,93 +106,113 @@ GEM
63
106
  guard (~> 2.1)
64
107
  guard-compat (~> 1.1)
65
108
  rspec (>= 2.99.0, < 4.0)
66
- guard-rubocop (1.3.0)
109
+ guard-rubocop (1.5.0)
67
110
  guard (~> 2.0)
68
- rubocop (~> 0.20)
69
- highline (2.0.2)
70
- i18n (1.6.0)
111
+ rubocop (< 2.0)
112
+ highline (2.1.0)
113
+ i18n (1.14.5)
71
114
  concurrent-ruby (~> 1.0)
72
- jaro_winkler (1.5.3)
73
- json (2.2.0)
74
- launchy (2.4.3)
75
- addressable (~> 2.3)
76
- listen (3.2.0)
115
+ json (2.7.2)
116
+ launchy (3.0.1)
117
+ addressable (~> 2.8)
118
+ childprocess (~> 5.0)
119
+ listen (3.9.0)
77
120
  rb-fsevent (~> 0.10, >= 0.10.3)
78
121
  rb-inotify (~> 0.9, >= 0.9.10)
79
- lumberjack (1.0.13)
80
- method_source (0.9.2)
81
- minitest (5.12.2)
82
- multi_json (1.13.1)
83
- multipart-post (2.1.1)
122
+ lumberjack (1.2.10)
123
+ method_source (1.1.0)
124
+ minitest (5.15.0)
125
+ multi_json (1.15.0)
126
+ multipart-post (2.4.1)
84
127
  nenv (0.3.0)
128
+ nio4r (2.7.3)
85
129
  notiffany (0.1.3)
86
130
  nenv (~> 0.1)
87
131
  shellany (~> 0.0)
88
- octokit (4.14.0)
89
- sawyer (~> 0.8.0, >= 0.5.3)
90
- parallel (1.17.0)
91
- parser (2.6.4.1)
92
- ast (~> 2.4.0)
93
- pry (0.12.2)
94
- coderay (~> 1.1.0)
95
- method_source (~> 0.9.0)
96
- public_suffix (4.0.1)
132
+ octokit (4.25.1)
133
+ faraday (>= 1, < 3)
134
+ sawyer (~> 0.9)
135
+ parallel (1.24.0)
136
+ parser (3.3.2.0)
137
+ ast (~> 2.4.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)
147
+ coderay (~> 1.1)
148
+ method_source (~> 1.0)
149
+ public_suffix (4.0.7)
97
150
  pusher-client (0.6.2)
98
151
  json
99
152
  websocket (~> 1.0)
100
- rainbow (3.0.0)
101
- rake (13.0.0)
102
- rb-fsevent (0.10.3)
103
- rb-inotify (0.10.0)
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)
104
158
  ffi (~> 1.0)
105
- retriable (2.1.0)
106
- rspec (3.8.0)
107
- rspec-core (~> 3.8.0)
108
- rspec-expectations (~> 3.8.0)
109
- rspec-mocks (~> 3.8.0)
110
- rspec-core (3.8.2)
111
- rspec-support (~> 3.8.0)
112
- rspec-expectations (3.8.4)
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)
113
168
  diff-lcs (>= 1.2.0, < 2.0)
114
- rspec-support (~> 3.8.0)
115
- rspec-mocks (3.8.1)
169
+ rspec-support (~> 3.13.0)
170
+ rspec-mocks (3.13.1)
116
171
  diff-lcs (>= 1.2.0, < 2.0)
117
- rspec-support (~> 3.8.0)
118
- rspec-support (3.8.2)
119
- rubocop (0.74.0)
120
- jaro_winkler (~> 1.5.1)
172
+ rspec-support (~> 3.13.0)
173
+ rspec-support (3.13.1)
174
+ rubocop (1.28.2)
121
175
  parallel (~> 1.10)
122
- parser (>= 2.6)
176
+ parser (>= 3.1.0.0)
123
177
  rainbow (>= 2.2.2, < 4.0)
178
+ regexp_parser (>= 1.8, < 3.0)
179
+ rexml
180
+ rubocop-ast (>= 1.17.0, < 2.0)
124
181
  ruby-progressbar (~> 1.7)
125
- unicode-display_width (>= 1.4.0, < 1.7)
126
- ruby-progressbar (1.10.1)
127
- rugged (0.28.3.1)
128
- 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)
129
189
  addressable (>= 2.3.5)
130
- faraday (> 0.8, < 2.0)
190
+ faraday (>= 0.17.3, < 3)
131
191
  shellany (0.0.1)
132
- simplecov (0.17.1)
192
+ simplecov (0.21.2)
133
193
  docile (~> 1.1)
134
- json (>= 1.8, < 3)
135
- simplecov-html (~> 0.10.0)
136
- simplecov-html (0.10.2)
194
+ simplecov-html (~> 0.11)
195
+ simplecov_json_formatter (~> 0.1)
196
+ simplecov-html (0.12.3)
197
+ simplecov_json_formatter (0.1.4)
137
198
  terminal-notifier (2.0.0)
138
- terminal-table (1.8.0)
139
- unicode-display_width (~> 1.1, >= 1.1.1)
140
- thor (0.20.3)
141
- thread_safe (0.3.6)
142
- tzinfo (1.2.5)
143
- thread_safe (~> 0.1)
144
- unicode-display_width (1.6.0)
145
- url (0.3.2)
146
- websocket (1.2.8)
147
- zeitwerk (2.1.10)
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)
148
209
 
149
210
  PLATFORMS
150
211
  ruby
151
212
 
152
213
  DEPENDENCIES
214
+ abbrev
215
+ base64
153
216
  bundler
154
217
  circleci-cli!
155
218
  codecov
@@ -163,4 +226,4 @@ DEPENDENCIES
163
226
  simplecov
164
227
 
165
228
  BUNDLED WITH
166
- 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,17 +1,15 @@
1
1
  # circleci-cli
2
- [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
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
- Notice: This gem is renamed from `circler` to `circleci-cli` on 2019/09/22
12
10
  circleci-cli is a CLI tool for [Circle CI](https://circleci.com).
13
11
 
14
- ![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)
15
13
 
16
14
  ## Installation
17
15
 
@@ -28,26 +26,33 @@ export CIRCLE_CI_TOKEN=your-circle-ci-token
28
26
  ## Usage
29
27
  ```
30
28
  Commands:
31
- circleci-cli browse # open circle ci website
32
- circleci-cli build # show build description
33
- circleci-cli builds # list builds
34
- circleci-cli help [COMMAND] # describe available commands or one specific command
35
- circleci-cli projects # list projects
36
- circleci-cli retry # retry a build
37
- circleci-cli version # show gem version
38
- circleci-cli watch # watch a build in real time
29
+ circleci-cli browse # Open CircleCI website
30
+ circleci-cli build # Show the build result
31
+ circleci-cli builds # List builds
32
+ circleci-cli cancel # Cancel a build
33
+ circleci-cli help [COMMAND] # Describe available commands or one specific command
34
+ circleci-cli projects # List projects
35
+ circleci-cli retry # Retry a build
36
+ circleci-cli version # Show gem version
37
+ circleci-cli watch # Watch builds in real time
39
38
 
40
39
  Options:
41
- -p user_name/project # specify repository
42
- -b branch # specify branch name
43
- -n build_number # specify build number
44
- -l last # get or retry last failed build
45
- -v verbose # show all the logs if applied to watch command
46
- ```
40
+ -p user_name/project # Specify repository
41
+ # Default to the Git remote of current directory
42
+
43
+ -b branch # Specify branch name
44
+ # Default to the current Git branch
47
45
 
48
- ### Project argument
46
+ -a, --all, --no-all # Ignore the branch option and stop being filtered by the branch
47
+ # Default to false
49
48
 
50
- Project argument will be automatically selected in your directory initialized with git.
49
+ -n build_number # Specify build number.
50
+ -l last # Get or retry last failed build.
51
+ -v verbose # Show all the logs if applied to watch command.
52
+
53
+ --pretty=true/false, --no-pretty # Make outputs pretty or not
54
+ # Default to true
55
+ ```
51
56
 
52
57
  ### Examples
53
58
 
@@ -78,7 +83,7 @@ $ circleci-cli browse
78
83
 
79
84
  ## Contributing
80
85
 
81
- 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.
82
87
 
83
88
  ## License
84
89
 
@@ -89,15 +94,19 @@ The gem is available as open source under the terms of the [MIT License](http://
89
94
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
90
95
 
91
96
  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
92
- <!-- prettier-ignore -->
97
+ <!-- prettier-ignore-start -->
98
+ <!-- markdownlint-disable -->
93
99
  <table>
94
100
  <tr>
95
- <td align="center"><a href="http://blog.unhappychoice.com"><img src="https://avatars3.githubusercontent.com/u/5608948?v=4" width="100px;" alt="Yuji Ueki"/><br /><sub><b>Yuji Ueki</b></sub></a><br /><a href="https://github.com/unhappychoice/circleci-cli/commits?author=unhappychoice" title="Code">💻</a></td>
96
- <td align="center"><a href="https://mattbrictson.com/"><img src="https://avatars0.githubusercontent.com/u/189693?v=4" width="100px;" alt="Matt Brictson"/><br /><sub><b>Matt Brictson</b></sub></a><br /><a href="https://github.com/unhappychoice/circleci-cli/commits?author=mattbrictson" title="Code">💻</a> <a href="https://github.com/unhappychoice/circleci-cli/commits?author=mattbrictson" title="Tests">⚠️</a></td>
97
- <td align="center"><a href="http://fzf.me"><img src="https://avatars0.githubusercontent.com/u/1462357?v=4" width="100px;" alt="Fletcher Fowler"/><br /><sub><b>Fletcher Fowler</b></sub></a><br /><a href="https://github.com/unhappychoice/circleci-cli/issues?q=author%3Afzf" title="Bug reports">🐛</a> <a href="#ideas-fzf" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/unhappychoice/circleci-cli/commits?author=fzf" title="Code">💻</a></td>
101
+ <td align="center"><a href="http://blog.unhappychoice.com"><img src="https://avatars3.githubusercontent.com/u/5608948?v=4" width="100px;" alt=""/><br /><sub><b>Yuji Ueki</b></sub></a><br /><a href="https://github.com/unhappychoice/circleci-cli/commits?author=unhappychoice" title="Code">💻</a></td>
102
+ <td align="center"><a href="https://mattbrictson.com/"><img src="https://avatars0.githubusercontent.com/u/189693?v=4" width="100px;" alt=""/><br /><sub><b>Matt Brictson</b></sub></a><br /><a href="https://github.com/unhappychoice/circleci-cli/commits?author=mattbrictson" title="Code">💻</a> <a href="https://github.com/unhappychoice/circleci-cli/commits?author=mattbrictson" title="Tests">⚠️</a></td>
103
+ <td align="center"><a href="http://fzf.me"><img src="https://avatars0.githubusercontent.com/u/1462357?v=4" width="100px;" alt=""/><br /><sub><b>Fletcher Fowler</b></sub></a><br /><a href="https://github.com/unhappychoice/circleci-cli/issues?q=author%3Afzf" title="Bug reports">🐛</a> <a href="#ideas-fzf" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/unhappychoice/circleci-cli/commits?author=fzf" title="Code">💻</a></td>
104
+ <td align="center"><a href="https://datadoghq.com"><img src="https://avatars3.githubusercontent.com/u/583503?v=4" width="100px;" alt=""/><br /><sub><b>Marco Costa</b></sub></a><br /><a href="#ideas-marcotc" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/unhappychoice/circleci-cli/commits?author=marcotc" title="Code">💻</a></td>
98
105
  </tr>
99
106
  </table>
100
107
 
108
+ <!-- markdownlint-enable -->
109
+ <!-- prettier-ignore-end -->
101
110
  <!-- ALL-CONTRIBUTORS-LIST:END -->
102
111
 
103
112
  This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
data/circleci-cli.gemspec CHANGED
@@ -5,19 +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 'colorize', '~> 0.8.1'
10
- spec.add_dependency 'faraday', '>= 0.14', '< 0.17'
11
- spec.add_dependency 'highline', '>= 1.7.8', '< 2.1.0'
12
- spec.add_dependency 'launchy', '~> 2.4.3'
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'
13
12
  spec.add_dependency 'pusher-client', '~> 0.6.2'
14
- spec.add_dependency 'rugged', '>= 0.26', '< 0.29'
13
+ spec.add_dependency 'rugged', '>= 0.26', '< 1.8'
15
14
  spec.add_dependency 'terminal-notifier', '~> 2.0.0'
16
- spec.add_dependency 'terminal-table', '~> 1.8.0'
17
- spec.add_dependency 'thor', '~> 0.20.0'
15
+ spec.add_dependency 'terminal-table', '>= 1.8', '< 3.1'
16
+ spec.add_dependency 'thor', '>= 0.20', '< 1.3'
18
17
  end
19
18
 
20
19
  def development_dependency(spec)
20
+ spec.add_development_dependency 'abbrev'
21
+ spec.add_development_dependency 'base64'
21
22
  spec.add_development_dependency 'bundler'
22
23
  spec.add_development_dependency 'codecov'
23
24
  spec.add_development_dependency 'github_changelog_generator'
@@ -37,19 +38,23 @@ def project_files
37
38
  end
38
39
 
39
40
  Gem::Specification.new do |spec|
40
- spec.name = 'circleci-cli'
41
- spec.version = CircleCI::CLI::VERSION
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,37 +7,30 @@ 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
 
14
14
  def project_name(options)
15
15
  if options.project
16
16
  options.project
17
- elsif reponame
18
- reponame
19
17
  else
20
18
  say Printer::ProjectPrinter.new(Response::Project.all).to_s
21
19
  ask('Input user-name/project-name :')
22
20
  end
23
21
  end
24
22
 
25
- def reponame
26
- repository = Rugged::Repository.new('.')
27
- origin = repository.remotes.find { |r| r.name == 'origin' }
28
- regexp = %r{git@github.com(?::|/)([\w_-]+/[\.\w_-]+?)(?:\.git)*$}
29
- return Regexp.last_match(1) if origin.url =~ regexp
30
-
31
- nil
23
+ def branch_name(options)
24
+ if options.all
25
+ nil
26
+ else
27
+ options.branch
28
+ end
32
29
  end
33
30
 
34
31
  def build_number(options)
35
32
  options.build || ask('Input build number')
36
33
  end
37
-
38
- def should_be_pretty(options)
39
- options['format'] != 'simple'
40
- end
41
34
  end
42
35
  end
43
36
  end
@@ -14,7 +14,7 @@ module CircleCI
14
14
  else
15
15
  get_build(username, reponame, options)
16
16
  end
17
- say Printer::StepPrinter.new(build.steps).to_s
17
+ say Printer::StepPrinter.new(build.steps, pretty: options.pretty).to_s
18
18
  end
19
19
 
20
20
  private
@@ -7,16 +7,16 @@ module CircleCI
7
7
  class << self
8
8
  def run(options)
9
9
  setup_token
10
- username, reponame = project_name(options).split('/')
10
+ project_name = project_name(options)
11
+ username, reponame = project_name.split('/')
12
+ branch = branch_name(options)
13
+ builds = if branch
14
+ Response::Build.branch(username, reponame, branch)
15
+ else
16
+ Response::Build.all(username, reponame)
17
+ end
11
18
 
12
- builds =
13
- if options.branch
14
- Response::Build.branch(username, reponame, options.branch)
15
- else
16
- Response::Build.all(username, reponame)
17
- end
18
-
19
- say Printer::BuildPrinter.new(builds, pretty: should_be_pretty(options)).to_s
19
+ say Printer::BuildPrinter.new(builds, project_name, pretty: options.pretty).to_s
20
20
  end
21
21
  end
22
22
  end
@@ -7,7 +7,7 @@ module CircleCI
7
7
  class << self
8
8
  def run(options)
9
9
  setup_token
10
- say Printer::ProjectPrinter.new(Response::Project.all, pretty: should_be_pretty(options)).to_s
10
+ say Printer::ProjectPrinter.new(Response::Project.all, pretty: options.pretty).to_s
11
11
  end
12
12
  end
13
13
  end
@@ -14,8 +14,13 @@ module CircleCI
14
14
  end
15
15
 
16
16
  def update
17
- @builds = (Response::Build.all(@username, @reponame) + @builds)
18
- .uniq(&:build_number)
17
+ response = if @branch
18
+ Response::Build.branch(@username, @reponame, @branch)
19
+ else
20
+ Response::Build.all(@username, @reponame)
21
+ end
22
+
23
+ @builds = (response + @builds).uniq(&:build_number)
19
24
  end
20
25
 
21
26
  def mark_as_shown(build_number)