Ruby language support
-
Today I've received my Onion and extensions pack. Thanks a lot for a wonderful product! Extremely well done!
I would like to know if you have any plans for Ruby language wrappers for GPIO and extensions? There is no need for exact release date, just say if you have them in plan or notP.S. You must by damn busy trying to polish all the things and release new features, but it would be nice if you could publish some roadmap for the Onion feature.
Thanks once again!
-
Yeah, Ruby is in our roadmap. We are just focusing on the wrapper for Python and NodeJS for now. Once those are done, we'll be working on the wrappers for PHP and Ruby.
-
You can start with just falling back to terminal commands until the library is ready
First, install Ruby
opkg update opkg install ruby ruby-irb
Then do something like this
root@Omega-271C:~# irb irb(main):001:0> `fast-gpio read 8` => "> Read GPIO8: 1\n" irb(main):002:0> `fast-gpio set 8 0` => "> Set GPIO8: 0\n" irb(main):003:0> `fast-gpio read 8` => "> Read GPIO8: 0\n" irb(main):004:0> `fast-gpio set 8 1` => "> Set GPIO8: 1\n" irb(main):005:0> `fast-gpio read 8` => "> Read GPIO8: 1\n"
-
Then you can wrap it in a function to abstract it away
irb(main):007:0> def gpio_read(pin) irb(main):008:1> `fast-gpio read #{pin}`.split.last == "1" irb(main):009:1> end => :gpio_read irb(main):010:0> gpio_read(8) => false
I guess i could quickly build a thin lib for this. will let you know if I do.
-
After installing ruby, I've taken up 68% of space.
I think i only explicitly installed ruby, ruby-readline, ruby-openssl, ruby-irb and ruby-gems. Other packages were sucked in as dependencies.root@Omega-271C:~# opkg list-installed ruby* ruby - 2.2.3-1 ruby-bigdecimal - 2.2.3-1 ruby-cgi - 2.2.3-1 ruby-datetime - 2.2.3-1 ruby-dbm - 2.2.3-1 ruby-debuglib - 2.2.3-1 ruby-digest - 2.2.3-1 ruby-enc - 2.2.3-1 ruby-enc-extra - 2.2.3-1 ruby-erb - 2.2.3-1 ruby-filelib - 2.2.3-1 ruby-gems - 2.2.3-1 ruby-irb - 2.2.3-1 ruby-json - 2.2.3-1 ruby-math - 2.2.3-1 ruby-misc - 2.2.3-1 ruby-multithread - 2.2.3-1 ruby-net - 2.2.3-1 ruby-openssl - 2.2.3-1 ruby-optparse - 2.2.3-1 ruby-patterns - 2.2.3-1 ruby-prettyprint - 2.2.3-1 ruby-pstore - 2.2.3-1 ruby-psych - 2.2.3-1 ruby-racc - 2.2.3-1 ruby-rake - 2.2.3-1 ruby-rbconfig - 2.2.3-1 ruby-rdoc - 2.2.3-1 ruby-readline - 2.2.3-1 ruby-socket - 2.2.3-1 ruby-uri - 2.2.3-1 ruby-yaml - 2.2.3-1 ruby-zlib - 2.2.3-1 root@Omega-271C:~# df Filesystem 1K-blocks Used Available Use% Mounted on rootfs 8640 5896 2744 68% / /dev/root 6656 6656 0 100% /rom tmpfs 30588 448 30140 1% /tmp /dev/mtdblock3 8640 5896 2744 68% /overlay overlayfs:/overlay 8640 5896 2744 68% / tmpfs 512 0 512 0% /dev
-
Andrei - I don't know if this helps, but your comments were so helpful I wanted to mention this. I've had ruby installed and didn't see a lot of additional dependencies. I just now installed ruby-irb and saw that opkg installed a whole bunch of ruby-related stuff.
opkg install ruby-irb
Installing ruby-irb (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-irb_2.2.4-1_ar71xx.ipk.
Installing ruby-debuglib (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-debuglib_2.2.4-1_ar71xx.ipk.
Installing ruby-multithread (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-multithread_2.2.4-1_ar71xx.ipk.
Installing ruby-misc (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-misc_2.2.4-1_ar71xx.ipk.
Installing ruby-prettyprint (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-prettyprint_2.2.4-1_ar71xx.ipk.
Installing ruby-filelib (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-filelib_2.2.4-1_ar71xx.ipk.
Installing ruby-enc (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-enc_2.2.4-1_ar71xx.ipk.
Installing ruby-math (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-math_2.2.4-1_ar71xx.ipk.
Installing ruby-patterns (2.2.4-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/ruby-patterns_2.2.4-1_ar71xx.ipk.
Configuring ruby-enc.
Configuring ruby-misc.
Configuring ruby-filelib.
Configuring ruby-multithread.
Configuring ruby-patterns.
Configuring ruby-math.
Configuring ruby-prettyprint.
Configuring ruby-debuglib.
Configuring ruby-irb.