artoo 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -13
- data/README.md +5 -0
- data/artoo.gemspec +1 -1
- data/bin/artoo +4 -0
- data/lib/artoo/commands/commands.rb +4 -0
- data/lib/artoo/commands/install.rb +9 -2
- data/lib/artoo/drivers/device_info.rb +8 -0
- data/lib/artoo/exceptions.rb +1 -0
- data/lib/artoo/ext/numeric.rb +32 -0
- data/lib/artoo/generators/adaptor/lib/artoo/adaptors/%adaptor_name%.rb.tt +12 -0
- data/lib/artoo/utility.rb +1 -15
- data/lib/artoo/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de6e726dc7a4d253d4acfb870173fd4928a8734c
|
4
|
+
data.tar.gz: f6ede2be821e79a2711f6f0cb8f67e5d511ce706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 247a5ea51e36972fdab99d623f74089d6ed66fc6ad43aa400055cb7a0ea3d4229b21c577fe702b35a5c83b0ead2ea15641df1ff525b9773b931898122c7e75d6
|
7
|
+
data.tar.gz: 00b1db0bf425d8519bfc5efb30e64c71f5dfcc34898122a7acdd4f15c5930215b8c94336c8eea492fd9149500b356cd02faa8cc40f401ccb253e4a0bd1c9cc9e
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
artoo (1.
|
4
|
+
artoo (1.2.0)
|
5
5
|
celluloid (~> 0.15.0)
|
6
6
|
celluloid-io (~> 0.15.0)
|
7
7
|
multi_json (~> 1.6)
|
8
8
|
pry (~> 0.9)
|
9
9
|
rake (~> 10.0)
|
10
|
-
reel (~> 0.4.0
|
10
|
+
reel (~> 0.4.0)
|
11
11
|
thor (~> 0.18.1)
|
12
12
|
|
13
13
|
GEM
|
@@ -15,12 +15,11 @@ GEM
|
|
15
15
|
specs:
|
16
16
|
bootstrap-sass (2.3.2.1)
|
17
17
|
sass (~> 3.2)
|
18
|
-
celluloid (0.15.
|
18
|
+
celluloid (0.15.1)
|
19
19
|
timers (~> 1.1.0)
|
20
20
|
celluloid-io (0.15.0)
|
21
21
|
celluloid (>= 0.15.0)
|
22
22
|
nio4r (>= 0.5.0)
|
23
|
-
certified (0.1.1)
|
24
23
|
chunky_png (1.2.8)
|
25
24
|
coderay (1.0.9)
|
26
25
|
coffee-script (2.2.0)
|
@@ -58,10 +57,9 @@ GEM
|
|
58
57
|
guard (>= 1.1.0)
|
59
58
|
sprockets (~> 2.0)
|
60
59
|
hike (1.2.3)
|
61
|
-
http (0.
|
62
|
-
certified
|
60
|
+
http (0.5.0)
|
63
61
|
http_parser.rb
|
64
|
-
http_parser.rb (0.
|
62
|
+
http_parser.rb (0.6.0.beta.2)
|
65
63
|
json (1.7.7)
|
66
64
|
json (1.7.7-java)
|
67
65
|
kramdown (1.1.0)
|
@@ -89,12 +87,12 @@ GEM
|
|
89
87
|
rake (10.1.0)
|
90
88
|
rb-inotify (0.8.8)
|
91
89
|
ffi (>= 0.5.0)
|
92
|
-
reel (0.4.0
|
93
|
-
celluloid
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
websocket_parser (>= 0.1.
|
90
|
+
reel (0.4.0)
|
91
|
+
celluloid (>= 0.15.1)
|
92
|
+
celluloid-io (>= 0.15.0)
|
93
|
+
http (>= 0.5.0)
|
94
|
+
http_parser.rb (>= 0.6.0.beta.2)
|
95
|
+
websocket_parser (>= 0.1.4)
|
98
96
|
ref (1.0.5)
|
99
97
|
sass (3.2.9)
|
100
98
|
slop (3.4.5)
|
data/README.md
CHANGED
@@ -88,6 +88,7 @@ Artoo has a extensible system for connecting to hardware devices. The following
|
|
88
88
|
|
89
89
|
- [Arduino](http://www.arduino.cc/) <=> [Adaptor](https://github.com/hybridgroup/artoo-arduino)
|
90
90
|
- [ARDrone](http://ardrone2.parrot.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-ardrone)
|
91
|
+
- [Digispark](http://digistump.com/products/1) <=> [Adaptor](https://github.com/hybridgroup/artoo-digispark)
|
91
92
|
- [Leap Motion](https://www.leapmotion.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-leapmotion)
|
92
93
|
- [Pebble](http://getpebble.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-pebble)
|
93
94
|
- [Raspberry Pi](http://www.raspberrypi.org/) <=> [Adaptor](https://github.com/hybridgroup/artoo-raspi)
|
@@ -96,6 +97,10 @@ Artoo has a extensible system for connecting to hardware devices. The following
|
|
96
97
|
|
97
98
|
More platforms are coming soon!
|
98
99
|
|
100
|
+
Artoo also has support for devices that can work across multiple hardware platforms.
|
101
|
+
- GPIO (General Purpose Input/Output) devices <=> [Drivers](https://github.com/hybridgroup/artoo-gpio)
|
102
|
+
- i2c devices <=> [Drivers](https://github.com/hybridgroup/artoo-i2c)
|
103
|
+
|
99
104
|
Do you have some hardware that is not yet supported by Artoo? We want to help you, help us, help them! Get in touch...
|
100
105
|
|
101
106
|
## Getting Started:
|
data/artoo.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'celluloid', '~> 0.15.0'
|
24
24
|
s.add_runtime_dependency 'celluloid-io', '~> 0.15.0'
|
25
|
-
s.add_runtime_dependency 'reel', '~> 0.4.0
|
25
|
+
s.add_runtime_dependency 'reel', '~> 0.4.0'
|
26
26
|
s.add_runtime_dependency 'multi_json', '~> 1.6'
|
27
27
|
s.add_runtime_dependency 'rake', '~> 10.0'
|
28
28
|
s.add_runtime_dependency 'pry', '~> 0.9'
|
data/bin/artoo
CHANGED
@@ -10,6 +10,7 @@ require 'artoo/commands/install'
|
|
10
10
|
|
11
11
|
Celluloid.logger = nil
|
12
12
|
|
13
|
+
# load main commands
|
13
14
|
module CLI
|
14
15
|
class Root < Thor
|
15
16
|
include Thor::Actions
|
@@ -44,4 +45,7 @@ module CLI
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
48
|
+
# require any custom commands installed by artoo adaptor or driver gems
|
49
|
+
Dir["#{Artoo::Commands::Commands.install_dir}/*.rb"].each {|file| require file }
|
50
|
+
|
47
51
|
CLI::Root.start
|
@@ -1,5 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'artoo/utility'
|
2
|
+
require 'artoo/commands/commands'
|
3
|
+
require 'fileutils'
|
3
4
|
|
4
5
|
module Artoo
|
5
6
|
module Commands
|
@@ -19,6 +20,12 @@ module Artoo
|
|
19
20
|
say "OS not yet supported..."
|
20
21
|
end
|
21
22
|
end
|
23
|
+
|
24
|
+
desc "command [FILENAME]", "Installs artoo command extension files"
|
25
|
+
def command(file)
|
26
|
+
empty_directory Install.install_dir
|
27
|
+
FileUtils.cp(file, Install.install_dir)
|
28
|
+
end
|
22
29
|
end
|
23
30
|
end
|
24
31
|
end
|
@@ -5,6 +5,14 @@ module Artoo
|
|
5
5
|
# DeviceInfo driver behaviors
|
6
6
|
class DeviceInfo < Driver
|
7
7
|
COMMANDS = [:firmware_name, :version, :connect].freeze
|
8
|
+
|
9
|
+
def firmware_name
|
10
|
+
connection.firmware_name
|
11
|
+
end
|
12
|
+
|
13
|
+
def version
|
14
|
+
connection.version
|
15
|
+
end
|
8
16
|
end
|
9
17
|
end
|
10
18
|
end
|
data/lib/artoo/exceptions.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Adds syntactic suger for seconds
|
2
|
+
class Integer < Numeric
|
3
|
+
# @return [Integer] Plain number, actually does nothing
|
4
|
+
# @example 20.seconds => 20
|
5
|
+
def seconds
|
6
|
+
return self
|
7
|
+
end
|
8
|
+
|
9
|
+
# @return [Integer] Plain number, actually does nothing
|
10
|
+
# @example 1.second => 1
|
11
|
+
def second
|
12
|
+
return self
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# helpful conversions
|
17
|
+
class Fixnum
|
18
|
+
# convert to PWM value from analog reading
|
19
|
+
def to_pwm
|
20
|
+
((255.0 / 1023.0) * self.to_f).round
|
21
|
+
end
|
22
|
+
|
23
|
+
# convert to PWM value from analog reading
|
24
|
+
def to_pwm_reverse
|
25
|
+
((255.0 / 1023.0) * (1023 - self.to_f)).round
|
26
|
+
end
|
27
|
+
|
28
|
+
# convert value from old scale (min to max) to new scale (0 to new_max)
|
29
|
+
def to_scale(min, max, new_scale)
|
30
|
+
(((self.to_f - min) / (max - min)) * new_max).round
|
31
|
+
end
|
32
|
+
end
|
@@ -26,6 +26,18 @@ module Artoo
|
|
26
26
|
super
|
27
27
|
end
|
28
28
|
|
29
|
+
# Name of device
|
30
|
+
# @return [String]
|
31
|
+
def name
|
32
|
+
"<%= adaptor_name %>"
|
33
|
+
end
|
34
|
+
|
35
|
+
# Version of device
|
36
|
+
# @return [String]
|
37
|
+
def version
|
38
|
+
Artoo::<%= adaptor_class_name %>::VERSION
|
39
|
+
end
|
40
|
+
|
29
41
|
# Uses method missing to call device actions
|
30
42
|
# @see device documentation
|
31
43
|
def method_missing(method_name, *arguments, &block)
|
data/lib/artoo/utility.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rbconfig'
|
2
|
+
require 'artoo/ext/numeric'
|
2
3
|
|
3
4
|
module Artoo
|
4
5
|
# Utility methods used for various important things
|
@@ -86,18 +87,3 @@ module Artoo
|
|
86
87
|
end
|
87
88
|
end
|
88
89
|
end
|
89
|
-
|
90
|
-
# Adds syntactic suger for seconds
|
91
|
-
class Integer < Numeric
|
92
|
-
# @return [Integer] Plain number, actually does nothing
|
93
|
-
# @example 20.seconds => 20
|
94
|
-
def seconds
|
95
|
-
return self
|
96
|
-
end
|
97
|
-
|
98
|
-
# @return [Integer] Plain number, actually does nothing
|
99
|
-
# @example 1.second => 1
|
100
|
-
def second
|
101
|
-
return self
|
102
|
-
end
|
103
|
-
end
|
data/lib/artoo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron Evans
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-09-
|
15
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: celluloid
|
@@ -48,14 +48,14 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - ~>
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: 0.4.0
|
51
|
+
version: 0.4.0
|
52
52
|
type: :runtime
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
56
|
- - ~>
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version: 0.4.0
|
58
|
+
version: 0.4.0
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: multi_json
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/artoo/events.rb
|
223
223
|
- lib/artoo/exceptions.rb
|
224
224
|
- lib/artoo/ext/actor.rb
|
225
|
+
- lib/artoo/ext/numeric.rb
|
225
226
|
- lib/artoo/generators/adaptor.rb
|
226
227
|
- lib/artoo/generators/adaptor/Gemfile.tt
|
227
228
|
- lib/artoo/generators/adaptor/LICENSE
|