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 +4 -4
- data/lib/codin_rep/employee_command.rb +6 -2
- data/lib/codin_rep/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca8bcc238908c94cb6072ac2dd07da8eb239b036
|
4
|
+
data.tar.gz: 67d9eb318901a55d5858b5fb1eb26ce6c3288de9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
74
|
-
|
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
|
|
data/lib/codin_rep/version.rb
CHANGED