Module: Lunchbox::Tasks
- Defined in:
- lib/lunchbox/tasks.rb
Defined Under Namespace
Classes: Environment
Constant Summary collapse
- E =
Environment.new
Instance Method Summary collapse
- #autodetect! ⇒ Object
- #cpu(cpu) ⇒ Object
- #hardware_uart! ⇒ Object
- #have_crystal! ⇒ Object
- #use(lib) ⇒ Object
Instance Method Details
#autodetect! ⇒ Object
133 134 135 136 137 138 139 140 141 142 |
# File 'lib/lunchbox/tasks.rb', line 133 def autodetect! re = /\A#include <(lunchbox|lunchbox\/([^>]*))\.h>/ i = File.readlines('src/main.c').grep(re) { |inc| $2 || $1 } (%w{ lunchbox port dht } & i).each do |lib| use lib end end |
#cpu(cpu) ⇒ Object
113 114 115 |
# File 'lib/lunchbox/tasks.rb', line 113 def cpu cpu E.cpu = cpu end |
#hardware_uart! ⇒ Object
125 126 127 |
# File 'lib/lunchbox/tasks.rb', line 125 def hardware_uart! E.hardware_uart! end |
#have_crystal! ⇒ Object
129 130 131 |
# File 'lib/lunchbox/tasks.rb', line 129 def have_crystal! E.have_crystal! end |