codin_rep 0.2.1 → 0.2.2

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: 48a2bc0529098c8c06bbb4b8959a6c533bb5dfd6
4
- data.tar.gz: 1ecfcdf0c4089b646d1a8ef604a9d4d790216573
3
+ metadata.gz: ca8bcc238908c94cb6072ac2dd07da8eb239b036
4
+ data.tar.gz: 67d9eb318901a55d5858b5fb1eb26ce6c3288de9
5
5
  SHA512:
6
- metadata.gz: ac79e287946ff7f999aa63eeaa5117c12ea5c01de079c63d05226de84e5d50215bf87cf1ac999057a7298eac6a1175ddac1ddead25b840711b9819b9a3b167a6
7
- data.tar.gz: 873604b80da782cfc07a813d0a1e40e65444ad480c6a9242d5478482791bcd4460f696eabacc29428b7c735a7a00356312f2e6ee43e4bf886bd2951951c2a6fc
6
+ metadata.gz: 4406ffd4e52aec4acf0071113fb091ef02dd4ed850ec7c16ecacb939b2312116a148d4dfb7671dfce424145ee1bb33eec99a3ae1cf6ede6fe700ab81edf6a099
7
+ data.tar.gz: acd795ad46ccd5c304ce5847bec91553eb0599ee4c746b990a839451578122a1095738e08f9c51873acb8fef070edcbc7b32f02db8d9c30280b74983aa2893b2
@@ -57,6 +57,9 @@ module CodinRep
57
57
  @sent_registration = true
58
58
  @command_data = self.class::REGISTRATION_COMPLETED_HEADER
59
59
  @response = communicate!
60
+ # The REP requires some time to process the employee commands, so there's
61
+ # this artificial sleep here to do it.
62
+ sleep 0.1
60
63
  return get_data_from_response_payload
61
64
  rescue
62
65
  @communication.close
@@ -70,8 +73,9 @@ module CodinRep
70
73
  end
71
74
 
72
75
  def check_response_header
73
- unless @response.match(/^#{self.class::EXPECTED_HEADER}/)
74
- raise UnknownHeader.new @response[0..6], 'get time', self.class::EXPECTED_HEADER
76
+ expected_header = self.class::EXPECTED_HEADER
77
+ unless @response.match(/^#{expected_header}/)
78
+ raise UnknownHeader.new @response[0..expected_header.size], 'set employee', expected_header
75
79
  end
76
80
  end
77
81
 
@@ -19,5 +19,5 @@
19
19
  # e-mail: contato@ossystems.com.br
20
20
 
21
21
  module CodinRep
22
- VERSION = "0.2.1".freeze
22
+ VERSION = "0.2.2".freeze
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codin_rep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - O.S. Systems Softwares Ltda.