circleci 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b8ad4e015fa14b22d3b29b51d35c6a8e3aca2418
4
- data.tar.gz: 40848b2303c89b7dccaf23c5ce6aa79b9845dd40
2
+ SHA256:
3
+ metadata.gz: 61090d7131b3dfc9c8f463ef02bea44d11add5afabf993461c3fcaaf4209f81e
4
+ data.tar.gz: e779ebf7c41772d7d2cf20ca4606fdc95db01e8df033ad4bd526e65a5c5626e0
5
5
  SHA512:
6
- metadata.gz: 736d7da462ffe4dedcc8d5e61652586b969b33a1ff5d862184fa7f8f7812a129d59e58170655bebe225a5f12edb0dd6bff1b7ffdaa1b04448f5514b7fc2db5b9
7
- data.tar.gz: 54d0cf1b9ff93a4721f6e31d731ad698cc423024d93a283bd6a5955797db4f5bdf61e93739f252925e7d4dc4152433ad18e1ab0c7534b4272008967c680fbb29
6
+ metadata.gz: b4fc083397d34c127e3318842acf314694427c562d463b3906af7d31697b4be5eec712d544fa8cd1cdb6e60679e876c868ed7774f532ec88596900502e603d9a
7
+ data.tar.gz: 9416105095244a10d840250e359d9ba3570bd7a4a695660ec50c832fad45207f0c81a2bbf893ddf0ae3102eae48dd7aa00f2efb92c4ef14a0fe51f20171e5334
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -1,18 +1,12 @@
1
1
  # circleci
2
2
 
3
- [![Latest Version](https://img.shields.io/gem/v/circleci.svg)](http://rubygems.org/gems/circleci)
3
+ [![Gem Version](https://badge.fury.io/rb/circleci.svg)](https://badge.fury.io/rb/circleci)
4
4
  [![Circle CI](https://circleci.com/gh/mtchavez/circleci.svg?style=svg)](https://circleci.com/gh/mtchavez/circleci)
5
- [![Code Climate](https://codeclimate.com/github/mtchavez/circleci.png)](https://codeclimate.com/github/mtchavez/circleci)
6
- [![Coverage Status](https://coveralls.io/repos/mtchavez/circleci/badge.png)](https://coveralls.io/r/mtchavez/circleci)
7
- [![Dependency Status](https://gemnasium.com/mtchavez/circleci.svg)](https://gemnasium.com/mtchavez/circleci)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/ce857cb1b17fadd3bb4e/maintainability)](https://codeclimate.com/github/mtchavez/circleci/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/ce857cb1b17fadd3bb4e/test_coverage)](https://codeclimate.com/github/mtchavez/circleci/test_coverage)
8
7
 
9
8
  Circle CI API Wrapper. Requires ruby `>= 2.0.0`.
10
9
 
11
- **Version 2.x has breaking changes from v1.x**
12
- > Please use branch v-1.1.0 or tag v1.1.0 for previous 1.x version of
13
- > the gem until you can update to the latest version. 1.x will not be supported
14
- > in the longer term.
15
-
16
10
  ## Install
17
11
 
18
12
  ```ruby
@@ -164,6 +158,7 @@ project.vcs_type # will be github
164
158
  * [Recent Builds Branch](#recent_builds_branch)
165
159
  * [Settings](#settings)
166
160
  * [Add Envvar](#add_envvar)
161
+ * [Delete Envvar](#delete_envvar)
167
162
  * [SSH Key](#ssh_key)
168
163
  * [Unfollow](#unfollow)
169
164
  * [Build](#build)
@@ -290,8 +285,8 @@ Build a specific branch of a project
290
285
  # Use global config with token for user
291
286
  project = CircleCi::Project.new 'username', 'reponame'
292
287
 
293
- # Get recent failed builds with a filter parameter
294
- failed_builds = project.build_branch 'branch'
288
+ # Build the latest push for this branch
289
+ latest_build = project.build_branch 'branch'
295
290
 
296
291
  # Adding URL params for revision or parallel
297
292
  params = { revision: 'fda12345asdf', parallel: 2 }
@@ -900,6 +895,30 @@ Example response
900
895
  {"name":"foo","value":"xxxx"}
901
896
  ```
902
897
 
898
+ #### [delete_envvar](#delete_envvar)
899
+
900
+ Endpoint: `/project/:username/:project/envvar`
901
+
902
+ Deletes an environment variable for a project
903
+
904
+ ```ruby
905
+ envvar = 'SECRET_CI_TOKEN'
906
+
907
+ # Use global config with token for user
908
+ project = CircleCi::Project.new 'username', 'reponame'
909
+ res = project.delete_envvar envvar
910
+
911
+ # Use a different config with another user token
912
+ project = CircleCi::Project.new 'username', 'reponame', 'github', other_project_config
913
+ project.delete_envvar envvar
914
+ ```
915
+
916
+ Example response
917
+
918
+ ```javascript
919
+ {"message": "ok"}
920
+ ```
921
+
903
922
  #### [ssh_key](#ssh_key)
904
923
 
905
924
  Endpoint: `/project/:username/:repository/ssh-key`
@@ -13,7 +13,7 @@ module CircleCi
13
13
  def initialize(username = nil, project = nil, conf = nil)
14
14
  @username = username
15
15
  @project = project
16
- @conf = conf ? conf : default_config
16
+ @conf = conf || default_config
17
17
  end
18
18
 
19
19
  def self.default_config
@@ -25,7 +25,7 @@ module CircleCi
25
25
  @version = version
26
26
  @token = token
27
27
  @request_overrides = request_overrides
28
- @logger = logger ? logger : Logger.new(STDOUT)
28
+ @logger = logger || Logger.new(STDOUT)
29
29
  end
30
30
  # rubocop:enable Metrics/ParameterLists
31
31
 
@@ -38,11 +38,12 @@ module CircleCi
38
38
  end
39
39
 
40
40
  def proxy_to_port
41
- proxy_port ? proxy_port : 80
41
+ proxy_port || 80
42
42
  end
43
43
 
44
44
  def proxy_uri
45
45
  return unless @proxy && proxy_host
46
+
46
47
  host_uri = URI.parse(proxy_host)
47
48
  userinfo = proxy_userinfo? ? "#{proxy_user}:#{proxy_pass}@" : ''
48
49
  URI.parse("#{host_uri.scheme}://#{userinfo}#{host_uri.host}:#{proxy_to_port}#{host_uri.path}")
@@ -168,6 +168,16 @@ module CircleCi
168
168
  CircleCi.request(conf, "#{base_path}/envvar").post(envvar)
169
169
  end
170
170
 
171
+ ##
172
+ #
173
+ # Deletes an envvar for a project
174
+ #
175
+ # @param envvar [String] - 'TESTENV'
176
+ # @return [CircleCi::Response] - Response object
177
+ def delete_envvar(envvar)
178
+ CircleCi.request(conf, "#{base_path}/envvar/#{envvar}").delete
179
+ end
180
+
171
181
  ##
172
182
  #
173
183
  # Add a ssh key to a project
@@ -16,7 +16,7 @@ module CircleCi
16
16
  # Initializing response object to be returned from API calls, used internally.
17
17
  #
18
18
  # @private
19
- def initialize(resp) # @private
19
+ def initialize(resp)
20
20
  @resp = resp
21
21
  @body = parsed_body
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circleci
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chavez
@@ -10,56 +10,46 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdjb250
14
- YWN0MRkwFwYKCZImiZPyLGQBGRYJZWwtY2hhdmV6MRIwEAYKCZImiZPyLGQBGRYC
15
- bWUwHhcNMTcxMDA0MTY0OTE5WhcNMTgxMDA0MTY0OTE5WjBBMRAwDgYDVQQDDAdj
16
- b250YWN0MRkwFwYKCZImiZPyLGQBGRYJZWwtY2hhdmV6MRIwEAYKCZImiZPyLGQB
17
- GRYCbWUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD3S1PMDhKEvRYX
18
- p6AoUsx/fAycagXv3WvLQuFB95HXHOQ0kcoy08GCSjy0ZExOAUS8KV3eIWtL49dp
19
- UkgHP/lYbWb7fr+89YLu5TbsZiGiNuXCxeice8oW2czH0bRXZ3hVbiI8zH6A/SKf
20
- ugDi14TpugfDPEPO5lk0rTui1/+/3lD+B8TjezihJ5lRf8zG1jHv1ukzOg8QcmOd
21
- yBl1ej3NSY1oT7B1x8mtEGhtVFeguVwmrWdjXTBqV8cPWT1F6PmciOf6C8y6Ag37
22
- evUHIEm+zmz00mvSnNt5fy8vxFMdNYWGV62IhKJXoAmWEDkSXVF05PfJN+9J28/H
23
- HghllVKbAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
24
- BBSKVaQXw8IuISmQQFhwF0MXmaquFT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QLqoh5PwIhIW+wugtc+bb17cEQDuNYGMP2p
22
+ XZk8rdkcICAanBMBq6iQ6Y16Qk0aDuwfG+z7r21U+6b+xvRTgnEQtAWcgrNQfIot
23
+ l2cUVrKORwqksMgBdBWFXnIFWELBQTjctlSzN+aVes7MiG8xL6GLhw8t4cRPuXuo
24
+ 75BKqrQxNwiCUbkCXRz2qm4hI1mXMjXeZoCTzkDrAgMBAAGjezB5MAkGA1UdEwQC
25
+ MAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBTfbl7AdXC+ZHUSdKQDm3WSqdZFWzAf
26
+ BgNVHREEGDAWgRRjb250YWN0QGVsLWNoYXZlei5tZTAfBgNVHRIEGDAWgRRjb250
27
+ YWN0QGVsLWNoYXZlei5tZTANBgkqhkiG9w0BAQsFAAOCAYEAVFwtaW8yVXeY9A0g
28
+ enOBw+zAegw+hwEqtVu9ihBFRgGmdOpKy4M6VCczUH5UiuGYhUskfzaBWrhz/p1Z
29
+ /Jm7TBoMIMfadwhJhzwbVj4xGM2UzOsk77lwb88eCcJoDCsXswbGTt69gMWhAOY4
30
+ AVgxYC8MXr+Memsyxts6+XTfLqCl8CgmrGDgrmeyLgTUonnNCiorvh19HSDdqTru
31
+ oOiKlvPHq9LLzsL3lcFxrvUttOZE+k9TQqWUHtXSPYTKse4h66UtzsRG6o6WgW8c
32
+ u2bEy+cGzSlAiP5yNDLff5WP9VnMKhoxc97ADyAUQ4rrKi3wRVXf4K7DpGny1W3C
33
+ EQgzzH5CkIhqK+UVh5zC9UZIpDDeylDul3rvxaRV4TqpRzOm+Vsoc4RUGWngZUi+
34
+ 6jerLBXBmcX53OXAzqUVvXdltwSkV6s8QU+HoX9UjEZJc0C8PZImFJK8luKAJyan
35
+ j5z5DqHqyQohXShIy6UFpAs4Jka/L7Uo7/iCYIeaE/0rRFLS
32
36
  -----END CERTIFICATE-----
33
- date: 2018-01-28 00:00:00.000000000 Z
37
+ date: 2020-01-06 00:00:00.000000000 Z
34
38
  dependencies:
35
- - !ruby/object:Gem::Dependency
36
- name: coveralls
37
- requirement: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: 0.8.21
42
- type: :development
43
- prerelease: false
44
- version_requirements: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: 0.8.21
49
39
  - !ruby/object:Gem::Dependency
50
40
  name: dotenv
51
41
  requirement: !ruby/object:Gem::Requirement
52
42
  requirements:
53
43
  - - "~>"
54
44
  - !ruby/object:Gem::Version
55
- version: 2.2.0
45
+ version: 2.7.1
56
46
  type: :development
57
47
  prerelease: false
58
48
  version_requirements: !ruby/object:Gem::Requirement
59
49
  requirements:
60
50
  - - "~>"
61
51
  - !ruby/object:Gem::Version
62
- version: 2.2.0
52
+ version: 2.7.1
63
53
  - !ruby/object:Gem::Dependency
64
54
  name: gemcutter
65
55
  requirement: !ruby/object:Gem::Requirement
@@ -80,126 +70,154 @@ dependencies:
80
70
  requirements:
81
71
  - - "~>"
82
72
  - !ruby/object:Gem::Version
83
- version: 1.12.1
73
+ version: 1.14.1
84
74
  type: :development
85
75
  prerelease: false
86
76
  version_requirements: !ruby/object:Gem::Requirement
87
77
  requirements:
88
78
  - - "~>"
89
79
  - !ruby/object:Gem::Version
90
- version: 1.12.1
80
+ version: 1.14.1
91
81
  - !ruby/object:Gem::Dependency
92
82
  name: pry
93
83
  requirement: !ruby/object:Gem::Requirement
94
84
  requirements:
95
85
  - - "~>"
96
86
  - !ruby/object:Gem::Version
97
- version: 0.10.4
87
+ version: 0.12.0
98
88
  type: :development
99
89
  prerelease: false
100
90
  version_requirements: !ruby/object:Gem::Requirement
101
91
  requirements:
102
92
  - - "~>"
103
93
  - !ruby/object:Gem::Version
104
- version: 0.10.4
94
+ version: 0.12.0
105
95
  - !ruby/object:Gem::Dependency
106
96
  name: pry-byebug
107
97
  requirement: !ruby/object:Gem::Requirement
108
98
  requirements:
109
99
  - - "~>"
110
100
  - !ruby/object:Gem::Version
111
- version: 3.4.2
101
+ version: 3.7.0
112
102
  type: :development
113
103
  prerelease: false
114
104
  version_requirements: !ruby/object:Gem::Requirement
115
105
  requirements:
116
106
  - - "~>"
117
107
  - !ruby/object:Gem::Version
118
- version: 3.4.2
108
+ version: 3.7.0
119
109
  - !ruby/object:Gem::Dependency
120
110
  name: pry-doc
121
111
  requirement: !ruby/object:Gem::Requirement
122
112
  requirements:
123
113
  - - "~>"
124
114
  - !ruby/object:Gem::Version
125
- version: 0.11.1
115
+ version: 1.0.0
126
116
  type: :development
127
117
  prerelease: false
128
118
  version_requirements: !ruby/object:Gem::Requirement
129
119
  requirements:
130
120
  - - "~>"
131
121
  - !ruby/object:Gem::Version
132
- version: 0.11.1
122
+ version: 1.0.0
133
123
  - !ruby/object:Gem::Dependency
134
124
  name: rake
135
125
  requirement: !ruby/object:Gem::Requirement
136
126
  requirements:
137
127
  - - "~>"
138
128
  - !ruby/object:Gem::Version
139
- version: 12.0.0
129
+ version: 13.0.0
140
130
  type: :development
141
131
  prerelease: false
142
132
  version_requirements: !ruby/object:Gem::Requirement
143
133
  requirements:
144
134
  - - "~>"
145
135
  - !ruby/object:Gem::Version
146
- version: 12.0.0
136
+ version: 13.0.0
147
137
  - !ruby/object:Gem::Dependency
148
138
  name: redcarpet
149
139
  requirement: !ruby/object:Gem::Requirement
150
140
  requirements:
151
141
  - - "~>"
152
142
  - !ruby/object:Gem::Version
153
- version: 3.4.0
143
+ version: 3.5.0
154
144
  type: :development
155
145
  prerelease: false
156
146
  version_requirements: !ruby/object:Gem::Requirement
157
147
  requirements:
158
148
  - - "~>"
159
149
  - !ruby/object:Gem::Version
160
- version: 3.4.0
150
+ version: 3.5.0
161
151
  - !ruby/object:Gem::Dependency
162
152
  name: rspec
163
153
  requirement: !ruby/object:Gem::Requirement
164
154
  requirements:
165
155
  - - "~>"
166
156
  - !ruby/object:Gem::Version
167
- version: 3.6.0
157
+ version: 3.9.0
168
158
  type: :development
169
159
  prerelease: false
170
160
  version_requirements: !ruby/object:Gem::Requirement
171
161
  requirements:
172
162
  - - "~>"
173
163
  - !ruby/object:Gem::Version
174
- version: 3.6.0
164
+ version: 3.9.0
175
165
  - !ruby/object:Gem::Dependency
176
166
  name: rubocop
177
167
  requirement: !ruby/object:Gem::Requirement
178
168
  requirements:
179
169
  - - "~>"
180
170
  - !ruby/object:Gem::Version
181
- version: 0.49.1
171
+ version: 0.79.0
172
+ type: :development
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: 0.79.0
179
+ - !ruby/object:Gem::Dependency
180
+ name: rubocop-performance
181
+ requirement: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - "~>"
184
+ - !ruby/object:Gem::Version
185
+ version: 1.5.2
186
+ type: :development
187
+ prerelease: false
188
+ version_requirements: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: 1.5.2
193
+ - !ruby/object:Gem::Dependency
194
+ name: rubocop-rspec
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - "~>"
198
+ - !ruby/object:Gem::Version
199
+ version: 1.37.1
182
200
  type: :development
183
201
  prerelease: false
184
202
  version_requirements: !ruby/object:Gem::Requirement
185
203
  requirements:
186
204
  - - "~>"
187
205
  - !ruby/object:Gem::Version
188
- version: 0.49.1
206
+ version: 1.37.1
189
207
  - !ruby/object:Gem::Dependency
190
208
  name: simplecov
191
209
  requirement: !ruby/object:Gem::Requirement
192
210
  requirements:
193
211
  - - "~>"
194
212
  - !ruby/object:Gem::Version
195
- version: 0.14.1
213
+ version: 0.17.0
196
214
  type: :development
197
215
  prerelease: false
198
216
  version_requirements: !ruby/object:Gem::Requirement
199
217
  requirements:
200
218
  - - "~>"
201
219
  - !ruby/object:Gem::Version
202
- version: 0.14.1
220
+ version: 0.17.0
203
221
  - !ruby/object:Gem::Dependency
204
222
  name: typhoeus
205
223
  requirement: !ruby/object:Gem::Requirement
@@ -220,28 +238,28 @@ dependencies:
220
238
  requirements:
221
239
  - - "~>"
222
240
  - !ruby/object:Gem::Version
223
- version: 3.0.3
241
+ version: 4.0.0
224
242
  type: :development
225
243
  prerelease: false
226
244
  version_requirements: !ruby/object:Gem::Requirement
227
245
  requirements:
228
246
  - - "~>"
229
247
  - !ruby/object:Gem::Version
230
- version: 3.0.3
248
+ version: 4.0.0
231
249
  - !ruby/object:Gem::Dependency
232
250
  name: webmock
233
251
  requirement: !ruby/object:Gem::Requirement
234
252
  requirements:
235
253
  - - "~>"
236
254
  - !ruby/object:Gem::Version
237
- version: 3.0.1
255
+ version: 3.7.1
238
256
  type: :development
239
257
  prerelease: false
240
258
  version_requirements: !ruby/object:Gem::Requirement
241
259
  requirements:
242
260
  - - "~>"
243
261
  - !ruby/object:Gem::Version
244
- version: 3.0.1
262
+ version: 3.7.1
245
263
  - !ruby/object:Gem::Dependency
246
264
  name: yard
247
265
  requirement: !ruby/object:Gem::Requirement
@@ -296,8 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
314
  - !ruby/object:Gem::Version
297
315
  version: '0'
298
316
  requirements: []
299
- rubyforge_project:
300
- rubygems_version: 2.6.11
317
+ rubygems_version: 3.0.1
301
318
  signing_key:
302
319
  specification_version: 4
303
320
  summary: Circle CI REST API gem
metadata.gz.sig CHANGED
Binary file