betabrite 1.0.0 → 1.0.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.
data/History.txt CHANGED
@@ -1,3 +1,14 @@
1
+ === 1.0.1
2
+
3
+ * 2 Minor Enhancements:
4
+
5
+ * Works with ruby 1.9
6
+ * Added more string codes
7
+
8
+ * 1 bugfix:
9
+
10
+ * Fixing bug in memory allocation
11
+
1
12
  === 1.0.0
2
13
 
3
14
  * 3 Major Enhancements:
data/README.txt CHANGED
@@ -55,7 +55,7 @@ it. So subsequent executions of your script do not require allocating memory.
55
55
  Here is an example of allocating memory on the sign:
56
56
 
57
57
  bb = BetaBrite::Serial.new('/dev/ttyUSB0') do |sign|
58
- sign.memory do |memory|
58
+ sign.allocate do |memory|
59
59
  memory.text('A', 4096)
60
60
  memory.string('0', 64)
61
61
  end
@@ -1,5 +1,5 @@
1
1
  module BetaBrite
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
 
4
4
  class Base
5
5
  include BetaBrite::Files
@@ -89,11 +89,11 @@ module BetaBrite
89
89
 
90
90
  def checksum(string)
91
91
  total = 0
92
- 0.upto(string.length - 1) do |i|
93
- total += string[i]
94
- end
92
+ string.unpack('C*').each { |i|
93
+ total += i
94
+ }
95
95
 
96
- sprintf("%04x", total).upcase
96
+ sprintf("%04X", total)
97
97
  end
98
98
 
99
99
  Mode.constants.each do |constant|
@@ -37,7 +37,7 @@ module BetaBrite
37
37
  class << self
38
38
  def find(&block)
39
39
  @memory_list = []
40
- instance_eval(&block)
40
+ block.call(self)
41
41
  @memory_list
42
42
  end
43
43
 
@@ -2,8 +2,10 @@ module BetaBrite
2
2
  # This class encapsulates a string and attributes about the string such as
3
3
  # color, character set, and also contains special characters.
4
4
  class String
5
+ UP_ARROW = 0xc4.chr
6
+ DOWN_ARROW = 0xc5.chr
5
7
  LEFT_ARROW = 0xc6.chr
6
- RIGHT_ARROW = 0xc6.chr
8
+ RIGHT_ARROW = 0xc7.chr
7
9
  PACKMAN = 0xc8.chr
8
10
  SAIL_BOAT = 0xc9.chr
9
11
  BALL = 0xca.chr
@@ -22,6 +24,11 @@ module BetaBrite
22
24
  PRINTER = 0xd7.chr
23
25
  NOTE = 0xd8.chr
24
26
  INFINITY = 0xd9.chr
27
+ RETURN_ARROW = 0xda.chr
28
+ SM_UP_ARROW = 0xdb.chr
29
+ SM_DOWN_ARROW = 0xdc.chr
30
+ SM_LEFT_ARROW = 0xdd.chr
31
+ SM_RIGHT_ARROW = 0xde.chr
25
32
  class Color
26
33
  RED = '1'
27
34
  GREEN = '2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betabrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-11 00:00:00 -08:00
12
+ date: 2008-02-15 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency