🚀 See the 2024 Ruby on Rails Community Survey results!

Development Posts

Article  |  Development

The Pros and Cons of Modular Sass

7 Jan 2014

Using modular Sass

In the past year or so, the front-end developers at Planet Argon have taken more of a modular approach to writing CSS. This means writing CSS in a way that promotes forward-thinking, scalability, and ease of development. Before I get into the pros and cons, here’s a quick example of the difference between a modular and non-modular approach.

Continue Reading

Article  |  Development

Epicodus - What are the Students Saying? Part 1

6 Nov 2013

Throughout this week I’ll be posting my interviews with three students from local code school, Epicodus. They’ll talk about their experiences with the program and how they have been growing as web developers in the past few months.

With the emergence of of code schools in recent years, it can be hard to keep track of them all. Which ones should we be paying attention to as potential employers or students? I wanted to delve a little deeper and take a look at how current students felt about the program.

Today we hear from Braden O’Guinn and his experience with Epicodus.

Continue Reading

Article  |  Development

OS X Mavericks, failing specs and libxml

24 Oct 2013

After an OS X upgrade from 10.8 to 10.9, I noticed some previously-passing Capybara specs were failing. The failing specs all shared a similar structure:

  it 'should show some text in the 2nd tr' do
     visit some_path
     page.should have_selector('tr:nth-child(2)', text: 'some text')
  end

Notice nth-child pseudo-selector; this seemed likely to be involved as other specs using have_selector with plain class selectors continued to pass.

I applied a number of patches that folks seem to be performing on their new 10.9 installs (installed XCode 5.0.1 and then dev tools via xcode-select --install, running brew updates, etc) and nothing changed. What led me to a solution was this Nokogiri Github issue from the Mountain Lion release:

https://github.com/sparklemotion/nokogiri/issues/742

I ran one of my failing specs with the DYLD_PRINT_LIBRARIES=1 flag mentioned in this issue:

dyld: loaded: /usr/lib/libxml2.2.dylib
dyld: loaded: [repo]/vendor/ruby/1.9.1/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0/lib/libxml2.2.dylib

As the issue suggests, I added a reference to Nokogiri directly below Rails in my Gemfile (it did not have an explicit reference in the Gemfile before this). After that, I see this load order:

dyld: loaded: [repo]/vendor/ruby/1.9.1/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0/lib/libxml2.2.dylib
dyld: loaded: /usr/lib/libxml2.2.dylib

With the libxml dylib loaded first from the bundled Nokogiri, my specs pass again.

Continue Reading

Article  |  Development

Neil's Three Favorite Wicked Good Ruby Talks

21 Oct 2013

Last week Neil ventured to Boston for the inaugural Wicked Good Ruby Conf, an event drawing technologists from many disciplines who share a common trait: it was for those who love Ruby and use it to get work done. The two-day, two-track event provided a rich array of talks, from the pragmatic and studied, to the irreverent, theoretical and forward-looking. It speaks to the ambition of the conference that within its span, one could learn how to fine-tune a Rails backend, learn the innards of a linotype machine, use one language to bridge the chasm between desktop and mobile, predict capital market behaviors, and see how JRuby might come to eat the world. Here are his favorite three.

  1. MRI Magic Tricks by Charlie Somerville

    A hacker's hacker, Charlie used his time to decimate the Ruby language, peeling off the layers of the MRI implementation and revealing what it takes to build a dynamic language with the flexibility and power of Ruby. His initial caveat of "Don't try this at home" set the tone, as he proceeds to exhume the secret core classes of MRI, and use his findings (with some clever dynamic programming) to redefine some of the language's most basic behaviors, such as hash construction and method aliasing. He concludes by rewriting class hierarchies at runtime and patching the language to rescue itself from pesky segmentation faults.

  2. RubyMotion: Under the Hood by Joshua Ballanco

    Joshua's talk was the kind that adds to the depth and breadth of your knowledge. He uses RubyMotion, the increasingly popular iOS development platform, to convey some of the core abilities and limitations of code execution on desktop and mobile devices. He details the work that went into MacRuby on the OSX platform, highlighting the balance achieved through direct source compilation and the OSX Ruby VM. He then notes why RubyMotion relies on direct compilation alone: the memory isolation inherent in iOS. Meanwhile, we learn some of the nuances of garbage collection and reference counting on those platforms, and when one would need to be explicit in writing mobile Ruby code that interacts pleasantly with ARC. The power of these parallel platforms becomes more clear as he hits the REPL to express the same objects in both Objective-C and Ruby.

  3. Understanding Ruby's Method Cache by Rachel Myers and Sheena McCoy

    As as web developer, you typically would spend your time optimizing for reduced network and backend invocations, and so it was a nice break to get an introduction to language-level caching with Ruby. Rachel and Sheena led us down this path with a sense of humor and copious Jurassic Park references. We start with method-caching (or lackthereof) in Ruby 1.8, how everything changes in 1.9 with the merge of of the YARV implementation, and what lies ahead for more advanced, context-sensitive caching. Tips to avoid invalidating your cache are presented (hint: don't go crazy with define_method, alias_method, openstruct, refinements, etc), and we get a clear picture of how Ruby is evolving alongside its big-brother languages.

Continue Reading

Article  |  Development

A chat with Ken Stowell - local Javascript expert from Metal Toad

7 Oct 2013

I’ve been scouring the internet to find some folks in our fair city of Portland, OR who are willing to talk about their developer experience.

I was lucky enough to connect with Ken Stowell of Metal Toad Media. Metal Toad Media has an agency here in Portland as well as L.A. and San Francisco.

Ken lives here with us in Portland and was happy to answer my questions. I was hoping to learn a little more about Javascript developers and how developer interns like me could find our way into the industry.

Ken Stowell

Continue Reading

Have a project that needs help?