codin_rep 0.2.5 → 0.2.6

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: 7c9f3418155f32d80856fba1e7d48e34fe2be564
4
- data.tar.gz: 0b87396b281947a2802ccff673519448c49e6dd6
3
+ metadata.gz: a9a858df51f9c22b4f8d78a85b5139c0c0e377e0
4
+ data.tar.gz: 8b4e7d2b3bfb1b5b6312b5fc5fdd48b1d3477dd3
5
5
  SHA512:
6
- metadata.gz: 35aba4cf008f1a1c7a3d98b152ccf3ad5cc2992cfd1b9d038c127bae5e796d2f22ae7b5d94829cf355540b1582aa233c283db58548c3e4ec20a8aea93ecb9351
7
- data.tar.gz: 07009f0115db677d397d0b59c82db123fd36503a373d91e943f1b594a3606db60c6f299a7ff553529a6c75ce5ee15c32e9bddacecd7a0284a6bbd474e466eeb5
6
+ metadata.gz: ce50848c522f358d88d7bea13422e13058855c45c485755b7f44c707a3e0370de92addb2b15cadcf9df83178f600c8c1e18f72778f5497771592b4d0d45e9f52
7
+ data.tar.gz: ec5e5ff4662311669a27d077d1135c3e227cbce1e6214c619b7fc62f8dc35cc2eb38802b56743a8ec45ff912642ce12a6af99dfc6038194e86be8af7ff97fbf7
@@ -33,7 +33,7 @@ module CodinRep
33
33
  end
34
34
  end
35
35
 
36
- START_COMMAND = "PGREP0289".freeze
36
+ START_COMMAND = "PGREP02890".freeze
37
37
  NEXT_RECORD_COMMAND = "PGREP009,".freeze
38
38
  START_HEADER = 'REP0029['.freeze
39
39
  END_HEADER = 'REP0029]'.freeze
@@ -115,11 +115,17 @@ module CodinRep
115
115
  response = 'REP2359' + @data.afd.header.export + "\r\n"
116
116
  @keep_connected = false
117
117
  when "PGREP0289"
118
- @afd_read_start_id = read_from_socket_with_timeout(socket, 9).to_i
119
- @afd_read_end_id = read_from_socket_with_timeout(socket, 9).to_i
120
- @afd_read_current_id = nil
121
- @afd_read_finished = false
122
- response = "REP0029["
118
+ byte = read_from_socket_with_timeout(socket, 1)
119
+ if byte == "0"
120
+ @afd_read_start_id = read_from_socket_with_timeout(socket, 9).to_i
121
+ @afd_read_end_id = read_from_socket_with_timeout(socket, 9).to_i
122
+ @afd_read_current_id = nil
123
+ @afd_read_finished = false
124
+ response = "REP0029["
125
+ else
126
+ raw_command += byte
127
+ raise StandardError.new("Unknown command \"#{raw_command}\"!")
128
+ end
123
129
  when "PGREP009,"
124
130
  if @afd_read_finished
125
131
  response = "REP0029]"
@@ -19,5 +19,5 @@
19
19
  # e-mail: contato@ossystems.com.br
20
20
 
21
21
  module CodinRep
22
- VERSION = "0.2.5".freeze
22
+ VERSION = "0.2.6".freeze
23
23
  end