I was trying to get the Arduino IDE to work inside a Docker container on OS X. I was able to get the IDE working (see Getting X11 GUI applications to work on OS X with Docker), but I could not figure out how to make the USB port for the Arduino visible.
I first tried to directly map hardware serial port into the Docker container, doing something like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern mod extra; | |
use extra::json::*; | |
/* | |
* This function manages to do absolutely no copying, which is pretty cool. | |
* | |
* "What are all those `'r`s?" you ask. Well, they're liftime parameters. They | |
* indicate how long something lasts (before it's freed). They can't change how | |
* long something lives for, they only allow you to tell the compiler stuff it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Acts | |
module Cacheable | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
def acts_as_cacheable(key, options = {}) | |
extend Acts::Cacheable::SingletonMethods | |
find(:all, options).each{|instance| cached_objects[instance.send(key).to_s] = instance} |