smartware 0.2.8 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,21 +8,24 @@ module Smartware
8
8
  end
9
9
 
10
10
  def start
11
- @interfaces = @config["interfaces"].map do |config|
12
- interface = Smartware::Interface.const_get(config['name']).new config
11
+ EventMachine.epoll
12
+ EventMachine.run do
13
+ @interfaces = @config["interfaces"].map do |config|
14
+ interface = Smartware::Interface.const_get(config['name']).new config
13
15
 
14
- DRb::DRbServer.new config["uri"], interface
15
- end
16
+ DRb::DRbServer.new config["uri"], interface
17
+ end
16
18
 
17
- unless @config["connection_timeout"].nil?
18
- Thread.new do
19
- begin
20
- monitor = ConnectionMonitor.new @config["connection_timeout"].to_i
19
+ unless @config["connection_timeout"].nil?
20
+ Thread.new do
21
+ begin
22
+ monitor = ConnectionMonitor.new @config["connection_timeout"].to_i
21
23
 
22
- monitor.run
23
- rescue => e
24
- Smartware::Logging.logger.error "Exception in connection monitor thread: #{e}"
25
- e.backtrace.each { |line| Smartware::Logging.logger.error line }
24
+ monitor.run
25
+ rescue => e
26
+ Smartware::Logging.logger.error "Exception in connection monitor thread: #{e}"
27
+ e.backtrace.each { |line| Smartware::Logging.logger.error line }
28
+ end
26
29
  end
27
30
  end
28
31
  end
@@ -31,6 +34,8 @@ module Smartware
31
34
 
32
35
  def stop
33
36
  @interfaces.each &:stop_service
37
+
38
+ EventMachine.stop_event_loop
34
39
  end
35
40
 
36
41
  def join
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.2.8"
2
+ VERSION = "0.3"
3
3
  end
data/smartware.gemspec CHANGED
@@ -24,4 +24,5 @@ Gem::Specification.new do |gem|
24
24
  gem.add_dependency 'activesupport'
25
25
  gem.add_dependency 'redcarpet'
26
26
  gem.add_dependency 'digest-crc'
27
+ gem.add_dependency 'eventmachine'
27
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-24 00:00:00.000000000 Z
13
+ date: 2013-01-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: smartkiosk-common
@@ -124,6 +124,22 @@ dependencies:
124
124
  - - ! '>='
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: eventmachine
129
+ requirement: !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ! '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ type: :runtime
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
127
143
  description: Smartware is the Smartkiosk hardware control daemon
128
144
  email:
129
145
  - e.sudarchikov@roundlake.ru
@@ -153,6 +169,9 @@ files:
153
169
  - lib/smartware/drivers/card_reader/ict3_k5.rb
154
170
  - lib/smartware/drivers/cash_acceptor/ccnet.rb
155
171
  - lib/smartware/drivers/cash_acceptor/dummy.rb
172
+ - lib/smartware/drivers/common/ccnet_connection.rb
173
+ - lib/smartware/drivers/common/command_based_device.rb
174
+ - lib/smartware/drivers/common/sankyo_connection.rb
156
175
  - lib/smartware/drivers/modem/dummy.rb
157
176
  - lib/smartware/drivers/modem/standard.rb
158
177
  - lib/smartware/drivers/printer/dummy.rb