artoo-arduino 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc032976383aac9fc633e0d97d13e0de36e36709
4
- data.tar.gz: 025d42555f25ace515f6c78f2648282f4d7c4119
3
+ metadata.gz: 34a20ea820138830b5aa01b4e559cee10d2b10d2
4
+ data.tar.gz: 7022e24bc2f4ee5a0466d0b4f79293a437a4b4ac
5
5
  SHA512:
6
- metadata.gz: 3c43b02b6ce8430db74737a71525bf27a3a62b457d3e12ab131ac47bf63fc8e48664d707e971b878176a07081ee8180a51f4e7a87c2f760564b7e3efc3636cb8
7
- data.tar.gz: 2d58f47a05b165037af96a41abfa9b260d7a791d87808dbfa3641bd011cdd11290fe348f175b0bbcd71a7a5afe7d559dddc2708f0612f3f991198280b2c3cae9
6
+ metadata.gz: b65a4fb5ece3630cecd8a844f38cf2521d40dd08ec1f7afe8227433ce0cfd9217e8f14a32605a476856808fa48d75dd4b63e717d30060739249708695d153b31
7
+ data.tar.gz: c91d5c144a7c1ad45e3fa1a336afbd7fef05f8aae45eebe1dd86556ca288a3dc8cd105b8dead782e96389577ebd8bf63772ef164572d6d810dd2fd95225c2301
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artoo-arduino (1.4.1)
4
+ artoo-arduino (1.4.2)
5
5
  artoo (>= 1.6.0)
6
6
  artoo-gpio
7
7
  artoo-i2c
@@ -17,7 +17,7 @@ GEM
17
17
  pry (~> 0.9)
18
18
  rake
19
19
  reel (~> 0.4.0)
20
- robeaux (~> 0.0.4)
20
+ robeaux (~> 0.0.3)
21
21
  thor (~> 0.18.1)
22
22
  artoo-gpio (0.4.0)
23
23
  artoo (>= 1.6.0)
data/ext/Rakefile CHANGED
@@ -5,5 +5,6 @@ task :default => :install_commands
5
5
  task :install_commands do
6
6
  @install = Artoo::Commands::Install.new
7
7
  @install.command(File.expand_path(File.dirname(__FILE__) + "/../lib/artoo/commands/firmata.rb"))
8
+ @install.command(File.expand_path(File.dirname(__FILE__) + "/../lib/artoo/commands/arduino.rb"))
8
9
  @install.command(File.expand_path(File.dirname(__FILE__) + "/../lib/artoo/commands/hex/StandardFirmata.cpp.hex"))
9
10
  end
@@ -1,5 +1,5 @@
1
1
  module Artoo
2
2
  module Arduino
3
- VERSION = '1.4.1'
3
+ VERSION = '1.4.2'
4
4
  end
5
5
  end
@@ -0,0 +1,38 @@
1
+ module Artoo
2
+ module Commands
3
+ class Arduino < Artoo::Commands::Firmata
4
+ package_name "arduino"
5
+
6
+ desc "scan", "Scan for connected arduino devices"
7
+ def scan
8
+ Artoo::Commands::Scan.new().serial()
9
+ end
10
+
11
+ desc "connect [NAME] [PORT]", "Connect a serial device to a TCP socket using socat"
12
+ option :retries, :aliases => "-r", :default => 0, :desc => "Number of times to retry connecting on failure"
13
+ option :baudrate, :aliases => "-b", :default => 57600, :desc => "Baud rate to use to connect to the serial device"
14
+ def connect(name, port)
15
+ Artoo::Commands::Socket.new().connect(name, port, options[:retries], options[:baudrate])
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ # We need to register the commands in the main artoo CLI so they
22
+ # can be picked up when this command file is required.
23
+ # The steps needed to register new CLI commands from outside
24
+ # artoo are:
25
+ # 1. External command files (not in artoo main gem) need to be copied to the
26
+ # artoo installed commands.
27
+ # 2. We do this with a rake task that is triggered when the gem is installed
28
+ # (see .gemspec file and look for extensions, ext/Rakefile), in the Rakefile
29
+ # we defined a new default class that makes use of an artoo helper class/method
30
+ # Artoo::Commands::Install helper method '.command'; see ext/Rakefile for details.
31
+ # 3. Finally in our main command file (THIS FILE) we open the artoo CLI::Root class to register
32
+ # the new commands.
33
+ module CLI
34
+ class Root
35
+ desc "arduino SUBCOMMAND <serial_port>", "Installs avrdude, uploads firmata to the arduino and connects serial to socket"
36
+ subcommand "arduino", Artoo::Commands::Arduino
37
+ end
38
+ end
@@ -29,6 +29,7 @@ module Artoo
29
29
  when :linux
30
30
  run('sudo apt-get install avrdude')
31
31
  when :macosx
32
+ require 'bundler' unless defined?(Bundler)
32
33
  Bundler.with_clean_env do
33
34
  run("brew install avrdude")
34
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artoo-arduino
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ron Evans
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-02-20 00:00:00.000000000 Z
14
+ date: 2014-04-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: artoo
@@ -148,6 +148,7 @@ files:
148
148
  - lib/artoo-arduino.rb
149
149
  - lib/artoo-arduino/version.rb
150
150
  - lib/artoo/adaptors/firmata.rb
151
+ - lib/artoo/commands/arduino.rb
151
152
  - lib/artoo/commands/firmata.rb
152
153
  - lib/artoo/commands/hex/StandardFirmata.cpp.hex
153
154
  - test/adaptors/firmata_test.rb
@@ -177,4 +178,3 @@ signing_key:
177
178
  specification_version: 4
178
179
  summary: Artoo adaptor and driver for Arduino
179
180
  test_files: []
180
- has_rdoc: