Fix Ruby 1.9 "can't convert Pathname to String (TypeError)" error

Thursday, November 24, 2011 8 comments
Do you find yourself hitting this error when running your ruby code on ruby 1.9? Then on the line that actually tries to load the file (like the following examples) add the .to_s after what used to be the filename :

  • IO.read(filename) -> IO.read(filename.to_s)
  • require filename -> require filename.to_s
etc...

Some example commits from other projects :

Github flavored markdown in YARD documentation

Tuesday, November 22, 2011 8 comments
Would you like to do this in your README.md :

```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```

And get this as the output :


In your Gemfile :

  gem 'yard'
  gem 'redcarpet'
  gem 'github-markup'

In your .yardopts file :

--markup-provider=redcarpet
--markup=markdown

Resources


HipChat git hooks

Tuesday, November 15, 2011 6 comments
Checkout git hooks for HipChat!



Kudos to eirc and graffic for their work! Love the integration!

Oh god! InvalidPluralizationData!

Friday, November 11, 2011 4 comments
Do you hate it when you see this only because a pluralized localization is missing ?



Go on and comment, help, brainstorm on https://github.com/svenfuchs/i18n/issues/123

Integrating a Rails application into Google Apps Marketplace™

9 comments

Are you thinking to integrate your rails application into the Google Apps Marketplace? Before starting out make sure you check out this presentation from the 7th Athens Ruby Meetup where we shared some of our experiences and lessons learned from the whole process of integrating Fraudpointer into Google Apps Marketplace.

Enjoy and feel free to share your comments!

Fixing 'SQL exception: Incorrect string value' on TeamCity with MySQL database

Friday, October 21, 2011 7 comments
I found myself getting this error from TeamCity when trying to run some tests that contained non latin characters on the test name (actually a feature step) :

SQL query: INSERT INTO test_names (ID, TEST_NAME) VALUES (?, ?) SQL exception: Incorrect string value: '\xCE\xA4\xCE\xB1 \xCE...' for column 'test_name' at row 1

The problem was that the MySQL database that TeamCity was using had been set up with 'latin1' character set. I run this script on the database to alter all the tables and convert them to utf8 and everything worked like a charm afterwards :


xkcd all time classics

Monday, October 17, 2011 3 comments







Some handy Rails test helpers

Thursday, October 13, 2011 4 comments
Extracted and packaged some handy test helpers for Rails into a gem : evelpidon_test_helpers. Not much but it does saves us a lot of repetition.

More helpers will to be added soon!

RIP Steve and Richie

3 comments
It's a really sad month for the technology community. First it was Steve and now it's Richie.

:(

Breadcrumbs on Rails

4 comments
Here's a short list of existing libraries for easy breadcrumb generation/management in Rails sites/projects :

So far, crummy is winning since it's the simplest one that actually works, but simple-navigation looks pretty interesting with much wider compatibility (Sinatra, Padrino, etc) and with more generic feature set.

Thanks to all of the authors for saving me (and all of us) time from actually re-implementing the same thing again and again!

Mocking/stubbing a method that's included from “instance.extend(DecoratorModule)”

Sunday, October 9, 2011 4 comments

I use a decorator module that get's included in a model instance (through the "extends" method). So for example :
module Decorator
  def foo
  end
end
class Model < ActiveRecord::Base
end
class ModelsController < ApplicationController
  def bar
    @model = Model.find(params[:id])
    @model.extend(Decorator)
    @model.foo
  end
end
Then I would like in the tests to do the following (using Mocha) :
test "bar" do
  Model.any_instance.expects(:foo).returns("bar")
  get :barend 
Is this possible somehow, or do you have in mind any other way to get this functionality???

Stack Overflow question

RubyConf 2011 : The &block party

Saturday, October 8, 2011 1 comments
Some photos from the excellent &block party!



For the record, the bands that were playing were :

Steve Jobs (I will always remember...)

2 comments
Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma — which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.

The official Fraudpointer blog: Fraudpointer for Google Apps™

Friday, October 7, 2011 5 comments
The official Fraudpointer blog: Fraudpointer for Google Apps™: The official announcement of Fraudpointer integration with Google Apps! More technical details soon live (and at the 7th Athenian Ruby Meetup!)

My Ducati Multistrada engine teardown

Thursday, September 8, 2011 6 comments
I went for a simple oil change



And ended up like this :






Hopefully it's for the best... :|

Interesting fresh JavaScript resources

Saturday, September 3, 2011 7 comments
A lot of surfing this week and I came across a lot of interesting new projects / resources regarding JavaScript. I'm more or less writing them down here for future reference :)

Hf

Versioning a Rails Application

Thursday, August 11, 2011 4 comments
I was looking for a way to version a rails app and here are the two different alternatives I found :

Both of them work with git which is basically my only requirement :)

Hope someone else finds this useful - if you have any other ideas feel free to share!