gts 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/gts/server.rb +5 -0
  2. data/lib/gts/version.rb +1 -1
  3. metadata +1 -1
data/lib/gts/server.rb CHANGED
@@ -2,6 +2,7 @@ require 'eventmachine'
2
2
  require 'open-uri'
3
3
  require 'json'
4
4
  require 'gts'
5
+ require 'iconv'
5
6
 
6
7
  DEFAULT_IMEI_HANDLERS = { "359585017718724" => "TK-102" } # IMEI nasej TK-102jky
7
8
  DEFAULT_IMEI_HANDLER_SOURCE = nil
@@ -92,6 +93,10 @@ module Gts
92
93
 
93
94
  def handle_tracker_data(data)
94
95
  begin
96
+ # Cleaning the input string
97
+ ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
98
+ data = ic.iconv(data + ' ')[0..-2]
99
+
95
100
  parsed_data = parse_data(data)
96
101
  logger.info "Got correct data [from #{client_ip_address}, imei: #{parsed_data[:imei]}]"
97
102
  formatted_data = parsed_data.map{|k,v| "\t#{k}: #{v}\n" }.join
data/lib/gts/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gts
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: