Sequel: The Database Toolkit for Ruby
Seems like a useful gem for cases where ActiveRecord is overkill but you don't want to do everything by hand either.
Related cards:
Connecting the "sequel" gem to MSSQL via ODBC
After you configured your ODBC describe in
- [Fix [RubyODBC]Cannot allocate SQLHENV when connecting to MSSQL 2005 with Ruby 1.8.7. on Ubuntu 10.10](https://makandracards.com/makandra/7553-fix-rubyodbc-cannot-allocate-sqlhenv-when-connecting-to-ms...
The DevIL Image Library For Ruby « Like Dream of Banister Fiend
DevIL is a fast and lightweight image library that supports the loading and saving of images in almost any graphics format. It also provides some basic image manipulation functionality.
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.
Install the SQLite 3 gem for Ruby under Ubuntu
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
Don't ever use the float type for database columns
Like in any language, a FLOAT
will eventually corrupt data due to rounding errors.
Please use DECIMAL
, which has [well-defined behavior for rounding and range overflows](https://makandracards.com/makandra/1177-how-decimal-columns-deal-with-nu...
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...
makandra/gemika: Helpers for testing Ruby gems
We have released a new library Gemika to help test a gem against multiple versions of Ruby, gem dependencies and database types.
Here's what Gemika can give your test's development setup (all features are opt...
Security issues with hash conditions in Rails 2 and Rails 3
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']
) or a hash (:conditions => { 'state' => 'draft' }
). The later is nicer to read, but has horrible security implications in some versions of Ru...
Sidekiq: How to check the maximum client Redis database size
You can check the maximum client Redis database size in Sidekiq with this command.
Sidekiq.redis { |redis| puts redis.info.fetch('maxmemory_human') }
#=> 512.00M
If you just want the maximum database size for a known Redis database ...
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',...