extface 0.5.4b → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/extface/handler_controller.rb +1 -1
- data/app/models/extface/device.rb +1 -1
- data/app/models/extface/driver/daisy_fx1200.rb +0 -10
- data/app/models/extface/job.rb +1 -21
- data/lib/extface/version.rb +1 -1
- metadata +4 -5
- data/db/migrate/20160103154233_add_started_at_to_extface_job.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e38a56544aa3e63a2f350e9563a096503210917
|
4
|
+
data.tar.gz: d4141b8ee75bfa6df67ece1bd4142b56b60ee107
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55fd769863f13a406a3b8c06959cbffd6d56babba58507f24707e999d02f7fad28a86281e7579f0a8bfc8b30a000e2e0438ce7d3cf9516681e8c3c62734af763
|
7
|
+
data.tar.gz: 6611ab60b423dc14c3d1ee54ade77bd80d5dea009479b69f7b0e739b0bc188b5f894e6bb56ade5153aea477ad5dedacfd455490abd7675d702ccda9ff5dbf7b6
|
@@ -34,7 +34,7 @@ module Extface
|
|
34
34
|
r.append device.uuid, request.body.read
|
35
35
|
@full_buffer = r.get device.uuid
|
36
36
|
end
|
37
|
-
while @full_buffer.
|
37
|
+
while @full_buffer.b.present? && bytes_porcessed = device.driver.pre_handle(@full_buffer.b) #handle more than one valid packet in the buffer
|
38
38
|
Extface.redis_block do |r|
|
39
39
|
r.set device.uuid, @full_buffer.b[bytes_porcessed..-1]
|
40
40
|
@full_buffer = r.get device.uuid
|
@@ -32,7 +32,7 @@ module Extface
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def session(description = nil)
|
35
|
-
job = jobs.create!(description: description
|
35
|
+
job = jobs.create!(description: description)
|
36
36
|
job.thread = Thread.new do
|
37
37
|
Thread.current[:extface_job] = job.id
|
38
38
|
ActiveRecord::Base.establish_connection unless ActiveRecord::Base.connection.active?
|
@@ -150,16 +150,6 @@ module Extface
|
|
150
150
|
fsend(Sales::TOTAL, "\t")
|
151
151
|
end
|
152
152
|
|
153
|
-
def payed_recv_account(value = 0.00, payment_type_num = 0)
|
154
|
-
raise "Incorrect Amount Value" if value.zero?
|
155
|
-
device.session("Payed Out / Received on Account (#{value.to_s})") do |s|
|
156
|
-
s.notify "Payed / Received Start"
|
157
|
-
fsend Other::ADD_SUB_SUMS, "" << ("%.2f" % value)
|
158
|
-
status = get_printer_status
|
159
|
-
s.notify "Payed / Received End"
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
153
|
#basket
|
164
154
|
def sale_and_pay_items_session(items = [], operator = "1", password = "1")
|
165
155
|
device.session("Fiscal Doc") do |s|
|
data/app/models/extface/job.rb
CHANGED
@@ -4,30 +4,10 @@ module Extface
|
|
4
4
|
|
5
5
|
belongs_to :device, inverse_of: :jobs
|
6
6
|
|
7
|
-
scope :active, ->{ where(arel_table[:completed_at].eq(nil).and(arel_table[:failed_at].eq(nil))
|
7
|
+
scope :active, ->{ where(arel_table[:completed_at].eq(nil).and(arel_table[:failed_at].eq(nil))) }
|
8
8
|
scope :completed, ->{ where(arel_table[:completed_at].not_eq(nil)) }
|
9
9
|
scope :failed, ->{ where(arel_table[:failed_at].not_eq(nil)) }
|
10
10
|
|
11
|
-
def runtime(description = nil)
|
12
|
-
update!(description: description, started_at: Time.now)
|
13
|
-
begin
|
14
|
-
raise 'No device assigned' unless device.present?
|
15
|
-
raise 'No driver configured' unless device.driver.present?
|
16
|
-
if device.driver.set_job(self)
|
17
|
-
yield device.driver
|
18
|
-
complete!
|
19
|
-
else
|
20
|
-
raise device.driver.errors.full_messages.join(', ')
|
21
|
-
end
|
22
|
-
rescue => e
|
23
|
-
STDERR.puts e.message
|
24
|
-
e.backtrace.each do |line|
|
25
|
-
p line
|
26
|
-
end
|
27
|
-
failed! e.message
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
11
|
def complete!
|
32
12
|
self.completed_at = Time.now
|
33
13
|
save!
|
data/lib/extface/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Vangelov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -145,7 +145,6 @@ files:
|
|
145
145
|
- db/migrate/20140303112124_create_extface_drivers.rb
|
146
146
|
- db/migrate/20140303122506_change_driver_polymorphic_to_belongs_to_extface_devices.rb
|
147
147
|
- db/migrate/20140303123022_change_polymorphic_to_has_one_to_extface_serial_configs.rb
|
148
|
-
- db/migrate/20160103154233_add_started_at_to_extface_job.rb
|
149
148
|
- lib/extface.rb
|
150
149
|
- lib/extface/engine.rb
|
151
150
|
- lib/extface/extfaceable.rb
|
@@ -252,9 +251,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
252
251
|
version: '0'
|
253
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
254
253
|
requirements:
|
255
|
-
- - "
|
254
|
+
- - ">="
|
256
255
|
- !ruby/object:Gem::Version
|
257
|
-
version:
|
256
|
+
version: '0'
|
258
257
|
requirements: []
|
259
258
|
rubyforge_project:
|
260
259
|
rubygems_version: 2.5.0
|