Opal, A new hope (for Ruby programmers)
Opal is a source to source ruby to javascript compiler, corelib and a runtime implementation that currently passes 3000 rubyspecs w/a reachable goal of passing them all.
Related cards:
Ruby: define a class with Struct.new
This card will show you a cool way to define a class using Struct.new.
A common usecase for Structs are temporary data structures which just hold state and don't provide behaviour. In many cases you c...
Ruby: A small summary of what return, break and next means for blocks
Summary
- Use
return
to return from a method.return
accepts a value that will be the return value of the method call. - Use
break
to quit from a block and from the method that yielded to the block.break
accepts a value that suppl...
metric_fu: A Ruby Gem for Easy Metric Report Generation
Metric_fu is a set of rake tasks that make it easy to generate metrics reports. It uses Saikuro, Flog, Flay, Rcov, Reek, Roodi, Subversion, Git, and Rails built-in stats task to create a series of reports. It's designed to integrate easily with Cr...
Ruby: How to use global variables for a conditional debugger
You can share a state in Ruby with global variables. Even if you should avoid them whenever possible, for debugging an application this could be temporary quite handy.
Exa...
A collection of useful design resources for developers
This collection contains some useful design resources for developers. Many of them were mentioned in the Refactoring UI tutorials.
Tutorials
- Refactoring UI Videos
- [Refactori...
Maximum representable value for a Ruby Time object
On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07
in UTC or 2038-01-19 04:14:07
in CET. If you try to instantiate a Time
with any later value, Ruby will raise an ArgumentError
.
If you ...
httpclient: A Ruby HTTP client for serious business
While debugging an intricate issue with failed HTTP requests I have come to appreciate the more advanced features of the httpclient Rubygem.
The gem is much more than a lightweight wrapper around Ruby's `net/...
What is a reduction and why Fibers are the answer for Ruby concurrency | julik live
The linked article provides a good overview of the various concurrency primitives in Ruby, and what's changing in Ruby 3.
djberg96/sys-filesystem: A Ruby library for getting filesystem information
Uses FFI and works all relevant operating systems.
If you'd try to do it yourself, you'd have to use FFI which is a bit awkward (see the gem's code), or call commands like df -B1
and search the strings for your relevant data.
That gem takes the...