zerbo 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/zerbo.rb +9 -5
  2. data/lib/zerbo/version.rb +1 -1
  3. metadata +5 -5
@@ -17,9 +17,6 @@ class Zerbo
17
17
  else
18
18
  require 'serialport'
19
19
  @device = SerialPort.new(device, 38400)
20
- unless RUBY_PLATFORM =~ /darwin/
21
- @device.read_timeout = 0
22
- end
23
20
  end
24
21
  @callbacks = []
25
22
  end
@@ -41,8 +38,10 @@ class Zerbo
41
38
  end
42
39
  alias next next_packet
43
40
 
44
- def read(*args)
45
- device.read(*args)
41
+ def read(length)
42
+ data = device.read(length)
43
+ raise Error, "Read timeout" unless data.to_s.length == length
44
+ data
46
45
  end
47
46
  protected :read
48
47
 
@@ -125,6 +124,11 @@ class Zerbo
125
124
  end
126
125
  end
127
126
 
127
+ def name
128
+ self.class.name.split('::').last
129
+ end
130
+ alias to_s name
131
+
128
132
  def inspect
129
133
  format_inspect((to_i || data).inspect)
130
134
  end
@@ -1,3 +1,3 @@
1
1
  module Zerbo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zerbo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 0
9
8
  - 1
10
- version: 0.0.1
9
+ - 0
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Pope
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-07 00:00:00 -05:00
18
+ date: 2011-03-09 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements: []
80
80
 
81
81
  rubyforge_project: zerbo
82
- rubygems_version: 1.6.1
82
+ rubygems_version: 1.4.2
83
83
  signing_key:
84
84
  specification_version: 3
85
85
  summary: Zeo Personal Sleep Coach Ruby Interface