adva_cms

A few days ago I stumbled over Sven’s current project adva_cms which is a cms, mixed from mephisto, beast and signalwiki. The basis is mephisto, with all the pro and cons (aka page caching), everything else is included as plugins with Engine.

I hope to use it for a small community site this month and will post updates here on the experiences with adva_cms.

everything in plastic*

Last month I bought plasticpilots.com from Alex (from plasticshore.com), trashed the expression engine it was running on and wrote a completely new software called plasticairships. The new software is running on plasticpilots for a week now, a few of bugs have been fixed since and improvements in the design been made.

I’m not sure if anyone else will ever find good use for it. Alex and I did a redux version this week, for a workshop he does next month. The redux looks totally different of course, very minimalistic, and it has a few features from feedme (which will get some loving soon).

Btw, plasticairships is running on rails 2.1, so it’s totally covered with named_scopes, the new eager loading and other stuff.

single table inheritance in rails 2.1

With the new “rails 2.1” there was a small but for me important change in the STI that made my life easier. Thanks to divoxx for his enhancement. It didn’t show up in the docs yet but I’ll give you an example where.

The documentation’s example consists of the models Company, Firm and Client, very simple. My real life example (it will be on the new plasticpilots website) consists of a model Comment that I use as an association for Post and Site. So Post and Site have many comments. To save duplication I use STI of course and to keep the directories clean I have Site::Comment << Comment and Post::Comment << Comment (and maybe more in the far future of 2009). Old rails versions did a demodulize the class names so I would have Comment in my type column and a lot of confusion. With rails 2.1 it’s the full class name in the type column and I can kick all the work-arounds I had previously.

Btw, this behaviour is the new default, so I guess a few people will be pissed off, but can simply set: ActiveRecord::Base.store_full_sti_class = false

rails 2.1, goldberg but no postgres

Sure it’s a strange combination but mysql is most people’s favourite and goldberg is my very personal favourite.

Anyways, today I was upgrading to rails 2.1.0 and guess what, it didn’t work anymore cause some pg was being required which I don’t have. The problem has basically two causes. First the rails devs added a few lines to the postgresql connection adapter to enforce loading the pg or postgresql gem. Second, goldberg was a bit sloppy with its model monkeypatching. The fix is very simple, just a few changes to lib/goldberg/model.rb basically adding the check that goldberg is using in it’s migration extensions anyways.

You can find my patch over at goldberg’s rubyforge bugtracker

Update: A few more issues came up, so you might just want to git clone git://github.com/TomK32/goldberg.git my github repository into vendor/generators and use it like normal.

recent activities

I’ve been doing a lot of open source in the last two months and you might want to check out the results so far. And besides all that there’s the githorde of course.

FeedMe!

FeedMe! is a RSS planet that was started by Daniel Lindsley and I improved it to match my needs for salzburg-weblogs.net. It’s still incomplete and I will put a few more days of work into.

exabuch

exabuch is a german billing web-app and took over this one as well. I have quite big plans with it, also on a commercial level

plastipilots

My newest investment is this very old design website plasticpilots that I’m about to buy from a guy living nearby (yeah, very big internet). It’s getting a completely new software as replacement for expression engine and the new software will be open source as well: plasticairships. I think it will be very easy to customize for any kind of showcases or portfolio.

jaxdoc: Ruby on Rails docs on AJAX

Rails API with jaxdoc I became big fan of the jaxdoc generator for rdoc in the last months. It’s amazing to find out that you can extend rdoc to generate the docs (and I really love having docs on my local machine) the way you want it. Jaxdoc provides you with ajaxfied documentations which make searching in the docs much faster. Not to forget that you the source of the methods, just like normal rdoc. There are a few download packages at railsbrain.com and one for ruby core at rubybrain.com. But there’s no howto for creating your own docs, so I hope this example to generate for Rails 2.0.1 is complete enough for everyone. If not, please drop me a note. The exclusions could be defined a bit better I guess. And of course you can include other gems if you want a fat documenation.

1
2
3
4
sudo gem install jaxdoc
VERSION = '2.0.1'
cd /opt/local/lib/ruby/gems/1.8/gems/
rdoc --op ~/docs/rails-$VERSION --fmt ajax --exclude .*generator.* --exclude .*test.* --include actionmailer-$VERSION activerecord-$VERSION actionpack-$VERSION activesupport-$VERSION activeresource-$VERSION rails-$VERSION

date_select with fewer selects

date_select is sure an useful helper in when building forms, but sometimes you don’t want the year to be a select but a text input for practical reasons or for typing in the dates of ancient philosophers.

My first idea was to overwrite date_or_time_select which is called by date_select but why not a step further? Instead of select_year giving me a select box I’ll get a text input working just like the select. Put the code lines into your application helper file or into a new file in your lib. I’m not exactly sure how to have both variations in one app, any hints are welcome.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module ActionView
  module Helpers
    class InstanceTag
      def select_year(date, options = {})
        val = date ? (date.kind_of?(Fixnum) ? date : date.year) : ''
        if options[:use_hidden]
          hidden_html(options[:field_name] || 'year', val, options)
        else
          name = options[:field_name] || 'year'
          tag :input, { "type" => "text", "name" => name, "id" => name, "value" => val, :size => 4 }
        end
      end
    end
  end
end

das war der railsrumble

Mann bin ich müde. Und die Schulter schmerzt auch in angemessener Art und Weise. Denkmaltisch ist nicht ganz so fertig wie ich es gehofft hatte, aber benutzbar. Das Javascript, eigentlich ja das wichtigste damit es der User leichter hat, fehlt noch völlig. Was jetzt noch an Verbesserungen kommt wird auf den subnet server laufen, aber man darf trotzdem gerne ab Mittwoch für die etwas unfertige Version abstimmen. Ein Spass war's, viel Spass im IRC und letzte Nacht viel zu lange wach geblieben. Und die anderen Teilnehmer findet man in der großen Liste.

times running up

I was really lazy today but time is running up: timeanddate.com

rake stats

Right now the app ist still fresh and it will take hours before there's something to see at denkmaltisch.railsrumble.com. TomK32:~/Arbeit/subnet/denkmaltisch/denkmaltisch tomk32$ rake stats (in /Users/tomk32/Arbeit/subnet/denkmaltisch/denkmaltisch) +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 192 | 168 | 2 | 12 | 6 | 12 | | Helpers | 39 | 34 | 0 | 2 | 0 | 15 | | Models | 160 | 122 | 6 | 16 | 2 | 5 | | Libraries | 68 | 47 | 1 | 7 | 7 | 4 | | Components | 0 | 0 | 0 | 0 | 0 | 0 | | Integration tests | 95 | 79 | 1 | 6 | 6 | 11 | | Functional tests | 267 | 227 | 2 | 34 | 17 | 4 | | Unit tests | 173 | 136 | 5 | 18 | 3 | 5 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 994 | 813 | 17 | 95 | 5 | 6 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 371 Test LOC: 442 Code to Test Ratio: 1:1.2

Neue Website bzw. Unterschriftenaktion

Die neue Website für talktogether ist noch nicht ganz fertig, die Unterschriftenaktion war jetzt das wichtigste und die Inhalte kriegt man noch auf der alten Website. Anyways hab ich das Grundgerüst natürlich mit Ruby on Rails gemacht, meine zweite „fertige“ Website mit Rails und diesmal ging's wirklich extrem flott. Ganze drei Stunden hab ich damit letzte Woche verbracht. Inkl. Webdesign (sic!) und deployment. Fast schade dass ich erst in drei Wochen den Rest fertig krieg. Vorallem auf den Rake-Task der die alten HTML-Files konvertiert und importiert freu ich mich. Sowas hab ich schon lang nicht mehr gemacht. $ rake stats (in /data/rails/talktogether) +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 93 | 75 | 3 | 13 | 4 | 3 | | Helpers | 7 | 6 | 0 | 0 | 0 | 0 | | Models | 26 | 20 | 4 | 1 | 0 | 18 | | Libraries | 0 | 0 | 0 | 0 | 0 | 0 | | Components | 0 | 0 | 0 | 0 | 0 | 0 | | Integration tests | 0 | 0 | 0 | 0 | 0 | 0 | | Functional tests | 36 | 26 | 4 | 6 | 1 | 2 | | Unit tests | 40 | 28 | 4 | 4 | 1 | 5 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 202 | 155 | 15 | 24 | 1 | 4 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 101 Test LOC: 54 Code to Test Ratio: 1:0.5 Die stats schaun ganz gut aus, oder? 155 LOC, ich müsste noch etwas mehr Tests schreiben für ein 1:1 Verhältnis. Bei Kampodscha sind's zur Zeit 1137 LOC.

We are ready rumble!

Endlich. Heut hab ich noch den guten alte Toni besucht (no website since 1999) und ihn ganz heiß auf Rails gemacht. Ja, da bin ich echt stolz drauf. Aber der Guru hat ja eh schon seit 2002 ein kaum gelesenes Ruby-Buch daheim rumliegen. respect for that. Und als zwoter ist noch unser treuer subnet-user Peter.W. dabei der sich der Grafiken erbarmt. Jetzt fehlt mir nur noch eine Bestätigung vom Denkmal und die Sache ist perfecto :-) Und noch ein kleines Tocotronic-Zitat:
Du musst nie wieder in die Schule gehen PHP programmieren.

Keiner Lust auf Railsrumble?

Jetzt hab ich immer noch keine Team-Mitglieder für den Railsrumble. Und das obwohl ich nur nicht bei den Mitgliedern von subnet (so etwa 300) sondern auch noch auf die Mailinglist des Informatik Fachbereichs gepostet hab. Alles faules Pack meine lieben Komilitonen. Hat wohl keiner Lust drauf mal ein Wochenende mit Programmieren zu verbringen und nebenbei auch noch was neues zu lernen. Echt schade. Anyways, die Idee für den Railsrumble steht fix und ich hoffe auch mit dem Kaffee Denkmal kooperieren zu können. Die Idee hab ich noch nirgends erwähnt daher: Inspiriert von den bunt bemalten und beschriebenen Tischen im extrem coolen Vereinslokal Denkmal in Salzburg entsteht eine Website deren User Bilder hochladen können und diese auf eine virtuellen Tisch kleben können. Ein wenig Bildbearbeitung soll natürlich auch möglich sein. Idealerweise sollen die fertigen Tische wieder ausgedruckt werden und als Tischdecken, oder auch zum ordinären an-die-Wand-hängen, wieder zurück ins Denkmal.

Wieder eine Auktion: MyConfPlan

Jetzt waren letzten Monat schon zwei Twitter Clones dran und diese Woche ist es was ganz neues: MyConfPlan. Dr. Nic hat die Seite mit Ruby on Rails programmiert und versteigert sie jetzt für einen wohltätigen Zweck bei eBay. Die aktuell AU$355 sind immer noch recht bilig will ich meinen.

Railsrumble

Letztes Jahr gab's schon den Railsday, und dieses Jahr am 8. und 9. September den Railsrumble bei dem es darum geht innerhalb von 48 Stunden eine Webapplikation mit Rails zu programmieren. Ein paar Preise soll es auch zu gewinnen geben auch wenn noch nichts dazu zu lesen ist. Für mich wird's ne gute Vorbereitung für die Schmiede denk ich mir. Ein Team bräucht ich halt nur noch, falls also Leute aus der Umgebung mitlesen und Lust haben, bitte melden.