Tag: ruby

Writing MacOSX System Services with RubyCocoa

Posted by – September 7, 2009

Today I started my study about RubyCocoa and how it works, my first project was a simple system service for MacOSX Leopard where the user can type a portuguese text, select it and translate to english, the user can also type the text in english and execute the system service to translate it back to portuguese.

Here’s what I did:


When convention over configuration sucks

Posted by – February 2, 2009

Last saturday I wrote a small application using rails 2.2.2, rails is pretty handy in many ways, when writing models, controllers and views, I could get this application working almost like its jsf version, except for one thing, convention on primary keys.

Rails has a convention on primary keys, if you are using sqlite as database you are limited to use an auto-increment column as primary key, no user provided id is allowed. You can customize the column name of primary key, but nothing more.

To change the column name of your primary key you must call set_primary_key method on your model class, like below:

class Supplier < ActiveRecord::Base
   set_table_name "supplier"
   set_primary_key "fid"

No way to deploy Rails applications on Apache running under Windows

Posted by – January 20, 2009

After few days trying to run a rails application under apache with “help” of fastcgi module and without any success I’m finally giving up this idea, the reason is simple, I just can’t compile a c code used by fastcgi binding for ruby because of some missing header files and compiler support.

I tried to get the same application running on apache without fastcgi module but it is too sloooow.

The truth is, you can develop rails applications on windows, but please, don’t try to run this applications on apache with fastcgi support, you will waste you time.

To be honest, I don’t have the same problem when running Rails applications on top of JRuby since I can deploy these applications on any servlet container like Tomcat or Jetty.


Gracelets – DSL for JSF Applications

Posted by – September 15, 2008

Sometimes I remeber to visit TSS site to check some news about Java world, one of the threads that catch my attention was the article about use Raven to build Java projects, Raven allows to use your DSLs to write build files on top of Java language, with these DSLs you can do much more than any other build system like Ant but with less code.

You can define your own DSL to solve a specific problem, Raven uses a DSL to write builds scripts, but you can use DSLs to generate XML content, RSS content, HTML pages, SQL statements, create swing applications and to perform unit conversions.

But what about Gracelets? What’s it for?



Dynamic languages and JSF

Posted by – March 6, 2008

Yesterday I started to think about how can I use languages like Groovy, JRuby, Jython or Scala with JSF, after some research I found a elegant way to do it, in order to do that, you must add the following jars to your project:

  • antlr-2.7.6.jar
  • aopalliance-1.0.jar
  • asm-2.2.3.jar
  • commons-beanutils-1.7.0.jar
  • commons-codec-1.3.jar
  • commons-collections-3.1.jar
  • commons-digester-1.6.jar
  • commons-el-1.0.jar
  • commons-lang-2.1.jar
  • commons-logging-1.0.4.jar
  • commons-validator-1.2.0.jar
  • groovy-1.5.4.jar
  • myfaces-api-1.1.5-SNAPSHOT.jar
  • myfaces-impl-1.1.5-SNAPSHOT.jar
  • oro-2.0.8.jar
  • spring-aop-2.5.1.jar
  • spring-beans-2.5.1.jar
  • spring-context-2.5.1.jar
  • spring-core-2.5.1.jar
  • spring-web-2.5.1.jar

Now you must create the necessary configuration files: