Ruby On Rails

Week of May 13 - May 19, 2013 The master code is, as one would expect, in upheaval again. This week featured a big rewrite of callback internals, though I haven't sussed out whether it changes any features in that area. 3073c531 adds...
Week of May 13 - May 19, 2013 The master code is, as one would expect, in upheaval again. This week featured a big rewrite of callback internals, though I haven't sussed out whether it changes any features in that area. 3073c531 adds Minitest 5 compatibility to Rails 4.
26 minutes ago
migrating from iPhoto to Dropbox, from feature rich to future proof - I'm starting to think it's time to get off of OS/X. Walled gardens do not attract me. New gem released: Futuroscope! - Run selected operations on background threads w...
migrating from iPhoto to Dropbox, from feature rich to future proof - I'm starting to think it's time to get off of OS/X. Walled gardens do not attract me. New gem released: Futuroscope! - Run selected operations on background threads with very little change to your code.
35 minutes ago
I was asked to develop a prototype app for one of our clients lately. The basis for this app was an old Rails app:Rails 3.2.8 RailsAdmin MySQL rbenv + ruby-build I wanted to upgrade the stack to work with latest toys all cool kids are so...
I was asked to develop a prototype app for one of our clients lately. The basis for this app was an old Rails app:Rails 3.2.8 RailsAdmin MySQL rbenv + ruby-build I wanted to upgrade the stack to work with latest toys all cool kids are so thrilled about. I also didn’t have Rails console facility at my disposal since the Ruby version installed on the development machine hadn’t been compiled against libreadline.Not having root or sudo access on the machine I embarked on a sligthly hacky journey to make myself a better working environment.Ruby 2.0After reading Mike Farmer’s blog post about Ruby 2.0 and tons of other material about it on the Internet, I wanted to get a feeling of how faster & greater the new Ruby is. It’s always great also to stay up-to-date with latest technologies. It’s great for me as a developer, and more importantly - it’s great for our clients.Importance of libreadline in development with RubyTo be productive developing any Rails-based application, we have to have Rails-console available at any moment. It serves a multitude of purposes. It’s also a great scratch-pad when developing methods.While you don’t need your Ruby to support libreadline for basic uses of irb, you need it when using with Rails.Installing Ruby 2.0.0 with rbenv (ruby-build)If you’ve installed ruby-build some time ago, chances are that you need to update it in order to be able to install latest build of Ruby 2.0.0To do it:cd ~/.rbenv/plugins/ruby-build git pull And you should be able now to have available latest Ruby build to install:rbenv install 2.0.0-p195 If you want to install Ruby compiled with support for libreadline, you have to have it installed in your system before compiling the build with rbenv install.If you have access to root or sudo on your system, the easiest way is to e. g:on Debian-related Linuxes:apt-get install libreadline-dev or on Fedora:yum install readline-devel Installing libreadline from sourcesIn my case - I had to download sources and compile them myself. Luckily the system had all needed essential packages installed for building it.wget "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz" tar xvf readline-6.2.tar.gz cd readline-6.2 ./configure --prefix=/home/kamil/libs make make install I had to specify –prefix option pointing at the path where I wanted the libreadline library to be installed after compilation.Then, I was able to actually build Ruby with readline support “on”:CONFIGURE_OPTS="--with-readline-dir=/home/kamil/libs" rbenv install 2.0.0-p195 Notice: I was making myself a development environment and compiling from sources was my last resort. It is not a good practice for production environments. Last thing I needed to do was to get rb-readline working with the project I was working on.It turnes out that latest rb-readline doesn’t play well with latest Ruby. Also, when using Ruby 2.0.0 one have to explicitely specify it in the Gemfile, or else it won’t be loaded for the console.Gemfile:gem 'rb-readline', '~> 0.4.2' This still isn’t perfectWhile this setup works, it won’t let you use arrow keys. The irb process crashes quickly after even first try to navigate through the text.For some reason, after upgrading Ruby, the RailsAdmin stylesheets stopped working. I noticed that they are being served with comments which should be replaced by other stylesheets like:/* ... *= require_self *= require_tree . */ I had to update Rails version in the Gemfile to have my admin back:Gemfile:gem 'rails', '3.2.13' Console:bundle Last thing I wanted to do, was to try if I could upgrade Rails even further and have a working Rails4 setup. This was impossible unfortunately since RailsAdmin isn’t yet compatible with it as stated here.I conclude that latest Ruby is quite usable right now. If you don't mind the quirks with the readline - you're pretty safe to upgrade. This assumes though that your app doesn't use any incompatibl
3 days ago
I spent this week with the team of engineers who made Riak on Engine Yard Cloud possible, attending RICON East: all Distributed Systems, all the time. Later in the week we took advantage of being in New York City to visit local customers...
I spent this week with the team of engineers who made Riak on Engine Yard Cloud possible, attending RICON East: all Distributed Systems, all the time. Later in the week we took advantage of being in New York City to visit local customers and discuss the various features we’re working on and field any technical, product, and data questions. Both our engineering and product teams love incorporating customer feedback into our direction. Speaking of which -- if you’re in San Francisco, I’m organizing customer UX feedback sessions! Hit me up :) --Tasha Drew, Product Manager Engineering Updates PHP is now GA on Engine Yard Cloud! Per Product Manager Noah Slater: “PHP has been an important part of Engine Yard’s growing family since the acquisition of Orchestra in 2011. And now, PHP on Engine Yard Cloud represents the culmination of our efforts to deliver the industry’s best Platform as a Service for PHP developers. The result of this work is a unified service offering for PHP, Node.js, and Ruby applications.” Read all about the GA launch announced by Davey Shafik at php[tek] in Chicago this week! Data Data Data Riak and Clusters are live! See our blogpost for more info - https://blog.engineyard.com/2013/riak-is-ga-engine-yard A cluster is a new way to organize and manage instances that share a specific function.  Clusters take much of the functionality that was once placed at the environment level, and moves it down to the cluster level. One environment can have many clusters, and each cluster can run different cookbooks and be in different regions. We drove the cluster model hand in hand with our productization of Riak on Cloud because the distributed model of Riak paired perfectly with where we wanted to drive the future of our platform. We can now take this underlying work and begin to re-productize other offerings to take advantage of its flexibility in many ways. Social Calendar (Come say hi!) Tuesday May 20th: Engine Yard Dublin hosts the PHP meetup where Eugene Kenny, Adverts.ie discusses his "Developer Toolbox", and then Matthew Weier O'Phinney of Zend Framework & Nate Abele of Lithium go head to head on the subject of Frameworks. Wednesday May 21st: Engine Yard’s San Francisco HQ will be hosting the monthly Riak meetup! Lead data engineer and fan favorite Ines Sombra will be presenting about Riak on Engine Yard Cloud, followed by Basho’s Mark Phillips discussing Riak CS. Wednesday May 21st: Our PDX office will be hosting Coder Dojo for students K-12 to learn about software! Grab a ticket and bring your parents for some software fun. Thursday May 22nd: Engine Yard Dublin plays host to Open Data Ireland, “Give us our health data!” Friday May 23rd: In which I talk about myself in the 3rd person? Tasha Drew will be speaking at Cloud East in Cambridge, UK, about deployments in the cloud, including various strategies we at Engine Yard see for environments of different sizes -- and concluding with sharing our own deployment strategy. Articles of Interest  Lightweight screenshot and annotation tool http://glui.me/ has gained some fans in our office! Engine Yard friend Daragh Curran, Head of Product Engineering, Intercom shared an awesome blog here. “Shipping brings life to your team, to your product, and to your customers. Shipping is your company’s heartbeat.”
3 days ago
Today's episode covers a major release for minitest, some JSON standards work, a tutorial on tagging with ActiveRecord and Postgres (plus an arduino to trigger the spray paint can), a RubyMotion tutorial and a little thing called CoVim t...
Today's episode covers a major release for minitest, some JSON standards work, a tutorial on tagging with ActiveRecord and Postgres (plus an arduino to trigger the spray paint can), a RubyMotion tutorial and a little thing called CoVim that will blow your mind. Listen to this episode on Ruby5 This episode is sponsored by New Relic New Relic is _the_ all-in-one web performance analytics product. It lets you manage and monitor web application performance, from the browser down to the line of code. With Real User Monitoring, New Relic users can see browser response times by geographical location of the user, or by browser type. Ruby Security Patches Ruby 1.9.3-p429 and Ruby 2.0.0-p195 were released, to fix the security issue: Object taint bypassing in DL and Fiddle in Ruby (CVE-2013-2065) minitest 5.0.0 released Minitest had a major release with a really important change. MiniTest is now Minitest. Check out all the breacking details in the release notes. jsonapi.org jsonapi.org proposes a work-in-progress standard for JSON APIs. See also Nathan Esquenazi's Conforming to jsonapi.org format wiki. Tagging With ActiveRecord and Postgres Use PostgreSQL's array feature, along with ActiveRecord 4's array support to implement tagging in your Rails app. RubyMotion Authentication Tutorial Luca Tironi has written part one of a tutorial post on using Devise for RubyMotion Authentication which includes an example of using Clay Allsop's Formotion. CoVim Can you believe it! Real-time, multi-user collaboration in vim. CoVim is a plugin that makes it possible.
3 days ago
Test::Page - Page-oriented integration testing for ruby. Upgrading to Sublime Text 3 - Step by step guide to getting on the beta version. Introducing ProMotion, a Full-Featured RobyMotion Application Framework - Abstracting screen and ...
Test::Page - Page-oriented integration testing for ruby. Upgrading to Sublime Text 3 - Step by step guide to getting on the beta version. Introducing ProMotion, a Full-Featured RobyMotion Application Framework - Abstracting screen and navigation handling in a rubylike way.
3 days ago
BubbleConf: One day of ideas and action with the most vocal minds from tech, design, UX and business. On october 12th 2012, we had the pleasure of co-organizing BubbleConf with our friends from Nedap and Teixido: the very first conferen...
BubbleConf: One day of ideas and action with the most vocal minds from tech, design, UX and business. On october 12th 2012, we had the pleasure of co-organizing BubbleConf with our friends from Nedap and Teixido: the very first conference in Amsterdam aimed at designers, developers and entrepreneurs that was actually affordable for (bootstrapped) startups to attend[1]. We were blown away by the positive reception for our very first conference: 400 people put their trust in us in delivering an unforgettable day full of ideas and inspiration to apply to their own worklife. After reviewing the post conference survey, we were super excited to see so many people demanding a 2013 edition. So without further ado, we’re pleased to announce that we’ll be doing a 2013 edition on September 27th 2013 so be sure to save the date! It will be held in Amsterdam once more, but we’ll be switching venues this time around to keep things exciting and fresh. The Tuschinski Theater had already set the bar quite
4 days ago
Note: Engine Yard friend Daragh Curran, Head of Product Engineering, Intercom has graciously let us post this great piece about code deployment on our blog. Check it out on their own blog here. Software only becomes valuable when you sh...
Note: Engine Yard friend Daragh Curran, Head of Product Engineering, Intercom has graciously let us post this great piece about code deployment on our blog. Check it out on their own blog here. Software only becomes valuable when you ship it to customers. Before then it's just a costly accumulation of hard work and assumptions. Shipping unlocks a feedback loop that confirms or challenges those assumptions. It makes new things possible for your customers, and gives you the opportunity to focus on the next thing. Shipping brings life to your team, to your product, and to your customers. Shipping is your company's heartbeat. Shipping will try to kill you The scramble to get that one last feature done, the late nights, the compromises, the sinking feeling when we realise something major is broken, the post-mortems… It's agony, but if it was easy everyone would do it. Shipping exposes mistakes. We're nervous about it, and our natural reaction is to do it reluctantly and infrequently, which actually carries higher risk, causing more reluctance in the future. The cost of shipping is approaching zero Not too long ago, shipping software involved actual ships, disks, and printed manuals. It happened perhaps once a year. Bug fixes weren't automatic over the internet like today. Everything was slower and more controlled. The cost of shipping was massive, the consequence of a mistake was large. Today, the cost of shipping has approached zero. Most people can deploy in seconds or minutes with a single command or button click. With a little thought you can do that without your customers noticing, and with automated monitoring you'll find out immediately if something goes wrong. Despite the cost of shipping approaching zero, many people still ship software guided by very old habits. Shipping cadence defines your company The cadence at which you ship defines your company. A yearly cadence results in a very structured approach to the design->build->test cycle. A few months of building, while the rest is spend fixing. Engineers can join and leave before seeing their hard work end up in the hands of customers. The approach to design becomes one of anticipating all possible needs, rather than focusing and iterating on the important ones. Obstacles downstream propagate upstream An obstacle downstream propagates upstream. If you're not allowed to implement new ideas, you stop having them. - Paul Graham The right approach to shipping has a positive influence on your company's productivity and your team's happiness & job satisfaction. Shipping infrequently is an obstacle. Ship slow, and you'll introduce challenges that push you to ship even slower. Ship frequently, and see positive effects everywhere in your company. For example, lets examine how behaviour changes along with shipping frequency, while handling a simple request from a customer. Lets say a customer gets in touch to say "No matter what I do, I cannot save my name correctly, I think it doesn't like hyphens". In a company where you ship continuously, you see this and think Simple — I'll tweak a test and a regex pattern, get a quick code review from my buddy beside me, merge to mainline, and 1 minute later when it's deployed to production, reply to the customer: "Sorry about this, it's fixed now, thanks for letting us know". They'll reply: "Wow, thanks for fixing so quickly". High fives all around! If we stretch the time to production (TTP) out a little, even to 10 minutes, the behaviour changes. You either do the same, but reply saying it'll be fixed with our next deploy (probably 10 minutes) - or you wait, so that you can communicate with certainty. The waiting is time where you'll shift focus to something else, but have the baggage of having to follow up. Perhaps you'll think, I'll have a quick coffee, then move on to something else afterwards. Even though your deployments are entirely automated, you lose time because of waiting and losing focus. If TTP is hours, the
4 days ago
How to make a Rubygem - Setting up the basic structure. Patching Ruby for Faster Rails Startup, Revisited - Made easier with rvm. Curly - Template language that separates logic and structure completely. Capybara::Select2 - Helpers to ...
How to make a Rubygem - Setting up the basic structure. Patching Ruby for Faster Rails Startup, Revisited - Made easier with rvm. Curly - Template language that separates logic and structure completely. Capybara::Select2 - Helpers to test selects that have been spiffed up with select2.
4 days ago
The Rails Asset Pipeline to me is kind of like Bundler. At first I was very nervous about it and thought that it would be very troublesome. But after a while of using it, I realized the wisdom behind it and my life got a lot easier. The ...
The Rails Asset Pipeline to me is kind of like Bundler. At first I was very nervous about it and thought that it would be very troublesome. But after a while of using it, I realized the wisdom behind it and my life got a lot easier. The asset pipeline is fabulous for putting all your assets into a single file, compressing them, and serving them in your site without cluttering everything up. Remember these days? A basic component of the Asset Pipeline is the manifest file. A manifest looks something like this // Rails asset pipeline manifest file // app/assets/javascript/application.js //= require jquery //= require jquery_ujs //= require_tree . For a quick rundown on how the Asset Pipeline works, I highly recommend taking a few minutes to watch Railscast episode 279. But there are a few things that I'd like to point out here. First, notice that the name of the file is application.js. This means that all the javascript specified in the manifest file will be compiled together into a single file named a
5 days ago