Introducing Helix: Rust + Ruby, Without The Glue
Helix Show archive.org snapshot allows you to implement performance-critical code of your Ruby app in Rust, without requiring glue code to bridge between both languages.
See attached article Show archive.org snapshot for a longer write-up about the why and how.
Related cards:
Introducing RMM, the Rails Maturity Model - Ruby on Rails meets the business world | Google Groups
A couple of Railsconfs ago, Courtenay and I did indeed discuss
Change the current directory without side effects in Ruby
To temporarily change the current working directory in Ruby, call Dir.chdir
with a block. The previous working directory will be restored when the block ends:
Dir.chdir('/usr/local') do
# do stuff in /usr/local
end
Ruby constant lookup: The good, the bad and the ugly
In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.
The good
E. g. in the following example, Array
could mean either Foo::Array
or simply Array
:
class Fo...
Ruby: Using the pry debugger in projects with older Ruby versions
In case you want to use pry with an older version of Ruby, you can try the following configurations.
Ruby 1.8.7
Your pry
version must not be greater than 0.9.10
.
gem 'pry', '=0.9.10'
gem 'ruby-debug',...
Ruby Scripts: Select the Ruby version in the shebang
As Bill Dueber has on his blog, you can call rvm
in the shebang to select a Ruby version like this:
#!/usr/bin/env rvm 1.9 do ruby
Standard arguments to do
apply, see $> rvm help do
.
Ruby, Ruby on Rails, and _why: The disappearance of one of the world’s most beloved computer programmers
Nice article to educate your non-geek girlfriend/boyfriend about the joys of programming.
James on Software | Introducing Trample: A Better Load Simulator
Trample is a more flexible load simulator. Instead of a static list of urls, trample's configuration language is ruby. Using ruby's blocks (lambda functions), it's possible to randomize the requests that get made in each thread, as well as the use...
Version 5 of the Ruby Redis gem removes Redis.current
Redis.current
will be removed without replacement in redis-rb
5.0.
Version 4.6.0 adds deprecation warnings for Redis.current
and Redis.current=
:
`Redis.current=` is deprecated and will be removed in 5.0.
If your application still ...
The many gotchas of Ruby class variables
TLDR: Ruby class variables (@@foo
) are dangerous in many ways. You should avoid them at all cost. See bottom of this card for alternatives.
Class variables are shared between a class hierarchy
---------------------------------------------------...
Freeze (vendor, unpack) a single Ruby gem with and without Bundler
When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the vendor/gems
directory of your Rails project. You can then make any changes you require and Rails will use the vendored version of the gem after a serve...