smartware 0.1.29 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/smartware +17 -21
- data/lib/smartware.rb +1 -0
- data/lib/smartware/service.rb +7 -9
- data/lib/smartware/version.rb +1 -1
- data/smartware.gemspec +1 -1
- metadata +32 -13
data/bin/smartware
CHANGED
@@ -3,28 +3,24 @@
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'bundler/setup'
|
5
5
|
require 'smartware'
|
6
|
-
require '
|
6
|
+
require 'trollop'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
opts.on('-c', '--config-file FILE', String, 'Hardware config file to use. Sample: --config-file=/path/to/smartware.yml') do |x|
|
14
|
-
options[:config] = x
|
15
|
-
end
|
8
|
+
opts = Trollop.options do
|
9
|
+
version "Smartware #{Smartware::VERSION}"
|
10
|
+
banner "Smartware - Smartkiosk hardware control service"
|
11
|
+
opt :config, "Hardware config file to use (smartware.yml, absolute path)", type: String, required: true
|
12
|
+
opt :log, "Log file to use", type: String
|
16
13
|
end
|
17
14
|
|
18
|
-
|
19
|
-
|
15
|
+
p opts[:log]
|
16
|
+
|
17
|
+
Smartware::Logging.destination = opts[:log] if opts[:log]
|
18
|
+
Smartware::Logging.init
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
exit 1
|
29
|
-
end
|
30
|
-
end
|
20
|
+
begin
|
21
|
+
Smartware::Service.start(opts[:config])
|
22
|
+
rescue => e
|
23
|
+
Smartware::Logging.logger.error e.message
|
24
|
+
Smartware::Logging.logger.error e.backtrace.join("\n")
|
25
|
+
exit 1
|
26
|
+
end
|
data/lib/smartware.rb
CHANGED
data/lib/smartware/service.rb
CHANGED
@@ -13,37 +13,35 @@ module Smartware
|
|
13
13
|
|
14
14
|
@config = YAML.load File.read(File.expand_path(config_file))
|
15
15
|
|
16
|
-
Smartware::Logging.logger = Logging.init
|
17
16
|
Smartware::Logging.logger.info "Smartware started at #{Time.now}"
|
18
17
|
|
19
|
-
|
20
18
|
@threads = %w(modem
|
21
19
|
cash_acceptor
|
22
20
|
printer
|
23
21
|
).inject([]) do |arr, iface|
|
24
22
|
arr << Thread.new do
|
25
23
|
begin
|
26
|
-
driver =
|
24
|
+
driver = Service.config["#{iface}_driver"].downcase
|
27
25
|
|
28
26
|
require "smartware/drivers/#{iface}/#{driver}"
|
29
27
|
require "smartware/interfaces/#{iface}"
|
30
28
|
rescue => e
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
Logging.logger.fatal "During startup of #{iface}:"
|
30
|
+
Logging.logger.fatal e.message
|
31
|
+
Logging.logger.fatal e.backtrace.join("\n")
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
38
36
|
@threads.map(&:join)
|
39
37
|
rescue => e
|
40
|
-
|
41
|
-
|
38
|
+
Logging.logger.fatal e.message
|
39
|
+
Logging.logger.fatal e.backtrace.join("\n")
|
42
40
|
end
|
43
41
|
|
44
42
|
def self.stop
|
45
43
|
@threads.map(&:kill)
|
46
|
-
|
44
|
+
Logging.logger.info "Smartware shutdown at #{Time.now}"
|
47
45
|
exit 0
|
48
46
|
end
|
49
47
|
|
data/lib/smartware/version.rb
CHANGED
data/smartware.gemspec
CHANGED
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.1.
|
4
|
+
version: 0.1.30
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2013-01-14 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: smartkiosk-common
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: 0.0.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.0.2
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: serialport
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
@@ -33,10 +38,15 @@ dependencies:
|
|
33
38
|
version: '0'
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
37
47
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
39
|
-
requirement:
|
48
|
+
name: cmux
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
40
50
|
none: false
|
41
51
|
requirements:
|
42
52
|
- - ! '>='
|
@@ -44,10 +54,15 @@ dependencies:
|
|
44
54
|
version: '0'
|
45
55
|
type: :runtime
|
46
56
|
prerelease: false
|
47
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
48
63
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
50
|
-
requirement:
|
64
|
+
name: trollop
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
@@ -55,7 +70,12 @@ dependencies:
|
|
55
70
|
version: '0'
|
56
71
|
type: :runtime
|
57
72
|
prerelease: false
|
58
|
-
version_requirements:
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
59
79
|
description: Smartware is the Smartkiosk hardware control daemon
|
60
80
|
email:
|
61
81
|
- e.sudarchikov@roundlake.ru
|
@@ -110,9 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
130
|
version: '0'
|
111
131
|
requirements: []
|
112
132
|
rubyforge_project:
|
113
|
-
rubygems_version: 1.8.
|
133
|
+
rubygems_version: 1.8.24
|
114
134
|
signing_key:
|
115
135
|
specification_version: 3
|
116
136
|
summary: Smartware is the Smartkiosk hardware control daemon
|
117
137
|
test_files: []
|
118
|
-
has_rdoc:
|