With this Radiant extension you can manage a small Postfix virtual domain. A Postfix virtual domain allows you to forward e-mail to another e-mail address. The extensions adds a tab to the admin screens of Radiant in which you to enter the redirects. It also supports crude but effective aliases and mail-lists. In addition the Postfix configuration is verified and instructions will be displayed if something is not right.Here is an screendump to see the effect. The first release, boldly named 1.0, should work under Radiant 0.6.3 and up. Please visit the Radiant Postfix Extension project home. Update 2008-04-21: just released version 1.1 as a file had the wrong name.
Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts
Tuesday, April 15, 2008
Announcement: radiantpostfixextension release 1.0
I have just released a new extension for Radiant. From the description:
Monday, January 21, 2008
I finally made up my mind
Those who read this blog more often may have noticed the minor change in the sub-title. It now reads:
Experiences from a hard core Java programmer that finally decided Ruby is a very very nice language, but rather stays on the JVM.Compare it to the previous text:
Experiences from a hard core Java programmer that struggles with the question of switching to the world of Ruby and Ruby on Rails.So how did I come to this conclusion? Here are some random considerations:
- I have only once in the last 2 years used Ruby professionally (to do some counting in a site dump).
- I do have 3 Ruby sites running (one Camping and two using Radiant). So I am not going to stop using Ruby anytime soon.
- ActiveRecord totally kicks ass and is hugely impressive. Rails for the rest not so much (totally old school request response based, with like JSP code in the templates). It may be just my lack of experience, so don't base your opinion on this.
- I am very addicted to correct refactoring and code completion.
- As I wrote before, we now have Scala.
- Update 2008-01-23: This one needs to be added. Since I recently became a father, it is simply too much to keep track of 2 worlds at the same time.
Thursday, December 27, 2007
JRuby on Rails - Book review
So what do you put in a book on JRuby? After all, for the programmer JRuby is 'just' another Ruby implementation. The question must have come up when Ola Bini decided to write this book. The result is materialized in Practical JRuby on Rails Web 2.0 Projects - Bringing Ruby on Rails to the Java Platform. The title is well chosen and also answers the question: JRuby on Rails is a practical book; it guides you through the implementation of several Rails sites and along the way it shows you neat tricks that are only possible in JRuby.
Contents
The first half of the book is all about JRuby on Rails. If you already know Rails it is funny to consistently see jruby instead of ruby, but otherwise this is part is boring for the initiated. If you do not know Rails and like to learn from examples, this chapter is well worth your read. Right after that is an interesting part for all us that want to mix Java and Ruby. Later in the book, Ola goes through the trouble of explaining how to use JRuby with all the non interesting things in Java: session beans, message beans, JMX, XML processing and SOAP. I have been in Java business for 7 years and have been luckily able to avoid these for most of the time. The integration provided by Spring could have been a very nice replacement for these subjects. A bit hidden between this stuff, the book again shows it practicality and goes through all the options of deploying JRuby on Rails applications. The book ends with some convenient JRuby specific references. Conclusion
I strongly recommend this book when you are a Java programmer (of any skill) that knows some Ruby and want to start working with (J)Ruby on Rails. If you know Rails well, but little Java and you want to start with JRuby on Rails, the book is probably too heavy and will teach you only a few useful things. Do not start on this book with zero Ruby knowledge. Though appendix A helps, for seriously learning Ruby, the old Pickaxe (dead tree version) is an excellent first read.
The first half of the book is all about JRuby on Rails. If you already know Rails it is funny to consistently see jruby instead of ruby, but otherwise this is part is boring for the initiated. If you do not know Rails and like to learn from examples, this chapter is well worth your read. Right after that is an interesting part for all us that want to mix Java and Ruby. Later in the book, Ola goes through the trouble of explaining how to use JRuby with all the non interesting things in Java: session beans, message beans, JMX, XML processing and SOAP. I have been in Java business for 7 years and have been luckily able to avoid these for most of the time. The integration provided by Spring could have been a very nice replacement for these subjects. A bit hidden between this stuff, the book again shows it practicality and goes through all the options of deploying JRuby on Rails applications. The book ends with some convenient JRuby specific references. Conclusion
I strongly recommend this book when you are a Java programmer (of any skill) that knows some Ruby and want to start working with (J)Ruby on Rails. If you know Rails well, but little Java and you want to start with JRuby on Rails, the book is probably too heavy and will teach you only a few useful things. Do not start on this book with zero Ruby knowledge. Though appendix A helps, for seriously learning Ruby, the old Pickaxe (dead tree version) is an excellent first read.
Monday, October 29, 2007
Getting started with Ruby on Ubuntu 7.10
Update 20100922: Apparently this article is so out of date that I even get e-mail to get this article down (or replace it).
Therefore: please do not use this article, in fact don't even rely on the Ubuntu packages as they are not all maintained properly.
One approach that may be fine (I did not try, don't blame me), is on http://krainboltgreene.github.com/l/3/. Good luck!
So now I have a new server, and a new 10Mbit/s internet connection. Its time for some applications! Here are my experiences with installing Rails, Radiant and Camping on a fresh Ubuntu 7.10 server installation. First of all, if your server is running in a closet somewhere (like mine) or worse: in a remote data center, you need to disable apt-get asking for the installation CD. Edit
/etc/apt/sources.list and comment the line that refers to the installation cdrom.
The next step of course it to install Ruby and Ruby Gems:
sudo apt-get install ruby rubygems ruby1.8-dev
Without the ruby1.8-dev you can not do much, don't forget it!
Where would you be without irb? The default install however does not link it!
sudo ln -s /usr/bin/irb1.8 /usr/bin/irb
Any serious Ruby web application uses Mongrel. However, Mongrel compiles some of its stuff during the install. So you first need to get the compilation tools:sudo apt-get install make gcc libc6
Mongrel is a trusted enterprise application nowadays, so you can install it with a certificate:wget http://rubyforge.org/frs/download.php/25325/mongrel-public_cert.pem gem cert --add mongrel-public_cert.pem rm mongrel-public_cert.pem gem install mongrel --include-dependencies -P HighSecurity
(ruby).
Luckily, installing Rails is still a simple:
sudo gem install rails --include-dependencies
If you want Camping, you'll first need to install sqlite:
sudo apt-get install libsqlite3 libsqlite3-dev
Now you can:sudo gem install camping --source http://code.whytheluckystiff.net sudo gem install camping-omnibus --source http://code.whytheluckystiff.net
sudo gem install radiant
For some reason the gem executables do not get added to the path. Make sure they do by adding /var/lib/gems/1.8/bin to your path. For example by adding the following line at the end of /etc/bash.bashrc:
export PATH="$PATH:/var/lib/gems/1.8/bin".
The favorite database amongst Railers is of course MySQL. I assume you selected LAMP during the Ubuntu server installation, that means you already have MySQL installed. To use MySQL with ActiveRecord, its best to install the MySQL native adapter. Before you can install that, you first need to install all the compile stuff from above and some more:
sudo apt-get install libmysqlclient15-dev
sudo gem install mysql
Again, for the gem select highest version number followed by (ruby).
Have fun!
Wednesday, October 10, 2007
Announcement: Version 99 Does Not Exist
Update 2025-07-08: Version 99 was shutdown.
In a previous post I announced no-commons-logging (a.k.a. commons-logging version 99.0-does-not-exist). After a request to add no-commons-logging-api I immediately realized that this can be generalized. So here it is: Version 99 Does Not Exist.
Features
Version 99 Does Not Exist emulates a Maven 2 repository and serves empty jars for any valid package that has version number 99.0-does-not-exist. It also generates poms, metadata files and of course the appropriate hashes. For example the following links will give an empty jar, its pom and the maven metadata for commons-logging. Why?
To get rid of dependencies that maven 2 insists on including on your classpath (like commons-logging while you want to use jcl-over-slf4j). How do you use it?
First of all: if you were using no-commons-logging before, you do not need to change anything! Version 99 Does Not Exist is fully backward compatible with no-commons-logging. Otherwise, read on. In your pom.xml declare the following 2 things: 1) the Version 99 Does Not Exist repository, and 2) for each jar that you get but do not want, declare a dependency with version 99.0-does-not-exist. So, for example, if you do not want to be bothered with commons-logging, include the following in your pom.xml:
When?
Right now. As I received questions on how stable this service will be, I hereby promise to keep this maven repository on-line for at least 5 years (or until no-ip stops offering their free dns service). Read further if you want to run Version 99 Does Not Exist yourself.
How?
Version 99 Does Not Exist is implemented in a single file as a Camping application. Where is the code?
If you want to run it yourself you'll need the following: Version 99 Does Not Exist download (rb file, 4Kb, MIT license), Ruby, Ruby Gems and Camping. Version 99 Does Not Exist is started with a simple camping version99.rb. Good camping! Update 2007-11-06: The empty jar is no longer completely empty as 'mvn site' fails on it. Thanks to Stefan Fußenegger for the report. Update 2007-12-14: The repository was off line for a day or so because I goofed while switching internet provider. Now, it is not only working again, but reachability is better then ever: 10 Mbit/s up and down! Update 2008-02-09: Version 1.2: another update to the empty jar. Sasha Ovsankin reported that the compiler could not open it. The jar now contains a valid manifest. Thanks Sacha! Update 2009-05-01: During my move from Amsterdam to Haarlem the server has been off line for a day or so. I am now on ADSL so my internet connection is a lot slower. If anyone want to run a mirror, I am happy to set up a rotating DNS. Update 2009-07-24: Version 1.3: artifacts with a groupid that contain a dot are now supported. Éric Vigeant, thanks for the bug report! Update 2009-10-17: Version 2.0: Éric Vigeant's problems were still not over. Now removed metadata support, this will hopefully make some proxies behave better. Update 2011-08-15: DNS for Version 99 is offline. Update 2011-12-19: I just found an alternative with almost the same name: version99.qos.ch. It is a static maven repository with a limited number of version 99 jars. Update uknown date: Alternative hostname for Version 99:
Version 99 Does Not Exist emulates a Maven 2 repository and serves empty jars for any valid package that has version number 99.0-does-not-exist. It also generates poms, metadata files and of course the appropriate hashes. For example the following links will give an empty jar, its pom and the maven metadata for commons-logging. Why?
To get rid of dependencies that maven 2 insists on including on your classpath (like commons-logging while you want to use jcl-over-slf4j). How do you use it?
First of all: if you were using no-commons-logging before, you do not need to change anything! Version 99 Does Not Exist is fully backward compatible with no-commons-logging. Otherwise, read on. In your pom.xml declare the following 2 things: 1) the Version 99 Does Not Exist repository, and 2) for each jar that you get but do not want, declare a dependency with version 99.0-does-not-exist. So, for example, if you do not want to be bothered with commons-logging, include the following in your pom.xml:
<repositories> <repository> <id>Version99</id> <name>Version 99 Does Not Exist Maven repository</name> <layout>default</layout> <url>http://no-commons-logging.zapto.org/mvn2</url> </repository> </repositories> <dependencies> <!-- get empty jar instead of commons-logging --> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>99.0-does-not-exist</version> </dependency> </dependencies>
Version 99 Does Not Exist is implemented in a single file as a Camping application. Where is the code?
If you want to run it yourself you'll need the following: Version 99 Does Not Exist download (rb file, 4Kb, MIT license), Ruby, Ruby Gems and Camping. Version 99 Does Not Exist is started with a simple camping version99.rb. Good camping! Update 2007-11-06: The empty jar is no longer completely empty as 'mvn site' fails on it. Thanks to Stefan Fußenegger for the report. Update 2007-12-14: The repository was off line for a day or so because I goofed while switching internet provider. Now, it is not only working again, but reachability is better then ever: 10 Mbit/s up and down! Update 2008-02-09: Version 1.2: another update to the empty jar. Sasha Ovsankin reported that the compiler could not open it. The jar now contains a valid manifest. Thanks Sacha! Update 2009-05-01: During my move from Amsterdam to Haarlem the server has been off line for a day or so. I am now on ADSL so my internet connection is a lot slower. If anyone want to run a mirror, I am happy to set up a rotating DNS. Update 2009-07-24: Version 1.3: artifacts with a groupid that contain a dot are now supported. Éric Vigeant, thanks for the bug report! Update 2009-10-17: Version 2.0: Éric Vigeant's problems were still not over. Now removed metadata support, this will hopefully make some proxies behave better. Update 2011-08-15: DNS for Version 99 is offline. Update 2011-12-19: I just found an alternative with almost the same name: version99.qos.ch. It is a static maven repository with a limited number of version 99 jars. Update uknown date: Alternative hostname for Version 99:
version99.grons.nl
Update 2019-11-15: Fixed link to original Camping appliction. The Camping links now point to wikipedia.
Update 2025-07-08: Version 99 was shutdown.
Monday, October 8, 2007
Watch where you place those Camping constants!
Finally got that bastard Camping application to work properly. I kept getting a ERROR: wrong number of arguments (0 for 3) on the first request. Subsequent requests would sometimes succeed, sometimes not. The funny thing was, the get method was not even called yet!
With deep gratitude for ruby guru Remco van 't Veer who found out that you can not use constants in a Camping Controller (actually, I already knew it from a previous camping app, but I had stupidly forgotten it). Move it up to the main module and you're good to go.
Wrong
Correct
See my next post to see what this is all about.
Camping.goes :Nowhere
module Nowhere
module Controllers
MY_CONSTANT = 'wrong' # Camping going nowhere
end
end
Correct
Camping.goes :ForPresident
module ForPresident
MY_CONSTANT = 'fine'
module Controllers
end
end
See my next post to see what this is all about.
Monday, October 1, 2007
Camping: optional group in regular expression
Recently I finished a Camping application where I wanted to handle URIs with an optional part. Like so:
Unfortunately this does not work. (Does this look familiar? See my next post!) In the end it turned out to be as simple as:
At RailsconfEurope Manfred taught me another trick:
This matches anything from 0 to n digits where a group is created for each digit. Using * in the parameter list will make method get work for any value of n. For URI's with less then n digits, the corresponding array elements are nil.
class Jar < R '/(.*)\.jar(\.sha1|\.md5)?'
def get(jarname, hash) # does not work
...
end
end
class Jar < R '/(.*)\.jar(\.sha1|\.md5)?'
def get(jarname, hash = nil)
...
end
end
n = 4
class DigitParty < R "/" + ("(\\d)?" * n)
def get(*args)
args.length # -> 4
args[0] # -> first digit or nil
args[n - 1] # -> last digit or nil
end
end
Saturday, May 5, 2007
Agile Web Development with Rails, 2nd edition - Book review
About time for another book review: Agile Web Development with Rails, 2nd edition, written (mostly) by Dave Thomas.
The book shows you all facets of developing a Rails application. This is actually a big improvement over the first edition. That one did not even talk about migrations. There have been a lot of changes in Rails, and these are reflected in the second edition.
Just like the first edition, the second edition is well written and has the same structure: the first chapters walk you through creating a new application, the latter chapters provide more insight in the separate building blocks of Rails. Unfortunately the book never really goes to the bottom of things (though its pretty good in the Active Record area); there is simply too much to cover. So this book is probably not a good buy if you are already an experienced Rails developer and are prepared to find information about new Rails features on the internet.
So although it took me a couple of months to read this book from cover to cover, my conclusion on this book is short: this is a must-have for any new Rails developer.
Friday, May 4, 2007
Aslak Hellesøy to speak on RubyEnRails 2007!
I just heard that Aslak Hellesøy will speak at the RubyEnRails 2007 conference! If want to know more about Behavior driven development (BDD), or love to hear more about RSpec, come to the conference!
Wednesday, May 2, 2007
RubyEnRails 2007 site is live! (Dutch)
Vanaf vandaag kunnen mensen zich aanmelden voor RubyEnRails dag 2007! Op de website http://2007.rubyenrails.nl kan je je aanmelden met je OpenID.
Het sprekers gedeelte op de pagina is nog niet volledig. De lijst met sprekers zal zo spoedig mogelijk worden aangevuld. Er zullen diverse presentaties plaatsvinden over o.a. RESTful ontwikkeling, Behaviour Driven Development, Radiant en het Camping Framework.
Dus ben jij een Ruby On Rails specialist of ben je gewoon geïnteresseerd in Ruby of Ruby on Rails? Meldt je dan nu aan! Deelname is overigens geheel gratis!
Friday, March 23, 2007
Ruby and Rails conference update
The preparations for Ruby and Rails 2007 in Amsterdam are progressing quite well. We are proud to have Dr. Nic fly in to give a presentation. Also the rest of the conference is already well filled with many speakers. Mind you, the official announcement has not been done yet!
We are only searching for more people that want to present a quickie. A quickie is a presentation of 5 minutes sharp. You could use it for example to show some cool stuff. So if you are around in June, and you made something new, or saw a nice new feature somewhere, feel free to e-mail us at danny at rubyenrails dot nl.
Update 2007-04-23: Unfortunately Simon Willison canceled. He felt too much out of place on a Ruby and Rails conference.
Wednesday, March 7, 2007
Vooraankondiging Ruby En Rails 2007 (Dutch)
Binnenkort is het weer zover. Een nieuwe Ruby En Rails dag. Vorig jaar was het een zeer geslaagde, zonnige en gezellige dag waar veel Rails en Ruby enthousiastelingen aanwezig waren.
Ook voor dit jaar zijn we bezig om weer een dag te organiseren. Er wordt druk gezocht naar een lokatie (waarschijnlijk Amsterdam) en we zijn aan het inventariseren welke sprekers uitgenodigd worden. Waarschijnlijk zal het allemaal plaatsvinden op 31 mei, maar het is 7 juni geworden.
Heb je zelf nog goede ideeën of verzoeken m.b.t. sprekers op deze dag, surf dan naar Ruby en Rails en laat iets achter in de comments. Je kunt ook een e-mail sturen naar danny at rubyenrails.nl.
We zijn op zoek naar sprekers voor:
- Presentaties van 45-50 minuten;
- Lightning Quickies™ van 5-15 minuten.
- Handige Ruby libraries (gems)
- Rails plugins
- Interessante real-world toepassingen van Rails
- Tips & truuks, leuke vondsten, enzovoorts
Tuesday, March 6, 2007
Mule patch accepted
Another product that accepted my patch. Till today I was proud to have patches in the following products:
- Xml2Db (specification for an aspect of the API, no code, long time ago)
- Struts (something with generating session ids, not long ago enough)
- Wicket (MixedUrlEncoding, other patches pending)
- Spring (a small documentation error) Today this is extended with: - Mule (MailMessageAdapter potentially adds "null" string) These were all small things, but I am still proud I was able to move open source further :) For the future: I wrote a Camping application to manage a virtual e-mail domain for Postfix. My plan is to convert this to a Radiant extension and make it available under the MIT license.
- Xml2Db (specification for an aspect of the API, no code, long time ago)
- Struts (something with generating session ids, not long ago enough)
- Wicket (MixedUrlEncoding, other patches pending)
- Spring (a small documentation error) Today this is extended with: - Mule (MailMessageAdapter potentially adds "null" string) These were all small things, but I am still proud I was able to move open source further :) For the future: I wrote a Camping application to manage a virtual e-mail domain for Postfix. My plan is to convert this to a Radiant extension and make it available under the MIT license.
Sunday, October 29, 2006
JRuby on Rails status
JRuby 0.9.1 is out for a week. This is the first version in which JRuby really starts to perform and behave properly. Though Ruby on Rails has been reported to work on JRuby for a longer time, this was not repeated by many people; too many loopholes to jump through. However, with the advent of version 0.9.1 there are suddenly many people on the mailing list that are trying and achieving exactly this.
Another promising release was done yesterday in Japan: rails-asyncweb 0.1, a very fast web server for JRuby on Rails. TAKAI, Naoto's asyncweb uses AsyncWeb, a web server that prevents the synchronization pitfall that the Java Servlet API brings. AsyncWeb scales a lot better under load then traditional Java web servers. And the performance rocks! It is about 10 times faster then Webbrick under loads to 10 concurrent users. It will be very interesting to see what happens under much much larger loads. I am also curious how this will compare to Mongrel, Zed Shaw's successor for Webbrick in the C-Ruby world. Another interesting question is whether this will end Mongrel's Java port.
Another web framework that works under JRuby is Camping. Camping is smaller then 4K, but quite powerful. It is a creation of the well known Ruby virtuoso why the lucky stiff. If you want to get a feel for what Ruby can do but don't want to learn Ruby on Rails (which I found quite a large task) I recommend you try out Camping. Ola Bini has a nice tutorial on getting you started. (Note: you should not use Camping version 1.5 because JRuby does not support continuations.) Another very good Camping tutorial (Dutch) was written by Remco van 't Veer.
Update 2006-10-30: added Remco's tutorial.
Friday, September 29, 2006
Back to Radiant
In one of my first posts I talked about Radiant. Having tons of other stuff to do, it dropped below my horizon. Because I am still on the mailing list, I saw a presentation passing by from Nathan Wright. The presentation is a beauty for first time Radiant users. I can highly recommend it if you like Ruby and are searching for something to build a simple site.
Because I can't find a download, I've put it on my home server for now. So here it is:
Radius, Content Management Simplified (5.6Mb)
Denver Derailed meeting September 27, 2006
Covers Radiant version 0.5.2 By Nathan Wright Update 2006-10-02: Thanks to Luis Lavena for providing a more solid server. Update 2006-10-04: The link above is now pointing to Nathan's own blog. Update 2007-03-06: All previous links are now dead. I placed the copy on my home server back.
Denver Derailed meeting September 27, 2006
Covers Radiant version 0.5.2 By Nathan Wright Update 2006-10-02: Thanks to Luis Lavena for providing a more solid server. Update 2006-10-04: The link above is now pointing to Nathan's own blog. Update 2007-03-06: All previous links are now dead. I placed the copy on my home server back.
Thursday, August 31, 2006
Walking the Java Road
I am walking the Java road. This week I told a junior programmer that learning Java is not something you start and then complete. Its a road; you learn as long as you are doing it. I am on the Java Road for 5 years now and I am still learning every week, almost every day even.
So what about this Ruby Road over there? It is a lot smaller road, but it appears that only fast vehicles are allowed. You really need to steer well, no mediocre developers here, they've crashed way behind you. And when you finally get it, boy, you get to go fast.
The major problem with walking on 2 roads is that you only have so much time in your life. I need time for the ones I love and then I need some sleep now and then. I would not mind switching, but then there should be enough work. Unfortunately, all the interesting stuff is still in Java. So for now its Java for me. But I'll keep looking...
Wednesday, May 10, 2006
CMS blues
Somehow CMS systems always have disadvantages (even the ones I wrote myself e.g. BackStream's ECMS :) ). They are always of one or more of too proprietary, too large, too strict, too flexible, not multilingual, without workflow, too data oriented (instead of task oriented), too hard to configure, too hard to program, too slow, too ugly URLs, too etc. etc.
I am currently looking into a Ruby on Rails CMS called Radiant. So far it has the following pros:
- it is nice to look at
- it is still small
- it pretty powerful while still easy to follow (possible thanks to Ruby) It still needs a lot of work. For example there is currently not even support for images and stylesheets. Still the way things are structured make me think this CMS will come a long way towards the ultimate CMS. Lets spend some more time on this...
- it is nice to look at
- it is still small
- it pretty powerful while still easy to follow (possible thanks to Ruby) It still needs a lot of work. For example there is currently not even support for images and stylesheets. Still the way things are structured make me think this CMS will come a long way towards the ultimate CMS. Lets spend some more time on this...
Subscribe to:
Posts (Atom)