gitlab_support_readiness 1.0.1 → 1.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
2
  SHA256:
3
- metadata.gz: 1de2ffae8e1281765e09900e7c419a0ff00d6246e8bb3b3a8a7dd183166969c1
4
- data.tar.gz: 53680b4443fc7e6acb7070528086312e765b7df5b5c0c4ad31e7c36ad1b8b054
3
+ metadata.gz: 3c81b046b4ed9abb81b5815933f819f975bc06a02492a0f377400cc3265b4e45
4
+ data.tar.gz: d6e4054169a43b0670dce53f71ad642276e89c634960d294cdf8ef2c853ba9f9
5
5
  SHA512:
6
- metadata.gz: 76779ce38fe4b729299135cad8bdf2bf66a69a97bb274c48e3db70fa1a9eb81c80c19556db1bc9a364e7291f45ab0335877fc9ab326170c3e3f9870637c34c85
7
- data.tar.gz: 964ac87e04e9e3be5d09b245b7fac72a08f6c37e12850c30e4549266d77d675c7638721e18ff6e62724982668620d6c2f4faf9eb0d24f0c1c537fe03892c6733
6
+ metadata.gz: c062e6b4fd08ee671c85f3fa95018d2ff30f578f19827b233ad18f56b5a3274efba3f31e1bd3a6b5c9944b0d9e1956534da8e9c657cde77ef76565d06a3aed0d
7
+ data.tar.gz: c81f1fa4ac72f8227edab1412260b81b7ba8e0d3a05477f3777dcf1b0ec37afbb7aca8b9fe6750af3a54477b680580a453a553adce8ddac92de4de1adc3f43f4
@@ -483,6 +483,30 @@ module Readiness
483
483
  handle_request_error(1, 'GitLab', response.status, { action: 'Unblock a user', id: user.id }) unless response.status == 201
484
484
  true
485
485
  end
486
+
487
+ ##
488
+ # Fetches the email addresses for a user
489
+ #
490
+ # @author Jason Colyer
491
+ # @since 1.0.3
492
+ # @param client [Object] An instance of {Readiness::GitLab::Client}
493
+ # @param user [Object] An instance of {Readiness::GitLab::Users}
494
+ # @return [Array]
495
+ # @see https://docs.gitlab.com/ee/api/user_email_addresses.html#list-email-addresses-for-a-user GitLab API > Users > User email addresses > List email addresses for a user
496
+ # @example
497
+ # require 'support_readiness'
498
+ # config = Readiness::GitLab::Configuration.new
499
+ # config.token = 'test123abc'
500
+ # client = Readiness::GitLab::Client.new(config)
501
+ # user = Readiness::GitLab::Users.find!(client, 2672834)
502
+ # emails = Readiness::GitLab::Users.emails(client, user)
503
+ # pp emaiks.first['email']
504
+ # # => 'alice+test@example.com'
505
+ def self.emails(client, user)
506
+ response = client.connection.get "users/#{user.id}/emails"
507
+ handle_request_error(0, 'GitLab', response.status) unless response.status == 200
508
+ Oj.load(response.body)
509
+ end
486
510
  end
487
511
  end
488
512
  end
@@ -19,7 +19,6 @@ require 'faraday/retry'
19
19
  require 'json'
20
20
  require 'oj'
21
21
  require 'redis'
22
- require 'restforce'
23
22
  require "#{__dir__}/support_readiness/client"
24
23
  require "#{__dir__}/support_readiness/gitlab"
25
24
  require "#{__dir__}/support_readiness/pagerduty"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_support_readiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Colyer