Andrea Franz

Testing rails generators with Cucumber

In the last days I switched a lot of old projects to use Cucumber, then I started writing test for Web App Theme. Here I haven't models or controllers to test, because it's just a generator, but I found enjoyable the use of plain text features to describe the ThemeGenerator behavior:

Read the rest of this entry »

#Cucumber #Development #Rails #Ruby #Testing

2 minutes admin layout with rails and the web-app-theme generator

Many people found out a rails generator inside my web-app-theme project and asked me how to use it. Here an example, starting from scratch with a new rails app that manages music Albums.

Read the rest of this entry »

#Development #Rails #Ruby

Creating PDF with images using flex and AlivePDF

Today I'm working on an AIR application, and I need to create a PDF starting from a list of images. This PDF needs to have one image for each page. I used AlivePDF, a very useful ActionScript3 library for PDF generation, and I created a simple class that takes an array of image paths and creates the PDF I need.

Read the rest of this entry »

#AIR #Development #Flex

Cocos2d: how to make a label to fit the Iphone screen width

In the iPhone game I'm working on I need to display a different label every time I start a new game level. Each one of these labels has a random string taken from an array of words, and each one of these strings has different size. So every time I create a new label I set the maximum font size and then I decrement it until the string size measures less than the iPhone screen. I do that using the sizeWithFont method of the NSString class:

Read the rest of this entry »

#Cocos2d #iPhone

Terror the micro aggregator

Terror is a micro feed aggregator made with sinatra and bundled as a gem. It's very simple to use, just install the gem:

gem sources -a
sudo gem install pilu-terror

Create a new project

terror new_aggregator_name
cd new_aggregator_name 

Start the server

thin start -C config/thin.yml

Run the feeds fetcher

rake feeds:fetch # run it as a cron job

You can browse the source and fork it on github.

Read the rest of this entry »

#Development #Ruby #Sinatra