smartware 0.1.27 → 0.1.28

Sign up to get free protection for your applications and to get access to all the features.
data/bin/smartware CHANGED
@@ -1,35 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- trap 'TTIN' do
4
- Thread.list.each do |thread|
5
- puts "Thread #{thread}:"
6
- if thread.backtrace
7
- puts thread.backtrace.join("\n")
8
- else
9
- puts "<no backtrace available>"
10
- end
11
- end
12
- end
13
-
14
- require "rubygems"
15
- begin
16
- require "bundler/setup"
17
- rescue
18
- end
19
-
20
- require 'smartware/service'
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'smartware'
21
6
  require 'dante'
22
7
 
8
+ Smartkiosk::Common::Patches.dante_should_log_with Smartware::Logging.logger
9
+
23
10
  runner = Dante::Runner.new('smartware')
24
- runner.description = "Smartkiosk hardware control daemon"
11
+ runner.description = 'Smartkiosk hardware control daemon'
25
12
  runner.with_options do |opts|
26
- opts.on("-c", "--config-file FILE", String, "Hardware config file to use. Sample: --config-file=/path/to/smartware.yml") do |x|
13
+ opts.on('-c', '--config-file FILE', String, 'Hardware config file to use. Sample: --config-file=/path/to/smartware.yml') do |x|
27
14
  options[:config] = x
28
15
  end
29
16
  end
30
17
 
31
18
  runner.execute do |opts|
32
- abort "You should specify hardware configuration file path(--config-file=/path/to/smartware.yml)" if opts[:config].nil?
19
+ abort 'You should specify hardware configuration file path(--config-file=/path/to/smartware.yml)' if opts[:config].nil?
33
20
 
34
21
  begin
35
22
  Smartware::Service.start(opts[:config])
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "rubygems"
4
- require "bundler/setup"
5
- require "cmux"
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'cmux'
6
6
 
7
7
  device, apn = ARGV
8
8
 
@@ -1,31 +1,5 @@
1
- require 'logger'
2
-
3
1
  module Smartware
4
- module Logging
5
-
6
- def self.logdir=(dir)
7
- @logdir = dir
8
- end
9
-
10
- def self.logger
11
- @logger ||= begin
12
- log = Logger.new(STDOUT)
13
- log.level = Logger::INFO
14
- log
15
- end
16
- end
17
-
18
- def self.logger=(val)
19
- @logger = (val ? val : Logger.new('/dev/null'))
20
- end
21
-
22
- def self.logfile=(val)
23
- @logfile = val
24
- end
25
-
26
- def self.logfile
27
- @logfile
28
- end
29
-
2
+ module Logging extend Smartkiosk::Common::Logging
3
+ self.service = 'Smartware'
30
4
  end
31
5
  end
@@ -1,6 +1,5 @@
1
1
  require 'thread'
2
2
  require 'yaml'
3
- require 'smartware/logging'
4
3
 
5
4
  module Smartware
6
5
  module Service
@@ -14,7 +13,7 @@ module Smartware
14
13
 
15
14
  @config = YAML.load File.read(File.expand_path(config_file))
16
15
 
17
- Smartware::Logging.logger = Logger.new($stdout)
16
+ Smartware::Logging.logger = Logging.init
18
17
  Smartware::Logging.logger.info "Smartware started at #{Time.now}"
19
18
 
20
19
 
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.1.27"
2
+ VERSION = "0.1.28"
3
3
  end
data/lib/smartware.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'smartkiosk/common'
2
+ require 'smartware/logging'
3
+ require 'smartware/service'
1
4
  require 'smartware/clients/cash_acceptor'
2
5
  require 'smartware/clients/printer'
3
6
  require 'smartware/clients/modem'
@@ -20,6 +23,4 @@ module Smartware
20
23
  Smartware::Client::Modem
21
24
  end
22
25
 
23
- end
24
-
25
-
26
+ end
data/smartware.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
+ gem.add_dependency 'smartkiosk-common'
20
21
  gem.add_dependency 'serialport'
21
22
  gem.add_dependency 'dante'
22
23
  gem.add_dependency 'cmux'
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.27
4
+ version: 0.1.28
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-13 00:00:00.000000000 Z
13
+ date: 2013-01-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: serialport
17
- requirement: !ruby/object:Gem::Requirement
16
+ name: smartkiosk-common
17
+ requirement: &70285475109180 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,15 +22,21 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
25
+ version_requirements: *70285475109180
26
+ - !ruby/object:Gem::Dependency
27
+ name: serialport
28
+ requirement: &70285475108760 !ruby/object:Gem::Requirement
26
29
  none: false
27
30
  requirements:
28
31
  - - ! '>='
29
32
  - !ruby/object:Gem::Version
30
33
  version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *70285475108760
31
37
  - !ruby/object:Gem::Dependency
32
38
  name: dante
33
- requirement: !ruby/object:Gem::Requirement
39
+ requirement: &70285475108340 !ruby/object:Gem::Requirement
34
40
  none: false
35
41
  requirements:
36
42
  - - ! '>='
@@ -38,15 +44,10 @@ dependencies:
38
44
  version: '0'
39
45
  type: :runtime
40
46
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
+ version_requirements: *70285475108340
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: cmux
49
- requirement: !ruby/object:Gem::Requirement
50
+ requirement: &70285475107900 !ruby/object:Gem::Requirement
50
51
  none: false
51
52
  requirements:
52
53
  - - ! '>='
@@ -54,12 +55,7 @@ dependencies:
54
55
  version: '0'
55
56
  type: :runtime
56
57
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
58
+ version_requirements: *70285475107900
63
59
  description: Smartware is the Smartkiosk hardware control daemon
64
60
  email:
65
61
  - e.sudarchikov@roundlake.ru
@@ -114,8 +110,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
110
  version: '0'
115
111
  requirements: []
116
112
  rubyforge_project:
117
- rubygems_version: 1.8.24
113
+ rubygems_version: 1.8.15
118
114
  signing_key:
119
115
  specification_version: 3
120
116
  summary: Smartware is the Smartkiosk hardware control daemon
121
117
  test_files: []
118
+ has_rdoc: