arduino_firmata 0.1.1 → 0.1.2

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,8 @@
1
+ === 0.1.2 2012-11-3
2
+
3
+ * close SerialPort when catch Signals (SIGHUP,SIGINT,SIGTERM,SIGKILL)
4
+ * add description about Test
5
+
1
6
  === 0.1.1 2012-10-26
2
7
 
3
8
  * ArduinoFirmata::Arduino#servo_write(pin, angle)
data/README.rdoc CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  Arduino Firmata protocol (http://firmata.org) implementation on Ruby.
12
12
 
13
+ == REQUIREMENTS:
14
+
15
+ * Arduino Standard Firmata v2.2
16
+ Arduino IDE -> [File] -> [Examples] -> [Firmata] -> [StandardFirmata]
17
+
18
+ * Ruby 1.8.7+
19
+ * Ruby 1.9.2+
20
+
13
21
  == SYNOPSIS:
14
22
 
15
23
  Setup
@@ -52,7 +60,7 @@ Analog Read
52
60
  end
53
61
 
54
62
 
55
- Servo
63
+ Servo Motor
56
64
 
57
65
  loop do
58
66
  angle = rand(180)
@@ -82,14 +90,13 @@ Block
82
90
 
83
91
  see samples https://github.com/shokai/arduino_firmata/tree/master/samples
84
92
 
85
- == REQUIREMENTS:
86
93
 
87
- * Arduino Standard Firmata v2.2
88
- Arduino IDE -> [File] -> [Examples] -> [Firmata] -> [StandardFirmata]
89
-
90
- * Ruby 1.8.7+
91
- * Ruby 1.9.2+
94
+ == TEST:
92
95
 
96
+ % gem install bundler
97
+ % bundle install
98
+ % export ARDUINO=/dev/tty.usb-device-name
99
+ % rake test
93
100
 
94
101
  == LICENSE:
95
102
 
@@ -9,5 +9,5 @@ require 'arduino_firmata/arduino'
9
9
  require 'arduino_firmata/event'
10
10
 
11
11
  module ArduinoFirmata
12
- VERSION = '0.1.1'
12
+ VERSION = '0.1.2'
13
13
  end
@@ -24,6 +24,19 @@ module ArduinoFirmata
24
24
  @serial.read_timeout = 3
25
25
  sleep 3
26
26
 
27
+ trap 'SIGHUP' do
28
+ close
29
+ end
30
+ trap 'SIGINT' do
31
+ close
32
+ end
33
+ trap 'SIGKILL' do
34
+ close
35
+ end
36
+ trap 'SIGTERM' do
37
+ close
38
+ end
39
+
27
40
  Thread.new{
28
41
  loop do
29
42
  process_input
@@ -3,7 +3,7 @@ require File.expand_path 'test_helper', File.dirname(__FILE__)
3
3
  class TestArduinoFirmata < MiniTest::Unit::TestCase
4
4
 
5
5
  def setup
6
- @arduino = ArduinoFirmata.connect
6
+ @arduino = ArduinoFirmata.connect ENV['ARDUINO']
7
7
  end
8
8
 
9
9
  def test_arduino
data/test/test_block.rb CHANGED
@@ -4,7 +4,7 @@ class TestBlock < MiniTest::Unit::TestCase
4
4
 
5
5
  def test_block
6
6
  version_ = nil
7
- ArduinoFirmata.connect do
7
+ ArduinoFirmata.connect ENV['ARDUINO'] do
8
8
  version_ = version
9
9
  end
10
10
  assert version_ and version_ > '2.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arduino_firmata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-25 00:00:00.000000000 Z
12
+ date: 2012-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: serialport
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  segments:
138
138
  - 0
139
- hash: -1305837009193017010
139
+ hash: 2028658490510817249
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements: