bobhr 0.1.1 → 0.3.1

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: e749360430dece90bd974b8089dcab5df02e67c6bacb2d6357d233fbc7f32bad
4
- data.tar.gz: a92067aaa2464ce1687bf8291920af2887106a2d3bce4da4fb5f393bbac8bfdf
3
+ metadata.gz: c3504b4eefff6d8cc05ed3c3923eeefc330f288b8f9d32e0ff8f2691766134a0
4
+ data.tar.gz: b1ebbf91032ca22200fe91a8938b8023b5074eb22a2965b5fa16031732e3b14a
5
5
  SHA512:
6
- metadata.gz: 6f821ab2f568e5ebc2850b83d3523cbcb85c738045b689c8ec7963aee8b5a002e7d55cadc619f4bc6ad9bc53c934ece7780adcc1141f56aa32aa083584f7bfff
7
- data.tar.gz: 5b539cc092cb32b00f728e2a02531da12b50a554aee9f14427e726a351e362da35d30072eacb175edd5cb10de3f6e103986e5f7fbf5fcc400a84cc2d980500cc
6
+ metadata.gz: 8794c075badea60efabde4eadb578211606dbc9157cb76119707fd60d702b103f21015ce2b5b6cb40acccb5431c19d0058af8b56e4da419c6b3b32616c90e270
7
+ data.tar.gz: bb3abb4bfeb5c65cfc0a825efa9768575d31a95bf1e220f704b6add3e7c12b7acbb2ecd9b6e0688c2d80bbb7b456f0df4ce81c03b917e358cc796e4cd1af338a
data/README.md CHANGED
@@ -26,6 +26,7 @@ Create a Service User in Bob and use the ID and token to configure the client.
26
26
  Configuration example:
27
27
 
28
28
  ```ruby
29
+ require 'bob' # not needed in Rails applications
29
30
 
30
31
  Bob.configure do |config|
31
32
  config.access_token = 'your-access-token'
data/lib/bob/employees.rb CHANGED
@@ -9,13 +9,19 @@ require_relative 'employee/documents'
9
9
  module Bob
10
10
  class Employees < API
11
11
  def self.all(params = {})
12
- get('people', params)
12
+ get('people', params)['employees']
13
13
  end
14
14
 
15
15
  def self.find(employee_id_or_email)
16
16
  get("people/#{employee_id_or_email}")
17
17
  end
18
18
 
19
+ def self.find_by(field:, value:)
20
+ all.find do |employee|
21
+ employee[field] == value
22
+ end
23
+ end
24
+
19
25
  # start date needs to be in ISO format
20
26
  def self.update_start_date(employee_id, start_date)
21
27
  post("employees/#{employee_id}", { startDate: start_date })
data/lib/bob/metadata.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'metadata/company_lists'
4
+ require_relative 'metadata/company_fields'
data/lib/bob/time_off.rb CHANGED
@@ -3,11 +3,15 @@
3
3
  module Bob
4
4
  class TimeOff < API
5
5
  def self.all_changed_since(since)
6
- get('timeoff/requests/changes', { since: since })
6
+ get('timeoff/requests/changes', { since: since })['changes']
7
7
  end
8
8
 
9
9
  def self.today
10
10
  get('timeoff/outtoday')
11
11
  end
12
+
13
+ def self.find_for_employee(employee_id, request_id)
14
+ get("timeoff/employees/#{employee_id}/requests/#{request_id}")
15
+ end
12
16
  end
13
17
  end
data/lib/bob/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bob
4
- VERSION = '0.1.1'
4
+ VERSION = '0.3.1'
5
5
  end
data/lib/bobhr.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bob'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bobhr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.3.1
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-11-29 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -41,27 +41,12 @@ dependencies:
41
41
  description: Ruby gem for Bob API
42
42
  email:
43
43
  - lienvandensteen@gmail.com
44
- executables:
45
- - bob
44
+ executables: []
46
45
  extensions: []
47
46
  extra_rdoc_files: []
48
47
  files:
49
- - ".github/workflows/main.yml"
50
- - ".gitignore"
51
- - ".rspec"
52
- - ".rubocop.yml"
53
- - ".rubocop_todo.yml"
54
- - CHANGELOG.md
55
- - CODE_OF_CONDUCT.md
56
- - Gemfile
57
- - Gemfile.lock
58
48
  - LICENSE.txt
59
49
  - README.md
60
- - Rakefile
61
- - bin/console
62
- - bin/setup
63
- - bob.gemspec
64
- - exe/bob
65
50
  - lib/bob.rb
66
51
  - lib/bob/api.rb
67
52
  - lib/bob/configuration.rb
@@ -78,7 +63,8 @@ files:
78
63
  - lib/bob/onboarding_wizards.rb
79
64
  - lib/bob/time_off.rb
80
65
  - lib/bob/version.rb
81
- homepage: https://github.com/lienvdsteen/bob
66
+ - lib/bobhr.rb
67
+ homepage: https://github.com/lienvdsteen/hibob
82
68
  licenses:
83
69
  - MIT
84
70
  metadata:
@@ -1,16 +0,0 @@
1
- name: Ruby
2
-
3
- on: [push,pull_request]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v2
10
- - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
12
- with:
13
- ruby-version: 3.0.2
14
- bundler-cache: true
15
- - name: Run the default task
16
- run: bundle exec rake
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/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,22 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require:
4
- - rubocop-rspec
5
- - rubocop-rake
6
-
7
- AllCops:
8
- TargetRubyVersion: 3.0
9
- NewCops: enable
10
-
11
- Style/StringLiteralsInInterpolation:
12
- Enabled: true
13
- EnforcedStyle: double_quotes
14
-
15
- Layout/LineLength:
16
- Max: 120
17
-
18
- Style/Documentation:
19
- Enabled: false
20
-
21
- Metrics/BlockLength:
22
- Max: 45
data/.rubocop_todo.yml DELETED
@@ -1,41 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-11-22 15:47:01 UTC using RuboCop version 1.23.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
- # Include: **/*.gemfile, **/Gemfile, **/gems.rb
13
- Bundler/OrderedGems:
14
- Exclude:
15
- - 'Gemfile'
16
-
17
- # Offense count: 2
18
- # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
19
- # Include: **/*_spec*rb*, **/spec/**/*
20
- RSpec/FilePath:
21
- Exclude:
22
- - 'spec/api_spec.rb'
23
- - 'spec/employees_spec.rb'
24
-
25
- # Offense count: 1
26
- RSpec/MultipleExpectations:
27
- Max: 2
28
-
29
- # Offense count: 2
30
- # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
31
- RSpec/VerifiedDoubles:
32
- Exclude:
33
- - 'spec/api_spec.rb'
34
- - 'spec/employees_spec.rb'
35
-
36
- # Offense count: 1
37
- # Configuration parameters: AllowedMethods.
38
- # AllowedMethods: respond_to_missing?
39
- Style/OptionalBooleanParameter:
40
- Exclude:
41
- - 'bin/console'
data/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2021-11-16
4
-
5
- - Initial release
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in bob.gemspec
6
- gemspec
7
-
8
- gem 'rake', '~> 13.0'
9
-
10
- gem 'rspec', '~> 3.0'
11
-
12
- gem 'rubocop', '~> 1.7'
13
- gem 'rubocop-rspec', require: false
14
- gem 'rubocop-rake', require: false
data/Gemfile.lock DELETED
@@ -1,81 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- bobhr (0.1.1)
5
- json
6
- rest-client (~> 2.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.2)
12
- diff-lcs (1.4.4)
13
- domain_name (0.5.20190701)
14
- unf (>= 0.0.5, < 1.0.0)
15
- http-accept (1.7.0)
16
- http-cookie (1.0.4)
17
- domain_name (~> 0.5)
18
- json (2.6.1)
19
- mime-types (3.4.1)
20
- mime-types-data (~> 3.2015)
21
- mime-types-data (3.2021.1115)
22
- netrc (0.11.0)
23
- parallel (1.21.0)
24
- parser (3.0.2.0)
25
- ast (~> 2.4.1)
26
- rainbow (3.0.0)
27
- rake (13.0.6)
28
- regexp_parser (2.1.1)
29
- rest-client (2.1.0)
30
- http-accept (>= 1.7.0, < 2.0)
31
- http-cookie (>= 1.0.2, < 2.0)
32
- mime-types (>= 1.16, < 4.0)
33
- netrc (~> 0.8)
34
- rexml (3.2.5)
35
- rspec (3.10.0)
36
- rspec-core (~> 3.10.0)
37
- rspec-expectations (~> 3.10.0)
38
- rspec-mocks (~> 3.10.0)
39
- rspec-core (3.10.1)
40
- rspec-support (~> 3.10.0)
41
- rspec-expectations (3.10.1)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.10.0)
44
- rspec-mocks (3.10.2)
45
- diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.10.0)
47
- rspec-support (3.10.3)
48
- rubocop (1.23.0)
49
- parallel (~> 1.10)
50
- parser (>= 3.0.0.0)
51
- rainbow (>= 2.2.2, < 4.0)
52
- regexp_parser (>= 1.8, < 3.0)
53
- rexml
54
- rubocop-ast (>= 1.12.0, < 2.0)
55
- ruby-progressbar (~> 1.7)
56
- unicode-display_width (>= 1.4.0, < 3.0)
57
- rubocop-ast (1.13.0)
58
- parser (>= 3.0.1.1)
59
- rubocop-rake (0.6.0)
60
- rubocop (~> 1.0)
61
- rubocop-rspec (2.6.0)
62
- rubocop (~> 1.19)
63
- ruby-progressbar (1.11.0)
64
- unf (0.1.4)
65
- unf_ext
66
- unf_ext (0.0.8)
67
- unicode-display_width (2.1.0)
68
-
69
- PLATFORMS
70
- ruby
71
-
72
- DEPENDENCIES
73
- bobhr!
74
- rake (~> 13.0)
75
- rspec (~> 3.0)
76
- rubocop (~> 1.7)
77
- rubocop-rake
78
- rubocop-rspec
79
-
80
- BUNDLED WITH
81
- 2.2.31
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require 'rubocop/rake_task'
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
data/bin/console DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'bob'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
-
16
- def reload!(print = true)
17
- puts 'Reloading ...' if print
18
- # Main project directory.
19
- root_dir = File.expand_path('..', __dir__)
20
- # Directories within the project that should be reloaded.
21
- reload_dirs = %w[lib]
22
- # Loop through and reload every file in all relevant project directories.
23
- reload_dirs.each do |dir|
24
- Dir.glob("#{root_dir}/#{dir}/**/*.rb").each { |f| load(f) }
25
- end
26
- # Return true when complete.
27
- true
28
- end
29
-
30
- 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/bob.gemspec DELETED
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/bob/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'bobhr'
7
- spec.version = Bob::VERSION
8
- spec.authors = ['Lien Van Den Steen']
9
- spec.email = ['lienvandensteen@gmail.com']
10
-
11
- spec.summary = 'Ruby gem for Bob API'
12
- spec.description = 'Ruby gem for Bob API'
13
- spec.homepage = 'https://github.com/lienvdsteen/bob'
14
- spec.license = 'MIT'
15
- spec.required_ruby_version = '>= 3.0'
16
-
17
- spec.metadata['homepage_uri'] = spec.homepage
18
- spec.metadata['source_code_uri'] = 'https://github.com/lienvdsteen/bob'
19
- spec.metadata['changelog_uri'] = 'https://github.com/lienvdsteen/bob/CHANGELOG.md'
20
-
21
- # Specify which files should be added to the gem when it is released.
22
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
- end
26
- spec.bindir = 'exe'
27
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
-
30
- spec.add_runtime_dependency 'json'
31
- spec.add_runtime_dependency 'rest-client', '~> 2.0'
32
-
33
- # For more information and examples about making a new gem, checkout our
34
- # guide at: https://bundler.io/guides/creating_gem.html
35
- spec.metadata = {
36
- 'rubygems_mfa_required' => 'true'
37
- }
38
- end
data/exe/bob DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- #!/usr/bin/env ruby
3
-
4
- require "bob"