Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #8 from ejholmes/autoload-components

Autoload components.
  • Loading branch information...
commit 2da564ce41c47fbe92fe3d203f4b0e2350d8e35f 2 parents 380dd21 + 1c7900e
@dam5s dam5s authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.