bamboozled-gitlab 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bamboozled.gemspec +3 -3
- data/lib/bamboozled/api/employee.rb +12 -0
- data/lib/bamboozled/api/meta.rb +3 -1
- data/lib/bamboozled/version.rb +1 -1
- data/spec/fixtures/meta_time_off_types.json +5 -0
- data/spec/fixtures/time_off_balance_adjustment.json +4 -0
- data/spec/lib/bamboozled/api/employee_spec.rb +15 -0
- data/spec/lib/bamboozled/api/meta_spec.rb +8 -0
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bb824cff5b90ba6e27dba753824572e334f507dd0e1e576de477d43fde9eed4
|
4
|
+
data.tar.gz: 3cc9d10446f2b8ff1cc9841e0181e79f309b6094ff458cc1a7c897a803bc7474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36985162f4df37beb37760054b408365d3bd02ea93244c2062aaadbfc2f7606c3c8f3ce79ea484ddda52c28f43196fadf5061f0cd0f4424455c99661189905fd
|
7
|
+
data.tar.gz: 50a32b7285feceb4a1091272c2b559e1cecb13330228e337fc2c71b91ba04cfb84fe0f809b38da2b6c024977e9797695ad694b6e78e690e34b36933e537dbb2f
|
data/bamboozled.gemspec
CHANGED
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require "bamboozled/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'bamboozled-gitlab'
|
8
8
|
spec.version = Bamboozled::VERSION
|
9
|
-
spec.authors = ["Mark Rickert"]
|
10
|
-
spec.email = ["mjar81@gmail.com"]
|
9
|
+
spec.authors = ["Mark Rickert", "Lien Van Den Steen"]
|
10
|
+
spec.email = ["mjar81@gmail.com", 'lvandensteen@gitlab.com']
|
11
11
|
spec.summary = "A Ruby wrapper for the BambooHR API http://www.bamboohr.com/"
|
12
12
|
spec.description = "Bamboozled wraps the BambooHR API without the use of Rails dependencies."
|
13
13
|
spec.homepage = "http://github.com/Skookum/bamboozled"
|
@@ -59,6 +59,18 @@ module Bamboozled
|
|
59
59
|
request(:get, "employees/#{employee_id}/time_off/calculator?end=#{end_date}")
|
60
60
|
end
|
61
61
|
|
62
|
+
def time_off_balance_adjustment(employee_id, params)
|
63
|
+
allowed_parameters = %i[date timeOffTypeId amount note]
|
64
|
+
params = params.keep_if { |k, _| allowed_parameters.include? k }
|
65
|
+
|
66
|
+
options = {
|
67
|
+
body: params.to_json,
|
68
|
+
headers: { 'Content-Type' => 'application/json' }
|
69
|
+
}
|
70
|
+
|
71
|
+
request(:put, "employees/#{employee_id}/time_off/balance_adjustment", options)
|
72
|
+
end
|
73
|
+
|
62
74
|
def photo_binary(employee_id)
|
63
75
|
request(:get, "employees/#{employee_id}/photo/small")
|
64
76
|
end
|
data/lib/bamboozled/api/meta.rb
CHANGED
data/lib/bamboozled/version.rb
CHANGED
@@ -0,0 +1,5 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
content-type: application/json; charset=utf-8
|
3
|
+
date: Tue, 17 Jun 2014 19:25:35 UTC
|
4
|
+
|
5
|
+
{"timeOffTypes":[{"id":"2","name":"Employee Accruals","units":"days","color":"company","icon":null}],"defaultHours":[{"name":"Saturday","amount":"0"},{"name":"Sunday","amount":"0"},{"name":"default","amount":"8"},{"name":"Monday","amount":"8"},{"name":"Tuesday","amount":"8"},{"name":"Wednesday","amount":"8"},{"name":"Thursday","amount":"8"},{"name":"Friday","amount":"8"}]}
|
@@ -66,6 +66,21 @@ RSpec.describe "Employees" do
|
|
66
66
|
.to match_array %w(timeOffType name units balance)
|
67
67
|
end
|
68
68
|
|
69
|
+
it "Adjusts an employee's time off balance" do
|
70
|
+
response = File.new("spec/fixtures/time_off_balance_adjustment.json")
|
71
|
+
stub_request(:any, /.*api\.bamboohr\.com.*/).to_return(response)
|
72
|
+
|
73
|
+
options = {
|
74
|
+
date: '2014-06-17',
|
75
|
+
timeOffTypeId: 2,
|
76
|
+
amount: -1.5,
|
77
|
+
note: 'test'
|
78
|
+
}
|
79
|
+
|
80
|
+
result = @client.employee.time_off_balance_adjustment('44259', options)
|
81
|
+
expect(result).to be_a Hash
|
82
|
+
end
|
83
|
+
|
69
84
|
it "returns the proper url using employee email address" do
|
70
85
|
hashed = "4fdce145bab6d27d69e34403f99fd11c" # Hash of me@here.com
|
71
86
|
required_url = "http://x.bamboohr.com/employees/photos/?h=#{hashed}"
|
@@ -44,4 +44,12 @@ RSpec.describe "Meta" do
|
|
44
44
|
fields = @client.meta.lists
|
45
45
|
expect(fields).to be_a Array
|
46
46
|
end
|
47
|
+
|
48
|
+
it "Gets time off types" do
|
49
|
+
res = get_response("spec/fixtures/meta_time_off_types.json")
|
50
|
+
make_stub(res)
|
51
|
+
|
52
|
+
types = @client.meta.time_off_types
|
53
|
+
expect(types).to be_a Hash
|
54
|
+
end
|
47
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bamboozled-gitlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickert
|
8
|
-
|
8
|
+
- Lien Van Den Steen
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2021-
|
12
|
+
date: 2021-05-25 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -97,6 +98,7 @@ dependencies:
|
|
97
98
|
description: Bamboozled wraps the BambooHR API without the use of Rails dependencies.
|
98
99
|
email:
|
99
100
|
- mjar81@gmail.com
|
101
|
+
- lvandensteen@gitlab.com
|
100
102
|
executables: []
|
101
103
|
extensions: []
|
102
104
|
extra_rdoc_files: []
|
@@ -149,8 +151,10 @@ files:
|
|
149
151
|
- spec/fixtures/meta_fields.json
|
150
152
|
- spec/fixtures/meta_lists.json
|
151
153
|
- spec/fixtures/meta_tables.json
|
154
|
+
- spec/fixtures/meta_time_off_types.json
|
152
155
|
- spec/fixtures/meta_users.json
|
153
156
|
- spec/fixtures/one_employee.json
|
157
|
+
- spec/fixtures/time_off_balance_adjustment.json
|
154
158
|
- spec/fixtures/time_off_estimate.json
|
155
159
|
- spec/fixtures/time_tracking_add_200_response.json
|
156
160
|
- spec/fixtures/time_tracking_add_empty_response.json
|
@@ -178,7 +182,7 @@ homepage: http://github.com/Skookum/bamboozled
|
|
178
182
|
licenses:
|
179
183
|
- MIT
|
180
184
|
metadata: {}
|
181
|
-
post_install_message:
|
185
|
+
post_install_message:
|
182
186
|
rdoc_options: []
|
183
187
|
require_paths:
|
184
188
|
- lib
|
@@ -193,8 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
197
|
- !ruby/object:Gem::Version
|
194
198
|
version: '0'
|
195
199
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
197
|
-
signing_key:
|
200
|
+
rubygems_version: 3.2.3
|
201
|
+
signing_key:
|
198
202
|
specification_version: 4
|
199
203
|
summary: A Ruby wrapper for the BambooHR API http://www.bamboohr.com/
|
200
204
|
test_files:
|
@@ -210,8 +214,10 @@ test_files:
|
|
210
214
|
- spec/fixtures/meta_fields.json
|
211
215
|
- spec/fixtures/meta_lists.json
|
212
216
|
- spec/fixtures/meta_tables.json
|
217
|
+
- spec/fixtures/meta_time_off_types.json
|
213
218
|
- spec/fixtures/meta_users.json
|
214
219
|
- spec/fixtures/one_employee.json
|
220
|
+
- spec/fixtures/time_off_balance_adjustment.json
|
215
221
|
- spec/fixtures/time_off_estimate.json
|
216
222
|
- spec/fixtures/time_tracking_add_200_response.json
|
217
223
|
- spec/fixtures/time_tracking_add_empty_response.json
|