gatekeeper_api_client 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65e869bd0a2bfb5cf92ec2e1d4b764071a2db51a0f08caf8dd31e7a2067422be
4
- data.tar.gz: 68ee3560c9889bd1a3e6b7a8a7b7e948bed867cba018c7a90926a67d524aeb89
3
+ metadata.gz: 1d9b20bd2b992c579069eb699d9d7c40a83799c9739e912e9f43055a78c0e67a
4
+ data.tar.gz: 2ddf2106753c80d179f485272410975df40b902b6cd2bf75a78a47f2c9c9fb0c
5
5
  SHA512:
6
- metadata.gz: 69a9100e00f1d01629e26d28811cf615a50a6844ae6960e849b5e1697f70475999ab557ab148720a917f856d1b465ee7fb3e9a0a59a96d708dd57541682d65c4
7
- data.tar.gz: 4e82ca605d06a7388967443af674984a588c6c15f12adf2a4d4da89455e73538d79d3dfb69d328921b0db61e0e145a8231fda35c05b6a582a0b7ad2e2f715984
6
+ metadata.gz: 2816c70a73798ce585ce70de29f7ad31f069f8a6eaccbef60a1183d0eff2693834a9e3aa085efeee772bbabe21c85d4a2d6a240194292c65428e104f653b1167
7
+ data.tar.gz: 909b70b4b0ba0551ca8c39aae6e941ab8b3ba5405e392ba56876772d8b1b7deda780ecd189dde1d2505c17d0fc15125adc338c68ca0772a85dde7775cb8f96b2
@@ -11,7 +11,6 @@ jobs:
11
11
  build:
12
12
  # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
13
13
  runs-on: ubuntu-22.04
14
- if: "! contains(github.event.head_commit.message, 'skip ci')"
15
14
 
16
15
  steps:
17
16
  - uses: actions/checkout@v3
data/GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.1.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gatekeeper_api_client (1.0.1)
4
+ gatekeeper_api_client (1.1.0)
5
5
  rollbar (~> 3.6)
6
6
  tzinfo (~> 2.0)
7
7
  tzinfo-data (~> 1.2025)
data/README.md CHANGED
@@ -3,17 +3,13 @@ Common logic for consuming the GateKeeper API.
3
3
 
4
4
  ## Installation
5
5
  Add this line to your application's Gemfile:
6
- ```
7
- source "https://rubygems.pkg.github.com/inforlife" do
8
- gem "gatekeeper_api_client", "1.0.0"
9
- end
6
+ ```gem "gatekeeper_api_client", "1.1.0"
10
7
  ```
11
8
 
12
9
  ## Usage
13
- The application using this gem must have defined the following environemnt variables:
14
- - `GATEKEEPER_API_KEY`
15
- - `GATEKEEPER_TIMEZONE`
16
- - `GATEKEEPER_URL`
10
+ The application using this gem must have defined the following environment variables:
11
+ - `GATEKEEPER_API_KEY`: The authentication key.
12
+ - `GATEKEEPER_URL`: The URL to post data.
17
13
 
18
14
  ### Transit
19
15
  To post a `transit`, build an object with a record and send the `post` message to it.
@@ -23,12 +19,11 @@ Transit.new(record).post
23
19
  ```
24
20
 
25
21
  The record must respond to:
26
- - `authorized`
27
- - `badge_number`
28
- - `date`
29
- - `sensor_code`
30
- - `time`
31
- - `valid?`
22
+ - `authorized` returns a string.
23
+ - `badge_number` returns a string.
24
+ - `sensor_code` returns a string.
25
+ - `time` returns a Time (with Timezone) object.
26
+ - `valid?` returns a boolean,
32
27
 
33
28
  ### Employee
34
29
  To post an `employee`, build an object with a record and send the `post` message to it.
@@ -38,7 +33,7 @@ Employee.new(record).post
38
33
  ```
39
34
 
40
35
  The record must respond to:
41
- - `employee_name`
42
- - `badge_number`
43
- - `department_name`
44
- - `valid?`
36
+ - `employee_name` returns a string.
37
+ - `badge_number` returns a string.
38
+ - `department_name` returns a string.
39
+ - `valid?` returns a boolean.
@@ -6,7 +6,7 @@ class Transit < Resource
6
6
  def to_json
7
7
  {"transit":
8
8
  {
9
- "occurred_at": UtcTime.parse(@record.date, @record.time),
9
+ "occurred_at": @record.time.utc,
10
10
  "badge_number": @record.badge_number,
11
11
  "sensor_code": @record.sensor_code,
12
12
  "authorized": @record.authorized == "1"
@@ -7,7 +7,6 @@ require "gatekeeper_api_client/client_error"
7
7
  require "gatekeeper_api_client/error_handler"
8
8
  require "gatekeeper_api_client/gateway"
9
9
  require "gatekeeper_api_client/retrying_gateway"
10
- require "gatekeeper_api_client/utc_time"
11
10
 
12
11
  require "gatekeeper_api_client/resources/resource"
13
12
  require "gatekeeper_api_client/resources/employee"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatekeeper_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sigfrid Dusci
@@ -119,7 +119,6 @@ files:
119
119
  - lib/gatekeeper_api_client/resources/resource.rb
120
120
  - lib/gatekeeper_api_client/resources/transit.rb
121
121
  - lib/gatekeeper_api_client/retrying_gateway.rb
122
- - lib/gatekeeper_api_client/utc_time.rb
123
122
  homepage: https://github.com/inforlife/gatekeeper-api-client
124
123
  licenses:
125
124
  - MIT
@@ -1,12 +0,0 @@
1
- class UtcTime
2
- def self.parse(record_date, record_time)
3
- date = record_date.tr('.', '-')
4
- time = record_time.tr('.', ':')
5
-
6
- timezone.local_to_utc(Time.parse([date, time].join(" ")))
7
- end
8
-
9
- def self.timezone
10
- TZInfo::Timezone.get(ENV["GATEKEEPER_TIMEZONE"])
11
- end
12
- end