Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Standup 8/17: RubyMine rebase issues and Ruby truthiness

Interesting Things


You can’t make something “falsy” in ruby. For example, let’s say you are a good Fowlerite and you are implementing a nil object pattern like so:

class User; end

class NilUser
  def nil?() true end

user =

if user
  puts "Access Approved"
  puts "Access Denied"

If you run that code, even though you’ve defined .nil? to be true, it will print “Access Approved”. Ruby if/unless/else only recognize nil and false to be “falsey”.

RubyMine rebase strangeness

When you rebase from the command line and get a merge error, then run the merge tool from RubyMine, the “Your changes” and “Their changes” will be the reverse of what you might think. If you are accustomed to clicking “accept theirs” to mean taking other people’s changes, you’ll be in for a surprise.

If you botch the git rebase, you can always go back with this awesome git command, brought to you by Peter Jaros:

git reset --hard "master@{ 1 }"

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *