Rethinking PDF Creation in Ruby
We're excited to announce PDFKit, an open source library that makes working with wkhtmltopdf a snap.
Related cards:
Ruby Ghostscript by Shairon Toledo
Ruby Ghostscript (RGhost) is a library for document developers wanting a quick and easy way to generate pdf files. It's optimized to work with larger documents.
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: Retrieving and processing files via Selenium and JavaScript
This card shows an uncommon way to retrieve a file using selenium where JavaScript is used to return a binary data array to Ruby code.
The following code example retrieves a PDF but the approach also works for other file types.
require "s...
Ruby tempfiles
Tempfiles get deleted automatically
With the the ruby Tempfile class you can create temporary files. Those files only stick around as long as you have a reference to those. If no more variable points to them...
Fix "An error occurred while installing debugger-linecache" with Ruby 1.9.3
You're better off using debugger-ruby_core_source
:
gem install debugger-ruby_core_source
If you can't do this, try the following.
Here is how to fix the following error when installing the debugger
gem fails:
Gem::Instal...
.rvmrc deprecated in favor of .ruby-version and .ruby-gemset
Do not use .rvmrc
files to specify Ruby version and gemset configuration any longer, it's deprecated and not considered by other Ruby version managers such as rbenv.
If you want to migrate an existing .rvmrc
you can use `rvm rvmrc to .ruby-ve...
Ruby bug: Symbolized Strings Break Keyword Arguments in Ruby 2.2
TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby 2.2.3 and 2.3.
Specifically, when …
- there is a method with several keyword arguments and a double-splat a...
Different behavior for BigDecimal#floor in Ruby 1.8 and Ruby 1.9
Ruby 1.8 (supplied by Rails' ActiveSupport)
>> BigDecimal.new("0.1").floor.class
=> BigDecimal
Ruby 1.9 (supplied by Ruby 1.9 itself)
>> BigDecimal.new("0.1").floor.class
=> Fixnum
In fact, Float#floor
has changed from [...
Traveling Ruby: self-contained, portable Ruby binaries
Traveling Ruby is a project which supplies self-contained, "portable" Ruby binaries: Ruby binaries that can run on any Linux distribution and any OS X machine. This allows Ruby app developers to bundle these binaries with their Ruby app, so that...