Category: Code

Harvest Upgrades to Rails 3

Harvest is on Rails 3! This is exciting news from the Harvest technical team. I’ll detail how the upgrade process went, but first a little history. The initial commit to Harvest was made on November 23rd, 2005 – five years ago. Back then, we ran Rails 0.14.1 and were still discussing how time should be entered into Harvest. That’s five years of Rails releases since we started, and each upgrade was a painful but worthwhile experience.

I cannot stress that last conviction enough. Besides the obvious technical improvements an upgrade brings, there is also a morale boost from using the very best tools. This comes at a cost: Upgrading a key dependency is challenging for an app of Harvest’s size.

Name Lines
Controllers 12K
Models 25K
Views 28K
Helpers 7K
Libraries 3K
Functional tests 18K
Unit tests 20K
Selenium tests 2K
Our Javascript 10K

Harvest also has 32 plugins, 82 gem dependencies, our widgets, mobile apps, and Co-op integration. These are all potential breaking points during an upgrade. Continue Reading …

Harvest Integrations Galore: GitHub in Co-op, Fluid Growl Reminders, and Java for Harvest

A smattering of developers (who are also Harvest customers!) have released some cool integrations in the past few months, and we thought we’d share the highlights with you.

Post GitHub Commits to Co-op

Robert May of Core Web Design has put together an integration between GitHub and Co-op, Harvest’s team communication application. This GitHub service posts GitHub commits from any project of your choosing directly to Co-op. It’s a fantastic way to keep your team up-to-date on the latest development activity.

To set up the integration, visit the source GitHub repository and go to Admin > Service Hooks. Choose Co-op and fill in the necessary information.

Continue Reading …

How To Generate Excel Files with Ruby

While Harvest provides powerful reports sometimes nothing beats having all of your data in a spreadsheet.  Unfortunately, the defacto spreadsheet tool (Excel) has some tricky file formats, making programatic export more difficult than it should be. We recently made improvements to how we handle Excel exports in Harvest, and I’d like to share a few options for exporting spreadsheets with Ruby.

Continue Reading …

Harvested, a New Ruby API wrapper

For you developers out there, Harvest user Zach Moazeni has released a Harvested, which is a new Ruby API wrapper.

We’re delighted to see the creative and imaginative ways our customers are making Harvest work for them, please let us know if you have created a Harvest integration you’d like to share!

Harvest Supports Ruby Summer of Code

Harvest was built from the ground up with Ruby on Rails, a powerful framework for building web apps. Rails has been part of daily activity here since back when we worked on client projects right alongside of Harvest. As an OSS project, Rails needs contributions of all sorts to continue evolving. The latest program to help push Rails forward is Ruby Summer of Code.

The Ruby Summer of Code program is designed to help fund student development of Ruby and/or Rails projects in the summer of 2010. Accepted students will be matched up with accepted mentors and will have two months to complete their summer projects.  Harvest is proud to support this inspired endeavor, and the future of Ruby development.

The student application window is from April 5th to April 23rd, so that means the deadline is just a week away.  If you are (or know of a) student with an idea for a great Ruby project, get your application in now!

Co-op, Twitter, and Motivation with Cobot

We are pretty active on Twitter. It’s a great way to get quick messages out as we release new features. We love to hear what you have to say about Harvest, good or bad.

It would not be particularly efficient for everyone on the team to watch the flow of tweets about Harvest. So, for those of us who have the task of watching Twitter, we like to favorite interesting tweets about Harvest, and we also like to share them with the rest of the team. This is a perfect task for automation by Cobot, your friendly Co-op robot.

We created a Ruby script that runs every 30 minutes looking for the latest favorited tweets on our Harvest Twitter account. It also looks at the Harvest stream to pull in anything we’ve said on Twitter. These tweets get inserted into our Co-op stream and provide a nice bit of motivation from our wonderful customers.

If you are curious to see the script, it can be found on GitHub. And here it is in action:

Co-op with Twitter inline

Enjoy using Cobot to enhance your Co-op workstreams, we’re excited to know if you find this feature useful!

Introducing Cobot: System Messaging for Co-op

The Harvest Team communicates with Co-op all day, every day. It is the visual heartbeat of our team, as we share failures, successes and silliness from our work days and our lives. While this heartbeat is strong, it also has an obvious arrhythmia: no system status messages.

For the past couple weeks we have been refining an API technique to programmatically add system status, and anything else, to a Co-op workstream. We are pleased with the results, and would like to introduce you to Cobot:

Cobot - The Harvest Co-op Robot

Cobot posts may be created via the Co-op API.

Along for the ride are a couple of new formatting features now enabled for Co-op statuses. First, statuses now accept <br /> tags to force new lines, which is essential for posting things like deployment of multiple code commits.

Co-op also now supports code pastes. If you paste anything in your Co-op message box with two or more new lines, the code paste view will take effect:

Philip J. Fry WTFjs

Feel free to share what kinds of system messages you will be looking to bring into your Co-op workstreams, we’re excited to know if you find this feature useful!

Server Management Made Simpler

Many people assume that under the hood there are mystical unicorns and magical elves powering Harvest, but the reality is that we simply use regular servers in a datacenter to bring our applications to you. No elves involved. Anyone who has ever had to look after more than a few servers knows that getting all the servers into line is a bit like herding cats, and can be time consuming. It’s always important to know exactly what state your server configurations are in, and usually very important to know that all servers are in the same configuration state at all times.

It’s no secret that many of the fine folks who work on Harvest are Ruby experts (and thus quite easy on the eye). So when looking around at tools we could use to make our servers simpler to manage, we decided to try Chef. If you are not familiar with Chef, it comes from the folks at Opscode and is a powerful tool to manage server configurations, and perform common system administration tasks on a set of servers. Chef is written in Ruby and allows you to accomplish a fair amount of your system administration tasks by writing Ruby recipes to execute on remote servers. Chef makes system administration a bit more like application programming, in a sense.

While we work on getting Chef into daily use, and indeed while we improve our systems platform in general, we plan to share some of our experiences with Harvest users and readers of this blog. You can read up on some of the details of how we got Chef up and running quickly, a little look at how a Chef cookbook, recipe and role work together and we plan to bring you some more details in future posts. We’d love to hear from any Harvest users who are using Chef, or doing interesting systems or server management work (and invoicing clients via Harvest, naturally). What systems projects have you been working on?

How to Fix Dropdown Problems on Internet Explorer

Lately we found ourselves caught in some nasty dropdown problems. Some of our customers who use Internet Explorer were unable to to read their full project and task names on the new timesheet. Apparently it’s a browser bug specific to Microsoft’s Internet Explorer. All you need to do is Google “IE select box problem” and you’ll see the legions of disgruntled developers this control has left in its wake.  What follows is a recounting of our experience and our solution.

The Problem

Before the timesheet redesign, we did not specify a width on the Project and Task dropdowns.  For some users with really long project/task names, this meant their select boxes would extend past the right edge of their browser window.

The logical fix is to constrain the width of these select boxes. Well-behaved browsers have no problem with this approach. Internet Explorer, however, interprets a width on the select tag very literally.  The select box and all of the options are limited to the specified width, regardless of whether this truncates 90% of the option text.  For our users with long project/task names, this made the dropdown practically useless.

ie_select

The Solution

As with many of IE’s problems,  there are several workarounds out there, and unfortunately none of them are perfect.  We looked at three common approaches for solving this problem before we settled on the one we’re using now.

  1. Dynamically re-size the dropdown on mouseover.  The main problem with this approach is that (like anything triggered on mouse-over) the user experience can be very disruptive and seem “jumpy”.
  2. Custom select box, made from unordered lists and complex event handling.  Scott Darby’s stylish-select plugin for jQuery is a great example of this.  We gave this one a shot, but the custom select box does not retain browser’s default behavior with select, such as tabbing and using key stroke to jump to a certain selection.
  3. What ended up saving the day was this idea from Doug Boude.  It is surprisingly simple: re-size the select box on click, and set overflow: hidden on a containing div.  The hidden overflow will prevent the select from interfering with other controls to the right, while still allowing the full options to be displayed below.

Doug’s original solution required you to know the full width of your select box. Ours would need to compute this dynamically, so we wrote a simple Prototype.js class to encapsulate the event handling and to calculate the width of the select box.  You can check out a demo of the solution with code and some notes on how to use it for your problematic select boxes.  Disclaimer: this solution works best in IE7 and IE8. We do not recommend using it in IE6.

Hope you find this useful!

FutureRuby: A Programming Conference with Breadth

Just over a week ago I attended FutureRuby in Toronto, Ontario, Canada. From the single track of talks to the significant-other program to the unique post-conference parties, I have never participated in a better conference. I was especially pleased that four talks were being presented by Harvest customers.

The breadth of discussion at FutureRuby was incredible. If you are able to find a similarly diverse field of talks in a conference remotely near your area of expertise, I highly recommend it. You will be surprised to find how easily you can relate disparate topics to your career.

A quick rundown of presentations by Harvest customers after the jump.

Continue Reading …

The HARVEST Blog News & small business tips from your beloved time tracking & invoicing app.