artoo 1.8.0 → 1.8.1

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: 3e2af8475fd6bcbc50ddb13d80d3d4c1c47a2d8e
4
- data.tar.gz: 3ff802dd20f87a526d428bdaf8d66244233ecc99
3
+ metadata.gz: 2bd5f19df7614902b2db851504c69b84c62802bf
4
+ data.tar.gz: 553d99621d690f7dd34c6d44f3f5e00558a80ac4
5
5
  SHA512:
6
- metadata.gz: 3edc56e7a01c5fc920e4e89c6fce98b67a8ae507e7b783599b26e9831fd56b1d1655a79d42251602af1235a6f66ef313b47cc11444320cb7c2ec95e582aca0ba
7
- data.tar.gz: cb17d7f5f705d318155359101445274669fdd81ab2ee77b627a153ed0392e0dc62ed3880e4222e722922e85c500eaea9e170eebb5de0c0a8faac4f4f4d26e90d
6
+ metadata.gz: 846e9655c178b18fa55325cf11f8d857683a1fedd4951844c242a64f7193ce239a2947e04d87abe3ed14dc3df63e7fe066b5067071f7c5fec28810dbb278aa2c
7
+ data.tar.gz: 5a5adc204d4196683e0ceb275d395d39d91ee77b48cd6e940e6ee8b86c8c7fd9cfce8752a3e3cf404e5b4708261480a61d4d6da3f5f35932fe96b127a626a86f
@@ -1 +1,3 @@
1
- ruby-2.1.1
1
+ 2.1.1
2
+ 2.1.1
3
+
@@ -1,7 +1,8 @@
1
1
  rvm:
2
2
  - 1.9.3
3
- - 2.0.0
4
- - 2.1.0
3
+ - 2.0
4
+ - 2.1
5
+ - 2.2
5
6
  - ruby-head
6
7
  - jruby
7
8
  - jruby-head
@@ -0,0 +1 @@
1
+ To get started, <a href="https://thg-clahub.herokuapp.com/agreements/clahub">Sign the Contributor License Agreement</a>
data/Gemfile CHANGED
@@ -13,7 +13,7 @@ gem "minitest", "~> 5.0.1"
13
13
  gem "minitest-happy"
14
14
  gem "mocha", '~> 0.14.0', :require => false
15
15
 
16
- gem 'json', '~> 1.7.7'
16
+ gem 'json', '~> 1.8.2'
17
17
  gem "foreman"
18
18
 
19
19
  platforms :jruby do
data/README.md CHANGED
@@ -106,7 +106,7 @@ Artoo has a extensible system for connecting to hardware devices. The following
106
106
  - [OpenCV](http://opencv.org/) <=> [Adaptor](https://github.com/hybridgroup/artoo-opencv)
107
107
  - [Pebble](http://getpebble.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-pebble)
108
108
  - [Raspberry Pi](http://www.raspberrypi.org/) <=> [Adaptor](https://github.com/hybridgroup/artoo-raspi)
109
- - [Roomba](http://www.irobot.com/us/robots/Educators/Create.aspx) <=> [Adaptor](https://github.com/hybridgroup/artoo-roomba)
109
+ - [Roomba](http://www.irobot.com/About-iRobot/STEM.aspx) <=> [Adaptor](https://github.com/hybridgroup/artoo-roomba)
110
110
  - [Spark Core](http://www.spark.io/) <=> [Adaptor](https://github.com/hybridgroup/artoo-spark)
111
111
  - [Sphero](http://www.gosphero.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-sphero)
112
112
 
@@ -319,7 +319,6 @@ If you want to help us with some documentation on the site, you can go to [artoo
319
319
  Need more help? Just want to say "Hello"? Come visit us on IRC freenode #artoo
320
320
 
321
321
  ## Contributing
322
- * All active development is in the dev branch. New or updated features must be added to the dev branch. Hotfixes will be considered on the master branch in situations where it does not alter behaviour or features, only fixes a bug.
323
322
  * All patches must be provided under the Apache 2.0 License
324
323
  * Please use the -s option in git to "sign off" that the commit is your work and you are providing it under the Apache 2.0 License
325
324
  * Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC.
@@ -333,4 +332,4 @@ Need more help? Just want to say "Hello"? Come visit us on IRC freenode #artoo
333
332
  * For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git
334
333
 
335
334
 
336
- (c) 2012-2014 The Hybrid Group
335
+ (c) 2012-2015 The Hybrid Group
@@ -20,13 +20,13 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
- s.add_runtime_dependency 'celluloid', '>= 0.16.0.pre'
24
- s.add_runtime_dependency 'celluloid-io', '>= 0.16.0.pre'
23
+ s.add_runtime_dependency 'celluloid', '~> 0.16.0'
24
+ s.add_runtime_dependency 'celluloid-io', '~> 0.16.0'
25
25
  s.add_runtime_dependency 'http', '~> 0.6.1'
26
26
  s.add_runtime_dependency 'reel', '~> 0.5.0'
27
27
  s.add_runtime_dependency 'multi_json', '~> 1.10.1'
28
28
  s.add_runtime_dependency 'rake'
29
29
  s.add_runtime_dependency 'pry', '~> 0.9.0'
30
30
  s.add_runtime_dependency 'thor', '~> 0.19.1'
31
- s.add_runtime_dependency 'robeaux', '0.2.0'
31
+ s.add_runtime_dependency 'robeaux', '0.4.1'
32
32
  end
@@ -50,14 +50,17 @@ module Artoo
50
50
  @mode = mode
51
51
 
52
52
  if mode == 'w'
53
- File.open("#{ GPIO_PATH }/gpio#{ pin_num }/direction", "w") { |f| f.write(GPIO_DIRECTION_WRITE) }
54
- @pin_file = File.open("#{ GPIO_PATH }/gpio#{ pin_num }/value", "w")
53
+ set_pin(mode: 'w', direction: GPIO_DIRECTION_WRITE)
55
54
  elsif mode =='r'
56
- File.open("#{ GPIO_PATH }/gpio#{ pin_num }/direction", "w") { |f| f.write(GPIO_DIRECTION_READ) }
57
- @pin_file = File.open("#{ GPIO_PATH }/gpio#{pin_num}/value", "r")
55
+ set_pin(mode: 'r', direction: GPIO_DIRECTION_READ)
58
56
  end
59
57
  end
60
58
 
59
+ def set_pin(mode:, direction:)
60
+ File.open("#{ GPIO_PATH }/gpio#{ pin_num }/direction", "w") { |f| f.write(direction) }
61
+ @pin_file = File.open("#{ GPIO_PATH }/gpio#{ pin_num }/value", mode)
62
+ end
63
+
61
64
  def on?
62
65
  (@status == 'high') ? true : false
63
66
  end
@@ -78,6 +81,7 @@ module Artoo
78
81
 
79
82
  # Unexports the pin in GPIO to leave it free
80
83
  def close
84
+ off! if @mode == 'w'
81
85
  File.open("#{ GPIO_PATH }/unexport", "w") { |f| f.write("#{pin_num}") }
82
86
  end
83
87
  end
@@ -186,23 +186,29 @@ module Artoo
186
186
 
187
187
  def initialize_connections(params={})
188
188
  @connections = {}
189
- connection_types.each {|ct|
190
- Logger.info "Initializing connection #{ct[:name].to_s}..."
191
- cp = params[ct[:name]] || {}
192
- c = Connection.new(ct.merge(cp).merge(:parent => current_instance))
193
- @connections[ct[:name]] = c
194
- }
189
+ connection_types.each {|type| initialize_connection(params, type, @connections)}
195
190
  end
196
191
 
197
192
  def initialize_devices(params={})
198
193
  @devices = {}
199
- device_types.each {|d|
200
- Logger.info "Initializing device #{d[:name].to_s}..."
201
- dp = params[d[:name]] || {}
202
- d = Device.new(d.merge(dp).merge(:parent => current_instance))
203
- instance_eval("def #{d.name}; return devices[:#{d.name}]; end")
204
- @devices[d.name.intern] = d
205
- }
194
+ device_types.each {|type| initialize_device(params, type, @devices)}
195
+ end
196
+
197
+ def initialize_connection(params, type, connections)
198
+ connection = initialize_object(Connection, params, type)
199
+ @connections[type[:name]] = connection
200
+ end
201
+
202
+ def initialize_device(params, type, devices)
203
+ type = initialize_object(Device, params, type)
204
+ instance_eval("def #{type.name}; return devices[:#{type.name}]; end")
205
+ @devices[type.name.intern] = type
206
+ end
207
+
208
+ def initialize_object(klass, params, type)
209
+ Logger.info "Initializing #{klass.to_s.downcase} #{type[:name].to_s}..."
210
+ param = params[type[:name]] || {}
211
+ klass.new(type.merge(param).merge(:parent => current_instance))
206
212
  end
207
213
 
208
214
  def execute_startup(things, &block)
@@ -1,5 +1,5 @@
1
1
  module Artoo
2
2
  unless const_defined?('VERSION')
3
- VERSION = "1.8.0"
3
+ VERSION = "1.8.1"
4
4
  end
5
5
  end
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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ron Evans
@@ -12,36 +12,36 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-08-04 00:00:00.000000000 Z
15
+ date: 2015-05-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: celluloid
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ">="
21
+ - - "~>"
22
22
  - !ruby/object:Gem::Version
23
- version: 0.16.0.pre
23
+ version: 0.16.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ">="
28
+ - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: 0.16.0.pre
30
+ version: 0.16.0
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: celluloid-io
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - ">="
35
+ - - "~>"
36
36
  - !ruby/object:Gem::Version
37
- version: 0.16.0.pre
37
+ version: 0.16.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - "~>"
43
43
  - !ruby/object:Gem::Version
44
- version: 0.16.0.pre
44
+ version: 0.16.0
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: http
47
47
  requirement: !ruby/object:Gem::Requirement
@@ -132,14 +132,14 @@ dependencies:
132
132
  requirements:
133
133
  - - '='
134
134
  - !ruby/object:Gem::Version
135
- version: 0.2.0
135
+ version: 0.4.1
136
136
  type: :runtime
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - '='
141
141
  - !ruby/object:Gem::Version
142
- version: 0.2.0
142
+ version: 0.4.1
143
143
  description: Ruby-based microframework for robotics
144
144
  email:
145
145
  - artoo@hybridgroup.com
@@ -154,6 +154,7 @@ files:
154
154
  - ".ruby-version"
155
155
  - ".travis.yml"
156
156
  - ".yardopts"
157
+ - CONTRIBUTING.md
157
158
  - CONTRIBUTORS.md
158
159
  - Gemfile
159
160
  - LICENSE
@@ -288,22 +289,5 @@ rubygems_version: 2.2.2
288
289
  signing_key:
289
290
  specification_version: 4
290
291
  summary: Ruby-based microframework for robotics
291
- test_files:
292
- - test/adaptors/adaptor_test.rb
293
- - test/adaptors/loopback_test.rb
294
- - test/api/api_routes_test.rb
295
- - test/api/api_test.rb
296
- - test/artoo_test.rb
297
- - test/connection_test.rb
298
- - test/delegator_test.rb
299
- - test/device_test.rb
300
- - test/drivers/driver_test.rb
301
- - test/ext/numeric_test.rb
302
- - test/interfaces/interface_test.rb
303
- - test/master_test.rb
304
- - test/port_test.rb
305
- - test/robot_test.rb
306
- - test/test_helper.rb
307
- - test/utility_test.rb
308
- - test/utility_test_cases.rb
292
+ test_files: []
309
293
  has_rdoc: