smartware 0.2 → 0.2.1

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.
@@ -44,6 +44,12 @@ module Smartware
44
44
  'No device'
45
45
  end
46
46
 
47
+ def self.print_markdown(text, max_time = 30)
48
+ @device.print_markdown text, max_time
49
+ rescue => e
50
+ 'No device'
51
+ end
52
+
47
53
  end
48
54
  end
49
55
  end
@@ -14,8 +14,7 @@ module Smartware
14
14
  end
15
15
 
16
16
  def version
17
- # TODO: implement this
18
- "not implemented"
17
+ "1.0"
19
18
  end
20
19
 
21
20
  def cassette?
@@ -126,8 +126,7 @@ module Smartware
126
126
  end
127
127
 
128
128
  def execute_monitor
129
-
130
- error = @device.error || ''
129
+ error = @device.error
131
130
  model = @device.model
132
131
  version = @device.version
133
132
  cassette = @device.cassette?
@@ -34,7 +34,7 @@ module Smartware
34
34
  @status[:signal_level] = @device.signal_level
35
35
  @status[:model] = @device.model
36
36
  @status[:version] = @device.version
37
- @status[:error] = @device.error || ''
37
+ @status[:error] = @device.error
38
38
  @status[:balance] = @device.balance
39
39
  end
40
40
  end
@@ -16,7 +16,7 @@ module Smartware
16
16
  end
17
17
 
18
18
  def test
19
- print_text <<-EOS
19
+ print_markdown <<-EOS
20
20
  Smartware: **#{Smartware::VERSION}**
21
21
 
22
22
  Driver: **#{@config["driver"]}**
@@ -30,10 +30,14 @@ EOS
30
30
 
31
31
  def print(file, max_time = 30)
32
32
  File.open(file, "r") do |io|
33
- print_text io.read, max_time
33
+ print_markdown io.read, max_time
34
34
  end
35
35
  end
36
36
 
37
+ def print_markdown(text, max_time = 30)
38
+ print_text @markdown.render(text), max_time
39
+ end
40
+
37
41
  def print_text(text, max_time = 30)
38
42
  Smartware::Logging.logger.info "Started printing"
39
43
 
@@ -45,7 +49,7 @@ EOS
45
49
  loop do
46
50
  case @device.status
47
51
  when :ready, :warning
48
- @device.print @markdown.render(text)
52
+ @device.print text
49
53
 
50
54
  query_printer
51
55
 
@@ -68,7 +72,7 @@ EOS
68
72
 
69
73
  Smartware::Logging.logger.info "Completed"
70
74
 
71
- self.error.nil? || self.error < 1000
75
+ self.error.nil? || self.error >= 1000
72
76
  end
73
77
 
74
78
  private
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.2"
2
+ VERSION = "0.2.1"
3
3
  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'
4
+ version: 0.2.1
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-16 00:00:00.000000000 Z
13
+ date: 2013-01-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: smartkiosk-common