peoplegroup-connectors 0.1.4 → 0.1.10

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: e340134de5e6005a6abbaf23e43a8eb58a2b544c98ae255c211f58f4e977c12a
4
- data.tar.gz: ded841507c511fa4086074c0dcfb0d8a1d23eb1c3635bb98c1653480abf6cca3
3
+ metadata.gz: c78c67d1667a5441fdc3c59cd7aceaead99cc3c23e6f646a2a29a837ceef8c69
4
+ data.tar.gz: 666e6fec2e69ea4ed830a9247a61fa5fe9f43d9ae363aff5223c8a07554f5262
5
5
  SHA512:
6
- metadata.gz: 4f5cce06b2badfcce8d829e1a9a644093b107fdd3ad44e12090d2b664e563f1037aa4e129eacabde7b87b41dc9421ade5ff0119db466d147d6a74b54b82ce6a6
7
- data.tar.gz: 480a77c30f5158fc601a543b7b49bc05e7168230a1b243319526aa67c028dd8ecd3be4bd58296c38681441d47a6647505c85e50f5756704e9d6527e7f496c40f
6
+ metadata.gz: 6493e56abb36adacbab060fcf91f41db56bd69e8280d028e7086bc73ceae8a144ef8f7c84850640ffcc70a5577323387365a936099c93c3611875171a0dd6d12
7
+ data.tar.gz: c3bda22d3e0612c3c059c80cee5aea1f866b4dfbae0b0fa391b320d87063b4f8ec1bc65f86dcae192a71bd9c68a0dcc0facc6536106ad3553fb9d279d5f3e3de
data/README.md CHANGED
@@ -1,15 +1,13 @@
1
- # Connectors
1
+ # PeopleGroup::Connectors
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/connectors`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ The gem contains wrapper code for all the services we sync with. The reason we bundled this in a separate gem is to not have duplicate code in our different projects.
6
4
 
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
10
8
 
11
9
  ```ruby
12
- gem 'connectors'
10
+ gem 'peoplegroup-connectors'
13
11
  ```
14
12
 
15
13
  And then execute:
@@ -18,11 +16,14 @@ And then execute:
18
16
 
19
17
  Or install it yourself as:
20
18
 
21
- $ gem install connectors
19
+ $ gem install peoplegroup-connectors
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ```ruby
24
+ gitlab_client = PeopleGroup::Connectors::GitLab.new
25
+ gitlab_client.find_gitlabber(:email, 'some-email@domain.com')
26
+ ```
26
27
 
27
28
  ## Development
28
29
 
@@ -30,15 +31,11 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
30
31
 
31
32
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
33
 
33
- ## Contributing
34
+ ## Contributing and Code of Conduct
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/connectors. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/connectors/blob/master/CODE_OF_CONDUCT.md).
36
+ Bug reports and pull requests are welcome on GitLab at https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
37
 
37
38
 
38
39
  ## License
39
40
 
40
41
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
-
42
- ## Code of Conduct
43
-
44
- Everyone interacting in the Connectors project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/connectors/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'connectors/version'
4
+ require_relative 'connectors/gitlab'
5
+ require_relative 'connectors/slack'
6
+ require_relative 'connectors/pto_roots'
7
+ require_relative 'connectors/bamboo'
8
+ require_relative 'connectors/greenhouse'
9
+
10
+ module PeopleGroup
11
+ module Connectors
12
+ class Error < StandardError; end
13
+ end
14
+ end
@@ -0,0 +1,174 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bamboozled'
4
+
5
+ module PeopleGroup
6
+ module Connectors
7
+ class Bamboo
8
+ MAX_RETRIES = 3
9
+
10
+ def initialize
11
+ @client = Bamboozled.client(subdomain: 'gitlab', api_key: ENV['BAMBOO_API_KEY'])
12
+ end
13
+
14
+ def get_employee_details(id)
15
+ employees.find { |emp| emp['id'] == id.to_s }
16
+ end
17
+
18
+ def get_employee(id)
19
+ @client.employee.find(id, %w[firstName lastName jobTitle supervisor hireDate country location department division workEmail customCostCenter])
20
+ end
21
+
22
+ def search_employee(name)
23
+ return if name.empty?
24
+
25
+ employees.find do |emp|
26
+ [
27
+ emp['displayName']&.downcase,
28
+ "#{emp['firstName']&.downcase} #{emp['lastName']&.downcase}",
29
+ "#{emp['preferredName']&.downcase} #{emp['lastName']&.downcase}",
30
+ "#{emp['firstName']&.downcase} #{emp['customPreferredLastName']&.downcase}",
31
+ "#{emp['preferredName']&.downcase} #{emp['customPreferredLastName']&.downcase}"
32
+ ].include?(name.downcase)
33
+ end
34
+ end
35
+ alias_method :search_team_member, :search_employee
36
+
37
+ def search_employee_by_field(field:, value:)
38
+ employees.find { |employee| employee[field] == value.to_s }
39
+ end
40
+
41
+ def fetch_manager(team_member)
42
+ active_team_members.find { |tm| tm['id'] == team_member['supervisorEId'] }
43
+ end
44
+
45
+ def fetch_second_level_manager(team_member)
46
+ fetch_manager(fetch_manager(team_member))
47
+ end
48
+
49
+ def create_employee(employee_details_hash)
50
+ @client.employee.add(employee_details_hash)
51
+ end
52
+
53
+ def update_employee(employee_id, employee_details_hash)
54
+ @client.employee.update(employee_id, employee_details_hash)
55
+ end
56
+
57
+ def departments
58
+ meta_fields.detect { |res| res['name'] == 'Department' }.dig('options').each_with_object([]) { |option, array| array << option['name'] if option['archived'] == 'no' } || []
59
+ end
60
+
61
+ def divisions
62
+ meta_fields.detect { |res| res['name'] == 'Division' }.dig('options').each_with_object([]) { |option, array| array << option['name'] if option['archived'] == 'no' } || []
63
+ end
64
+
65
+ def fields
66
+ @fields ||= (Bamboozled::API::FieldCollection.all_names + @client.meta.fields.map { |f| f['alias'] }).compact.uniq
67
+ end
68
+
69
+ def employees
70
+ retries = 0
71
+
72
+ begin
73
+ @employees ||= @client.report.custom(fields, 'JSON').reject { |employee| employee['lastName'] == 'Test-Gitlab' }
74
+ rescue Net::ReadTimeout
75
+ retry if (retries += 1) < MAX_RETRIES
76
+ end
77
+ end
78
+
79
+ def active_employees
80
+ employees.select { |employee| employee['status'] == 'Active' }
81
+ end
82
+ alias_method :active_team_members, :active_employees
83
+
84
+ def add_stock_options(employee_id, data)
85
+ @client.employee.add_table_row(employee_id, 'customEquity', data)
86
+ end
87
+
88
+ def stock_options_data(employee_id)
89
+ @client.employee.table_data(employee_id, 'customEquity')
90
+ end
91
+
92
+ def update_job_details(employee_id, data)
93
+ current_data = job_details(employee_id) # it should only be one row as we just created this user
94
+ row_id = current_data.first.dig('id')
95
+ @client.employee.update_table_row(employee_id, 'jobInfo', row_id, data)
96
+ end
97
+
98
+ def add_compensation_details(employee_id, data)
99
+ @client.employee.add_table_row(employee_id, 'compensation', data)
100
+ end
101
+
102
+ def employment_statuses(employee_id)
103
+ @client.employee.table_data(employee_id, 'employmentStatus')
104
+ end
105
+
106
+ def job_details(employee_id)
107
+ @client.employee.table_data(employee_id, 'jobInfo')
108
+ end
109
+
110
+ def resumes_folder_id(employee_id)
111
+ @resumes_folder_id ||= files(employee_id).dig('categories').find { |folder| folder['name'] == 'Resumes and Applications' }.dig('id')
112
+ end
113
+
114
+ def contract_folder_id(employee_id)
115
+ @contract_folder_id ||= files(employee_id).dig('categories').find { |folder| folder['name'] == 'Contracts & Changes' }.dig('id')
116
+ end
117
+
118
+ def add_file(employee_id, file_name, file, folder_id)
119
+ options = {
120
+ category: folder_id,
121
+ fileName: file_name,
122
+ share: 'yes',
123
+ file: file
124
+ }
125
+ @client.employee.add_file(employee_id, options)
126
+ end
127
+
128
+ def add_employment_status(employee_id, data)
129
+ @client.employee.add_table_row(employee_id, 'employmentStatus', data)
130
+ end
131
+
132
+ def add_currency_conversion(employee_id, data)
133
+ @client.employee.add_table_row(employee_id, 'customCurrencyConversion', data)
134
+ end
135
+
136
+ def add_on_target_earnings(employee_id, data)
137
+ @client.employee.add_table_row(employee_id, 'customOnTargetEarnings', data)
138
+ end
139
+
140
+ def add_signing_bonus(employee_id, data)
141
+ @client.employee.add_table_row(employee_id, 'customBonus', data)
142
+ end
143
+
144
+ def add_family_member(employee_id, data)
145
+ @client.employee.add_table_row(employee_id, 'customFamilyMember', data)
146
+ end
147
+
148
+ def add_additional_data(employee_id, data)
149
+ @client.employee.add_table_row(employee_id, 'customAdditionalInformation1', data)
150
+ end
151
+
152
+ def add_bonus(team_member_id, comment)
153
+ data = {
154
+ customBonusdate: Date.today.to_s,
155
+ customBonusamount: { value: 1_000, currency: 'USD' },
156
+ customBonustype: 'Discretionary Bonus',
157
+ customBonuscomments: comment
158
+ # customNominatedBy: 'TODO'
159
+ }
160
+ @client.employee.add_table_row(team_member_id, 'customBonus', data)
161
+ end
162
+
163
+ private
164
+
165
+ def meta_fields
166
+ @meta_fields ||= @client.meta.lists
167
+ end
168
+
169
+ def files(employee_id)
170
+ @files ||= @client.employee.files(employee_id)
171
+ end
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'greenhouse_io'
4
+
5
+ module PeopleGroup
6
+ module Connectors
7
+ class Greenhouse
8
+ MAX_RETRIES = 3
9
+
10
+ def initialize(use_users_api_key: false)
11
+ api_key = use_users_api_key ? ENV['GREENHOUSE_API_KEY_USERS'] : ENV['GREENHOUSE_API_KEY']
12
+ @client = GreenhouseIo::Client.new(api_key)
13
+ end
14
+
15
+ def offer_for_application(application_id)
16
+ @client.offers_for_application(application_id)
17
+ end
18
+
19
+ def hired_candidates(updated_since)
20
+ page = 1
21
+ candidates = []
22
+ retries = 0
23
+
24
+ loop do
25
+ begin
26
+ results = @client.candidates(nil, updated_after: updated_since, page: page)
27
+ break if results.empty?
28
+
29
+ results.each do |candidate|
30
+ candidates << candidate if hired_non_active?(candidate)
31
+ end
32
+ rescue GreenhouseIo::Error
33
+ p [updated_since, page]
34
+ retry if (retries += 1) < MAX_RETRIES
35
+ end
36
+ page += 1
37
+ end
38
+
39
+ candidates
40
+ end
41
+
42
+ def candidate(candidate_id)
43
+ @client.candidates(candidate_id)
44
+ end
45
+
46
+ def add_sync_note_to_candidate(candidate_id)
47
+ note = {
48
+ user_id: ENV['GREENHOUSE_AUTHOR_ID'],
49
+ body: "This person was synced at #{Time.now} by the Employee Bot",
50
+ visibility: 'public'
51
+ }
52
+ @client.create_candidate_note(candidate_id, note, ENV['GREENHOUSE_AUTHOR_ID'])
53
+ end
54
+
55
+ def users
56
+ page = 1
57
+ users = []
58
+
59
+ loop do
60
+ results = @client.users(nil, page: page)
61
+ break if results.empty?
62
+
63
+ users += results
64
+ page += 1
65
+ end
66
+
67
+ users
68
+ end
69
+
70
+ private
71
+
72
+ def hired_non_active?(candidate)
73
+ # If the candidate has any application that is active, we don't sync.
74
+ return false if candidate['applications'].any? { |application| application['status'] == 'active' }
75
+
76
+ # Check if candidate is hired for just one of their applications
77
+ candidate['applications'].one? { |application| application['status'] == 'hired' }
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'splinter'
4
+
5
+ module PeopleGroup
6
+ module Connectors
7
+ class PTORoots
8
+ def initialize
9
+ ::Splinter.configure do |config|
10
+ config.api_key = ENV['PTO_ROOTS_API_KEY']
11
+ end
12
+ end
13
+
14
+ def pto(params)
15
+ Splinter::OOOEvents.get_all(params)
16
+ end
17
+
18
+ def pto_type(type)
19
+ pto_types.find { |pto_type| pto_type['name'] == type }
20
+ end
21
+
22
+ private
23
+
24
+ def pto_types
25
+ Splinter::OOOTypes.get_all
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'slack-ruby-client'
4
+
5
+ module PeopleGroup
6
+ module Connectors
7
+ class Slack
8
+ def initialize
9
+ ::Slack.configure do |config|
10
+ config.token = ENV['SLACK_API_TOKEN']
11
+ end
12
+ @client = ::Slack::Web::Client.new
13
+ end
14
+
15
+ def find_user(email)
16
+ @client.users_lookupByEmail(email: email)
17
+ rescue ::Slack::Web::Api::Errors::SlackError
18
+ nil
19
+ end
20
+
21
+ def list_public_channels
22
+ channels = @client.channels_list(exclude_archived: true).channels
23
+ channels.reject(&:is_private)&.map(:name)
24
+ end
25
+
26
+ def send_message(channel:, text:, as_user: true, attachments: [])
27
+ @client.chat_postMessage(channel: channel, text: text, as_user: true, attachments: attachments, unfurl_links: false)
28
+ end
29
+
30
+ def update_message(channel:, timestamp:, text:)
31
+ @client.chat_update(channel: channel, text: text, ts: timestamp, as_user: true, attachments: [])
32
+ end
33
+
34
+ def send_modal_message(trigger:, view:)
35
+ @client.views_open(trigger_id: trigger, view: view)
36
+ end
37
+
38
+ def publish_view(user_id:, trigger:, view:)
39
+ @client.views_publish(user_id: user_id, trigger_id: trigger, view: view)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PeopleGroup
4
+ module Connectors
5
+ VERSION = '0.1.10'
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peoplegroup-connectors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - lien van den steen
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-01 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab
@@ -24,6 +24,62 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: slack-ruby-client
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.14'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.14'
41
+ - !ruby/object:Gem::Dependency
42
+ name: splinter-pto
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bamboozled-gitlab
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.9
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.9
69
+ - !ruby/object:Gem::Dependency
70
+ name: greenhouse_io-gitlab
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.5'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.5'
27
83
  - !ruby/object:Gem::Dependency
28
84
  name: rspec
29
85
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +100,28 @@ dependencies:
44
100
  requirements:
45
101
  - - "~>"
46
102
  - !ruby/object:Gem::Version
47
- version: '0.85'
103
+ version: 0.91.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.91.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: gitlab-styles
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '6.0'
48
118
  type: :development
49
119
  prerelease: false
50
120
  version_requirements: !ruby/object:Gem::Requirement
51
121
  requirements:
52
122
  - - "~>"
53
123
  - !ruby/object:Gem::Version
54
- version: '0.85'
124
+ version: '6.0'
55
125
  - !ruby/object:Gem::Dependency
56
126
  name: rubocop-packaging
57
127
  requirement: !ruby/object:Gem::Requirement
@@ -87,22 +157,15 @@ executables: []
87
157
  extensions: []
88
158
  extra_rdoc_files: []
89
159
  files:
90
- - ".gitignore"
91
- - ".gitlab-ci.yml"
92
- - ".rspec"
93
- - ".travis.yml"
94
- - CODE_OF_CONDUCT.md
95
- - Gemfile
96
- - Gemfile.lock
97
160
  - LICENSE.txt
98
161
  - README.md
99
- - Rakefile
100
- - bin/console
101
- - bin/setup
102
- - connectors.gemspec
103
- - lib/connectors.rb
104
- - lib/connectors/gitlab.rb
105
- - lib/connectors/version.rb
162
+ - lib/peoplegroup/connectors.rb
163
+ - lib/peoplegroup/connectors/bamboo.rb
164
+ - lib/peoplegroup/connectors/gitlab.rb
165
+ - lib/peoplegroup/connectors/greenhouse.rb
166
+ - lib/peoplegroup/connectors/pto_roots.rb
167
+ - lib/peoplegroup/connectors/slack.rb
168
+ - lib/peoplegroup/connectors/version.rb
106
169
  homepage: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
107
170
  licenses:
108
171
  - MIT
@@ -125,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
188
  - !ruby/object:Gem::Version
126
189
  version: '0'
127
190
  requirements: []
128
- rubygems_version: 3.0.3
191
+ rubygems_version: 3.1.4
129
192
  signing_key:
130
193
  specification_version: 4
131
194
  summary: Library for our shared connectors.
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.gitlab-ci.yml DELETED
@@ -1,20 +0,0 @@
1
- rspec:
2
- stage: test
3
- only:
4
- - merge_requests
5
- script:
6
- - gem install bundler
7
- - bundle install
8
- - bundle exec rspec
9
-
10
- rubocop:
11
- stage: test
12
- only:
13
- - merge_requests
14
- script:
15
- - gem install bundler
16
- - bundle install
17
- - bundle exec rubocop
18
-
19
- include:
20
- template: Dependency-Scanning.gitlab-ci.yml
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.5
6
- before_install: gem install bundler -v 2.1.4
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at lvandensteen@gitlab.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in connectors.gemspec
4
- gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/Gemfile.lock DELETED
@@ -1,75 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- connectors (0.1.0)
5
- gitlab
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.2)
11
- diff-lcs (1.4.4)
12
- gitlab (4.17.0)
13
- httparty (~> 0.18)
14
- terminal-table (~> 1.5, >= 1.5.1)
15
- httparty (0.18.1)
16
- mime-types (~> 3.0)
17
- multi_xml (>= 0.5.2)
18
- mime-types (3.3.1)
19
- mime-types-data (~> 3.2015)
20
- mime-types-data (3.2020.1104)
21
- multi_xml (0.6.0)
22
- parallel (1.20.1)
23
- parser (3.0.0.0)
24
- ast (~> 2.4.1)
25
- rainbow (3.0.0)
26
- rake (12.3.3)
27
- regexp_parser (2.0.3)
28
- rexml (3.2.4)
29
- rspec (3.10.0)
30
- rspec-core (~> 3.10.0)
31
- rspec-expectations (~> 3.10.0)
32
- rspec-mocks (~> 3.10.0)
33
- rspec-core (3.10.1)
34
- rspec-support (~> 3.10.0)
35
- rspec-expectations (3.10.1)
36
- diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.10.0)
38
- rspec-mocks (3.10.2)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.10.0)
41
- rspec-support (3.10.2)
42
- rubocop (0.93.1)
43
- parallel (~> 1.10)
44
- parser (>= 2.7.1.5)
45
- rainbow (>= 2.2.2, < 4.0)
46
- regexp_parser (>= 1.8)
47
- rexml
48
- rubocop-ast (>= 0.6.0)
49
- ruby-progressbar (~> 1.7)
50
- unicode-display_width (>= 1.4.0, < 2.0)
51
- rubocop-ast (1.4.1)
52
- parser (>= 2.7.1.5)
53
- rubocop-packaging (0.5.1)
54
- rubocop (>= 0.89, < 2.0)
55
- rubocop-rspec (1.44.1)
56
- rubocop (~> 0.87)
57
- rubocop-ast (>= 0.7.1)
58
- ruby-progressbar (1.11.0)
59
- terminal-table (1.8.0)
60
- unicode-display_width (~> 1.1, >= 1.1.1)
61
- unicode-display_width (1.7.0)
62
-
63
- PLATFORMS
64
- ruby
65
-
66
- DEPENDENCIES
67
- connectors!
68
- rake (~> 12.0)
69
- rspec (~> 3.0)
70
- rubocop (~> 0.85)
71
- rubocop-packaging (~> 0.1)
72
- rubocop-rspec (~> 1.39)
73
-
74
- BUNDLED WITH
75
- 2.1.4
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "connectors"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/connectors.gemspec DELETED
@@ -1,34 +0,0 @@
1
- require_relative 'lib/connectors/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "peoplegroup-connectors"
5
- spec.version = Connectors::VERSION
6
- spec.authors = ["lien van den steen"]
7
- spec.email = ["lvandensteen@gitlab.com"]
8
-
9
- spec.summary = 'Library for our shared connectors.'
10
- spec.description = 'Avoid repeating methods in different projects for our connectos.'
11
- spec.homepage = 'https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem'
12
- spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
-
15
- spec.metadata['homepage_uri'] = spec.homepage
16
- spec.metadata['source_code_uri'] = spec.homepage
17
- spec.metadata['changelog_uri'] = spec.homepage
18
-
19
- # Specify which files should be added to the gem when it is released.
20
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
- end
24
- spec.bindir = "exe"
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
- spec.require_paths = ["lib"]
27
-
28
- spec.add_dependency 'gitlab'
29
-
30
- spec.add_development_dependency 'rspec', '~> 3.2'
31
- spec.add_development_dependency 'rubocop', '~> 0.85'
32
- spec.add_development_dependency 'rubocop-packaging', '~> 0.1'
33
- spec.add_development_dependency 'rubocop-rspec', '~> 1.39'
34
- end
data/lib/connectors.rb DELETED
@@ -1,7 +0,0 @@
1
- require "connectors/version"
2
- require "connectors/gitlab"
3
-
4
- module Connectors
5
- class Error < StandardError; end
6
- # Your code goes here...
7
- end
@@ -1,3 +0,0 @@
1
- module Connectors
2
- VERSION = "0.1.4"
3
- end