codin_rep 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codin_rep.rb +2 -1
- data/lib/codin_rep/employee_command.rb +1 -1
- data/lib/codin_rep/version.rb +1 -1
- data/test/unit/set_time_test.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c9f3418155f32d80856fba1e7d48e34fe2be564
|
4
|
+
data.tar.gz: 0b87396b281947a2802ccff673519448c49e6dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35aba4cf008f1a1c7a3d98b152ccf3ad5cc2992cfd1b9d038c127bae5e796d2f22ae7b5d94829cf355540b1582aa233c283db58548c3e4ec20a8aea93ecb9351
|
7
|
+
data.tar.gz: 07009f0115db677d397d0b59c82db123fd36503a373d91e943f1b594a3606db60c6f299a7ff553529a6c75ce5ee15c32e9bddacecd7a0284a6bbd474e466eeb5
|
data/lib/codin_rep.rb
CHANGED
@@ -40,7 +40,8 @@ module CodinRep
|
|
40
40
|
return response
|
41
41
|
end
|
42
42
|
|
43
|
-
|
43
|
+
# the DST parameters are just placeholders, for now.
|
44
|
+
def set_time(time, dst_start=nil, dst_end=nil)
|
44
45
|
command = CodinRep::SetTime.new(time, self.ip, self.tcp_port)
|
45
46
|
response = command.execute
|
46
47
|
return response
|
@@ -59,7 +59,7 @@ module CodinRep
|
|
59
59
|
@response = communicate!
|
60
60
|
# The REP requires some time to process the employee commands, so there's
|
61
61
|
# this artificial sleep here to do it.
|
62
|
-
sleep 0.
|
62
|
+
sleep 0.5
|
63
63
|
return get_data_from_response_payload
|
64
64
|
rescue
|
65
65
|
@communication.close
|
data/lib/codin_rep/version.rb
CHANGED
data/test/unit/set_time_test.rb
CHANGED
@@ -39,4 +39,16 @@ class SetTimeTest < Minitest::Test
|
|
39
39
|
@mock_time_clock.set_time(new_time)
|
40
40
|
assert_equal @mock_time_clock.data.time, new_time
|
41
41
|
end
|
42
|
+
|
43
|
+
def test_set_time_with_dst_params
|
44
|
+
time = Time.new(2016,12,14,10,28,10)
|
45
|
+
@mock_time_clock.data.time = time
|
46
|
+
# The REP doesn't have a millisecond resolution, so round it to the closest
|
47
|
+
# second.
|
48
|
+
new_time = Time.now.round
|
49
|
+
dst_start = Date.civil(2016,10,16)
|
50
|
+
dst_end = Date.civil(2017,2,19)
|
51
|
+
@mock_time_clock.set_time(new_time, dst_start, dst_end)
|
52
|
+
assert_equal @mock_time_clock.data.time, new_time
|
53
|
+
end
|
42
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codin_rep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- O.S. Systems Softwares Ltda.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01
|
11
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Use this gem to manage several features of the Telebyte eletronic timeclocks,
|
14
14
|
like report creation, user management, configuration etc.
|