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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11080736d9e5f81dc9c79316644cbef599af319b
4
- data.tar.gz: 4fec1f14792f50cfd14f97bde76ec66133c6ff1d
3
+ metadata.gz: 7c9f3418155f32d80856fba1e7d48e34fe2be564
4
+ data.tar.gz: 0b87396b281947a2802ccff673519448c49e6dd6
5
5
  SHA512:
6
- metadata.gz: 043802d0598cf57818551e39f8b235f91198a1f5198a22fb030d926a9b0f4b9184cd71df707fa13d00dcfd8d6cfb06bda2496fda58d004e0fd59cd403aec93df
7
- data.tar.gz: b071cb5f490f7b6feee737642fb36bee4cb3be32c2921215cc81fa3f8564ae5ff0b0ec241f3336d70d936cf10e5616c33bd749b928d10b865cc99f5277fd675c
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
- def set_time(time)
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.1
62
+ sleep 0.5
63
63
  return get_data_from_response_payload
64
64
  rescue
65
65
  @communication.close
@@ -19,5 +19,5 @@
19
19
  # e-mail: contato@ossystems.com.br
20
20
 
21
21
  module CodinRep
22
- VERSION = "0.2.4".freeze
22
+ VERSION = "0.2.5".freeze
23
23
  end
@@ -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
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-31 00:00:00.000000000 Z
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.