Adding other tools support in Hudson's rubyMetrics plugin 1

Posted by david

Ok, I have to admit it, I'm a lazy, but a good lazy, like my good friend Sergio says. I like to work as less as possible and this days while I wrote the new Flog support in the Hudson's rubyMetrics plugin I realized that I didn't want to copy the same code over and over again anymore.

So, I just added to the repository a ruby script to generate the basic skeleton for add every other tool support to the plugin. The script asks some questions and it generates basic classes that it needs to add support for that tool.

Still here? what are you waiting to add your favorite tool support to the plugin? You just need to follow this few steps:

1 Check the code out:


$ svn co https://svn.dev.java.net/svn/hudson/trunk/hudson/plugins/rubyMetrics

or


$ git clone git://github.com/calavera/rubyMetrics.git

2 Run the script:


$ ruby src/main/ruby/generator.rb

3 Go to the Publisher class and complete the perform method and go to the BuildAction view and complete the jelly template. Psss rcov, flog, rails stats or rails notes support can help you.

4 Test the plugin using maven, it launches a dedicated instance of hudson :S


$ mvn hpi:run

5 File a ticket in hudson's jira to the component RubyMetrics and attach your patch.

Btw, if you didn't notice yet, I set up a mirror of the project in github. Enjoy it.

Loading several Rails applications into a single Tomcat container with Trinidad 0

Posted by david

Sometimes you meet that kind of people that complain about the lack of any feature in an open source project but they don't do anything to solve the problem. Last releases of Trinidad try the solve one of that complaints, so that people have one excuse less to use it :)

The goal of the project was pretty simple, allow to run a Rails application under Apache Tomcat without generating a war file in a more familiar "rails way". But that guy complained because he wanted to run several applications into the same instance of Tomcat, and actually he was partially right, Tomcat is a powerful application server and it can run several applications at once, thus, why don't allow to Trinidad to run several Rails applications?

After a few changes in its architecture, Trinidad allows to run as many Rails applications as Tomcat can support into the same instance. We just need add the application's context and their system path to the Trinidad's configuration file and run Trinidad with the option to read that file.

For instance, if we want to load three applications we had to add this nodes to the yaml file:


---
  :web_apps:
    :default:                                         # context path is '/'
      :web_app_dir: 'rails_apps/mock'
    :mock1:                                         # context path is '/mock1'
      :web_app_dir: 'rails_apps/mock1'
    :mock2:
      :web_app_dir: 'rails_apps/mock2'
      :context_path: '/mock2'

and run Trinidad with the configuration option:


$ jruby -S trinidad --config

That's it. Hope it will useful. Btw all the configuration options can be found in the Trinidad's wiki.

The Atom Exerciser on Heroku 0

Posted by david

From some time I've been getting some visits in this blog from Tim's page and I didn't know why, until this morning when I needed to use his Ape instance and I came across it was down.

I needed to use it from outside my private network, I thought on deploy it on Google App Engine, so I took the oportunity to move the repository to a more cool home, get rid of the old mongrel code and use a Rackable framework to manage its server and move its realeases to gemcutter.

All in all, after almost an hour trying to deploy it in GAE I realized I couldn't use it because its restrictions policy, so in the 10 minutes between I wrote these two tweets, I downloaded heroku gem, wrote a rack config file and deploy Atom Exerciser on Heroku. Enjoy it.

Improving JRuby 1.9 compatibility 1

Posted by david

For some time I've been contributing with the JRuby team fixing bugs and adding some new features, and most of my work has been focused in Ruby 1.9 compatibility.

Yesterday, Nick Sieger wrote a blog about some things to look at JRuby 1.4, and I'd like to add my "from novice to novice" piece of advice.

Run and fix specs can be a tedious task, you can take a look at the latest patches I sent, so I wrote a little script to help me to run them easily:

It has two usage options, it runs all specs under a directory, or you can specify one or some of them to run. I know it's not perfect but it works for my daily work.

Hope it can help you and I'll see your patches soon.

Rails load balancing with Apache and Trinidad 1

Posted by david

I just released a new version of Trinidad with two major features. The first one is that it supports ssl connections adding a simple starting option:


  $ trinidad --ssl

The second one is also related with connections, but this one is about AJP, a protocol designed to increase tomcat's performance, if you already have worked with tomcat or jboss I'm sure you already know it.

But what I'd like to show you is one of its main adventages, how to create a really stable load balancer with Apache httpd and Trinidad thanks to ajp.

First we have to ensure all the apache modules that we need are loaded:


  $ sudo a2enmod proxy_ajp proxy_balancer

After that, we have to configure our virtual host to proxy the connections through ajp, this is an actually basic configuration, there are a lot of resources about mod_proxy_balancer on internet:


<Proxy balancer://trini>
  BalancerMember ajp://127.0.0.1:8009
  BalancerMember ajp://127.0.0.1:8099
</Proxy>

ProxyPass / balancer://trini/

Notice that I'm using my development machine and that's why the two balancer members have the same ip but different port.

Finally, we have to run two different instances of Trinidad with the ajp option enabled, with the ports we specified in the balancer configuration (8009 is the default one), and different http ports due to I'm running it in my machine:



$ trinidad --port 3001 --ajp
$ trinidad --port 3002 --ajp 8099

That's it, quite straightforward.

By the way, I've also set up a google group where you can ask doubts or discuss about the development itself, and, as always, if you find a bug or have a new cool functionality you can add it to the issue tracker.

Jeweler vs rubyforge 0

Posted by david

Last week I released the first version of Trinidad, a project that I develop with the help of Jeweler, a gem that gives you the tools to release a gem in github quickly, and with some options it also helps you to release your gem in rubyforge, but here my problems started.

In the Jeweler's wiki there is a page with the first problem I bumped into, and in its issues tracker there is also a thread with the problem that almost went me nuts, and any solution didn't solve my problems.

My solution, start from the begining, step by step. First step, configure rubyforge, the best guide you can find to configure rubyforge is in the newgem generator's page. Second step, release your gem with jeweler.

All in all, if you want to release a gem in rubyforge with jeweler, run these commands and forget to edit rubyforge configuration's files, it worked for me, at least:


$ rubyforge config
$ rubyforge login
$ rubyforge names
$ rubyforge create_package #project_name# #gem_name#

$ rake rubyforge:release

Tomcat-rails is now called Trinidad 1

Posted by david

One month ago I released Tomcat-rails, a little gem to simplify my development process with tomcat.

To get feedback I decided to send some emails to several mail lists. I was really interested in answers from jruby and tomcat users and developers, perhaps they could send me some advice to improve my code or ideas for new features.

I got good feedback from the jruby-user list, people used it with good results, others bump into problems with jruby-rack... but the answers from tomcat-user lists actually took me by surprise, just two or three minutes after I sent the email the first reply asked me to read the tomcat's legal page, from his own words, the name of my project didn't conform to the guidance set out in the trademarks section, and specifically in this point:

If you use the words "Tomcat" or "Apache" in your product name then you must call your product "... for Apache Tomcat" or "... for Tomcat". You may not call your product "Apache ..." or "Tomcat ...".

Some days after, the same guy sent me an email directly to remember me that I had to change the name of the project, and of course, reading the internal lists of the ASF I know the project got some mentions.

Well, the problem just finishes today, from now this project is called Trinidad. In few days the old repository and the web page will be remove, the new web page and the repository are still hosted in github but I also set up the project in rubyforge, so install the gem is even easier:


jgem install trinidad

Remember if you find a bug, you have improvements over my code or just have suggestions for new features, you can use the repository issues' page.

Tomcat-rails, develop rails app within tomcat 0

Posted by david

UPDATE: This project has been renamed and it's not longer mantained, please read this post if you want to know the reasons or just go to the new project web page.

This days I'm working every day with this stack, jruby+rails+tomcat. I was quite tired to have to pack the application and restart tomcat every time I wanted to test every slight change, so as a result, I wrote a script to use an embed tomcat within my application and this morning I wrapped it as a gem.

There is a lot of work to do but you can already download it from github.

It's usage is quite simple, just install the gem with jruby, go to the root directory of your rails app and run jruby -S tomcat_rails, or copy and paste this lines:


  jgem install calavera-tomcat-rails -s http;//gems.github.com
  cd myrailsapp
  jruby -S tomcat_rails

Any feedback will be really appreciated.

Rails template for Google app engine 2

Posted by david

I know, there is already too much buzz out there that talks about the new GAE's java support but I was sure I end up trying it.

I was following the Ola's post, it's quite simple to configure a rails project to deploy it on GAE, but I didn't want to repeat all those steps every time I'll deploy a new application, so I just wrote a rails template that adds all that stuff to my projects.

I'm waiting Jeremy'll add it to the templates repository, meanwhile you can grab it from my forked repository.

By the way, if you've already worked with rails templates you know they provide a git command that I'm not using in my template. That's because that command doesn't work outside the app root directory. I've already submitted a patch to the rails' lighthouse to solve it. Please vote it!!

Rails Hackathon in Madrid 1

Posted by david

Last month some friends of mine organized a great event called Monsters of Ruby. The topic was Ruby without Rails, and the challenge was mix random technologies and create a simple web app, my teammates and I suffered with SproutCore, Ramaze and Sequel.

Following its essence I'm organizing a new event called Rails Hackathon next February 7 in the 11870.com's office. The topic will be dive into the Rails core and send as patch as we can to the issue tracker.

Our office is not too much big so I've decided to close this event to 20 people, some of them have been already invited but there are some available places yet. If you are a Rails core contributor or you want to be and you enjoy diving in foreign source code send me a mail to calavera AT apache DOT org and I'll include you in the list.

European Ruby Konference 2009 in Barcelona 0

Posted by david

I'm glad to announce that we have dates and venue for the next Euruko 2009 in Barcelona, May 9 and 10 in the Citilab, a beatiful place that hosted other big international conferences like DrupalConf or OpenOffice.org Conference.

You can see the official announce in the Euruko web page, we'll open the call for papers in the next weeks, stay in touch!

Abdera gets the graduation 0

Posted by david

Although I don't speak pretty much on Apache Abdera, I've been involved in the project for more than a year.

Today, two years later Abdera is finally graduated and in the next weeks we're moving our home to abdera.apache.org as a Top Level Project in the ASF. So, now the question is... when will we release a new version of Abdera? and the answer is... we're working on fix every major bug that we have in our jira, and we have to look over our documentation, but we'd like to release a new version as soon as our infrastructure will be migrated.

Meanwhile contributions are welcome, if you find a bug or you think that you can improve our documentation, please don't hesitate to drop us a line.

Google Test Automation Conference 08 3

Posted by david

Yesterday, the third edition of the Google Test Automation Conference finished, and, although my speech was a little disaster, I'm glad. It was a challenge, this was the first time that I gave a speech in english and I chose to do it in front of the main experts in testing in the world.

I'm trying to upload the slides to slideshare but I have several problems converting the file, so, if you want to get them you can download the pdf from my server.

Update: I finally got to upload the presentation to slideshare, you can take it a look here:

Next three weeks in the states 1

Posted by david

Right so, Tomorrow I'm flying to Seattle to speak in the Google Test Automation Conference and to seitze the opportunity I'm going to visit some friend in San Francisco next week. After that, I'm going to New Orleans to attend to the ApacheCon where I'm talking on Abdera in the Fast Feather track.

If you're in my route and you want to spend some time taking a beer and talking on open source, rails, java, atom or something, just drop me a line to calavera at apache dot org or leave me a comment in this post. See you there!

rubyMetrics 1.2 supports Rails stats 4

Posted by david

I've just released the version 1.2 of the rubyMetrcics plugin for Hudson, and I've added support for Rails stats, so, if you check the right option hudson generates the report and its trend graph:

You can find more info into the plugin page.