serialbar 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -2
- data/lib/serialbar/listener.rb +3 -2
- data/lib/serialbar/version.rb +1 -1
- data/serialbar.sublime-workspace +1 -1
- data/spec/listener_spec.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abde4227024039963fc23dd8dbf8742d97a96611
|
4
|
+
data.tar.gz: cff49a391760e46e0ccdec08ee131ca7a1397c5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef1aab0faae116751677fb193fb8607ec0d0068cb13504839714aa69adfad6650ffdd1c14fccaddc464b4a3ca68416abb4a5b20d63ac6135481c8a023174dfc9
|
7
|
+
data.tar.gz: 5a53482255a9d5e16aad36545482986d32937e75bb63719b752a9894f39b6369817132419c3d42fcc4231b930d20d000d956bfcf20df49cf1be7a16024c057ec
|
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= \
|
1
|
+
= \Serialbar
|
2
2
|
|
3
3
|
* http://github.com/jonbramble/serialbar
|
4
4
|
|
@@ -28,7 +28,7 @@ Configuration file for projects
|
|
28
28
|
|
29
29
|
== INSTALL
|
30
30
|
|
31
|
-
* gem install serialbar (not
|
31
|
+
* gem install serialbar (available but not working well due to timers)
|
32
32
|
|
33
33
|
|
34
34
|
== LICENSE:
|
data/lib/serialbar/listener.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'serialport'
|
2
|
+
require 'set'
|
2
3
|
require 'timers'
|
3
4
|
|
4
5
|
module Serialbar
|
@@ -70,7 +71,7 @@ module Serialbar
|
|
70
71
|
# * +n+ - number of seconds between each poll of the device
|
71
72
|
#
|
72
73
|
def poll_every_n_seconds(send,lines=1,n=1)
|
73
|
-
timer = Timers.new
|
74
|
+
timer = Timers::Group.new
|
74
75
|
every_seconds = timer.every(n) { parse(poll(send,lines)) }
|
75
76
|
loop { timers.wait }
|
76
77
|
end
|
@@ -87,7 +88,7 @@ module Serialbar
|
|
87
88
|
# * +n+ - number of minutes between each poll of the device
|
88
89
|
#
|
89
90
|
def poll_every_n_minutes(send,lines=1,n=1)
|
90
|
-
timer = Timers.new
|
91
|
+
timer = Timers::Group.new
|
91
92
|
every_seconds = timer.every(60*n) { parse(poll(send,lines)) }
|
92
93
|
loop { timers.wait }
|
93
94
|
end
|
data/lib/serialbar/version.rb
CHANGED
data/serialbar.sublime-workspace
CHANGED
data/spec/listener_spec.rb
CHANGED
@@ -39,9 +39,9 @@ RSpec.describe Listener do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'should return a serialport object' do
|
42
|
-
pending("No serialports on this computer")
|
43
|
-
this_should_not_get_executed
|
42
|
+
#pending("No serialports on this computer")
|
43
|
+
#this_should_not_get_executed
|
44
44
|
@obj.setup("/dev/ttyS0") # don't have serialports on this test computer
|
45
|
-
expect
|
45
|
+
expect(@obj.serial_port).to be_instance_of SerialPort
|
46
46
|
end
|
47
47
|
end
|