Browse files

autoload components.

  • Loading branch information...
1 parent 5f2b6c6 commit 1c7900ec6f64c6960de27217b16d8691c3ae1857 @ejholmes ejholmes committed Nov 10, 2012
Showing with 13 additions and 12 deletions.
  1. +1 −12 lib/dino.rb
  2. +12 −0 lib/dino/components.rb
View
13 lib/dino.rb
@@ -2,15 +2,4 @@
require 'dino/version'
require 'dino/tx_rx'
require 'dino/board'
-
-require 'dino/components/base_component'
-require 'dino/components/led'
-require 'dino/components/button'
-require 'dino/components/sensor'
-require 'dino/components/rgb_led'
-require 'dino/components/servo'
-require 'dino/components/stepper'
-require 'dino/components/ir_receiver'
-
-module Dino
-end
+require 'dino/components'
View
12 lib/dino/components.rb
@@ -0,0 +1,12 @@
+module Dino
+ module Components
+ require 'dino/components/base_component'
+ autoload :Led, 'dino/components/led'
+ autoload :Button, 'dino/components/button'
+ autoload :Sensor, 'dino/components/sensor'
+ autoload :RgbLed, 'dino/components/rgb_led'
+ autoload :Servo, 'dino/components/servo'
+ autoload :Stepper, 'dino/components/stepper'
+ autoload :IrReceiver, 'dino/components/ir_receiver'
+ end
+end

0 comments on commit 1c7900e

Please sign in to comment.