Configure RSpec to raise an error when stubbing a non-existing method

Posted Over 8 years ago by Henning Koch.
relishapp.com

You can configure RSpec 3.3+ to raise an error when attempting to stub or mock a non-existing method. We...

About Ruby's conversion method pairs

Posted Over 8 years ago by Dominik Schöler.
stackoverflow.com

Ruby has a set of methods to convert an object to another representation. Most of them come in explicit and...

Sending TCP keepalives in Ruby

Posted Over 8 years ago by Henning Koch.

When you make a simple TCP connection to a remote server (like telnet), your client won't normally notice when...

Fix "subprocess installed post-removal script returned error exit status ..." when installing/removing/updating a package with apt

Posted Over 8 years ago by Kim Klotz.

If you get an error like: subprocess installed post-removal script returned error exit status 78 when installing/removing/updating a package...

Test downstream bandwidth of Internet connection

Posted Over 8 years ago by Thomas Eisenbarth.

You want to test your 1GE or 10GE internet uplink? We needed to ensure we have full 10GE to the...

A case for Redactor

Posted Over 8 years ago by Dominik Schöler.

Redactor is yet another WYSIWYG editor. It definitely has its weak points, but I want to point out that it...

PostgreSQL: How to add/remove/modify array values (and how to replace 1 value with multiple values)

Posted Over 8 years ago by Arne Hartherz.
postgresql.org

PostgreSQL's array data type is pretty useful, but manipulating values of arrays can be awkward because of its syntax...

Keeping web applications fast

Posted Over 8 years ago by Tobias Kraze.

Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...

Heads up: Ruby implicitly converts a hash to keyword arguments

Posted Over 8 years ago by Dominik Schöler.
github.com

When a method has keyword arguments, Ruby offers implicit conversion of a Hash argument into keyword arguments. This conversion is...

Ruby: Do not mix optional and keyword arguments

Posted Over 8 years ago by Tobias Kraze.
makandracards.com

Writing ruby methods that accept both optional and keyword arguments is dangerous and should be avoided. This confusing behavior will...

Enumerators in Ruby

Posted Over 8 years ago by Tobias Kraze.

Starting with Ruby 1.9, most #each methods can be called without a block, and will return an enumerator. This is...

OR-ing query conditions on Rails 4 and 3.2

Posted Over 8 years ago by Arne Hartherz.
github.com

Rails 5 will introduce ActiveRecord::Relation#or. On Rails 4 and 3.2 you can use the activerecord_any_of gem...

Improving browser rendering performance

Posted Over 8 years ago by Dominik Schöler.

As the web is being used for more and more tasks, expectations rise. Not only should web pages offer rich...

Regain unused disk space from OpenStack instances

Posted Over 8 years ago by Kim Klotz.

This is how you regain disk space from OpenStack instances if you are using kvm and qcow. If your instance...

Angular: Quick and easy animation on changed binding value

Posted Over 8 years ago by Dominik Schöler.
stackoverflow.com

With ngAnimate, you can easily animate certain events (see directive support). We'll make use of ngClass animations to style...

Error installing gem with native extension (collect2: error: ld returned 1 exit status)

Posted Over 8 years ago by Kim Klotz.

If you have problems installing a gem and get a error collect2: error: ld returned 1 exit status it's...

natritmeyer/site_prism

Posted Over 8 years ago by Henning Koch.
github.com

SitePrism gives you a simple, clean and semantic DSL for describing your site using the Page Object Model pattern, for...

httpbin: HTTP Client Testing Service

Posted Over 8 years ago by Henning Koch.
httpbin.org

Some dozen generic API endpoints you can use to test how your HTTP client deals with various responses, e.g.

Pitfall: has_defaults on virtual attributes are nil when loaded from database, of course …

Posted Over 8 years ago.

It smells. Rethink your code design. Code example with makandra/has_defaults: class Post < ActiveRecord::Base has_defaults tags: [] # field in db...

Continuous Security Testing with Devops - OWASP EU 2014

Posted Over 8 years ago by Henning Koch.
slideshare.net

Interesting talk about a team that integrated automated security testing into their BDD workflow. There is also a video of...

passenger problems with upgraded rails-app

Posted Over 8 years ago by Claus-Theodor Riegg.

You may encounter problems with passenger starting an application with an updated rails. If you find an error like this...

postgresql create extension without giving the application superuser rights

Posted Over 8 years ago by Kim Klotz.

If you need a postgresql extension for your database it isn't a good idea to give your applications database...

How to deal with 'parent id missing' error in nested forms

Posted Over 8 years ago.

Use form models to handle this problem Or soften the validation to validates_presence_of :parent

How to split config/routes.rb in Rails 4

Posted Over 8 years ago by Dominik Schöler.

A word of caution There should rarely be a reason for you to split up config/routes.rb. If you need to...