Testing CSV Download With Cucumber
Thanks to Upstream for their blog post on testing pdfs with cucumber.
Testing CSV download is exactly the same apart from that we do not need to turn the PDF to text, simply because…it isn’t a PDF…
(From RedWritesHere)
On the way to Rails 3 - a link list
Rails 3 is coming! The first beta release of the new version is right around the corner and it should be released today or tomorrow… the release notes are already in the master branch.
For me this feels like the release of Rails 1.0 and I’m so excited about all the new changes and the great new features.
Rails 3 is a lot about changing your mindset to make use of the all new features and concepts.
I’ve collected some reading material for you about Rails 3 and the upcoming changes. Since the final Rails 3 is not yet released excpect some of the stuff that’s mentioned to be changed or already have changed in the beta. But this is a good start to catch up with all the Rails awesomeness:
Must-reads
Actually all of these links are “must-reads” but for those of you with little time. Read at least these:
- official Rails 3 relase notes
- Live Coding Rails 3 upgrade a free peepcode
- Exploring Rails 3 - A Free Two Hour Online Conference
- The Path to Rails 3 - Intorduction - A very awesome introduction to the big picture of Rails 3. read it!
- Rails and Merb Merge: Rails Core (Part 4 of 6)
- Rails 3 Upgrade plugin - checks your code and gives you hints to make it Rails 3 compatible (first announcment)
- Greenfielding new apps with the Rails 3 beta
Router
ActiveRecord / ActiveModel
- Active Record Query Interface 3.0
- Rails 3.0’s ActiveModel: How To Give Ruby Classes Some ActiveRecord Magic
- ActiveModel: Make Any Ruby Object Feel Like ActiveRecord
- Arel source code and readme
- Why Arel
- validates :rails_3, :awesome => true great post about the new validations in Rails 3
ActionMailer
Views / JavaScript
Controller
- Render options in Rails 3
- Three reasons to love ActionController::Responder
- Default RESTful Rendering
- Cleaner RESTful Controllers w/ respond_with
Rack
- The CodeRack Contest
- 21 Rack Middlewares To Turbocharge Your Ruby Webapps
- Rails on Rack(not Rails 3 specific)
Gem, Plugins, Dependencies
- Bundler 0.9 - heading towards 1.0
- Bundler is the new hotness: deploying rails apps with bundler and capistrano
- Is your plugin ready for Rails 3?
Generators
- Making generators for Rails 3 with Thor
- Customizing generators in Rails 3
- Discovering Rails 3 generators
I18n
Other great reading
- Rails now seems to act like a grown up
- Build Sinatra on Rails 3
- My five favorite things about Rails 3
- Better Ruby idioms- read this for plugin development
- Rails 3 ready plugins
- Rails 3 and Passenger
- Extending Rails 3 Talk by @wycats at pivotallabs
- Mail gem Version 2 Rails 3 is now using the new mail gem. This is a great writeup about new features in version 2
General Rails
I’ll update this list with upcoming Rails 3 resources.
update:
1. Added link to I18n changes (thanks @ Carlos)
Railscamp 09 UK - Margate
Letzte Woche haben wir das Railscamp UK 2009 besuchen können. Zusammen mit Sebastian haben wir uns mit dem Auto nach England auf den Weg gemacht. Nach zahlreichen Stunden (u.a. weil wir wegen eines Streiks der französischen Fähre See France 3 Stunden auf den Eurostar warten mussen) sind wir dann Freitag Abend mit einem Kasten Mate und einem Kasten Mühlen Kölsch in Margate angekommen. Zwei weitere spannende Tage haben wir dort verbracht. Neben Vorträgen wie CouchDB von Alexander Lang war auch wie Hacking, Gaming (We love urban terrror :) und Networking angesagt. Zusammen mit Rany haben wir unseren “google of counters” gebastelt (mehr dazu in einem weiteren Blogpost). Als Equipment diente uns dieses Jahr Bananajour - der Nachfolger von Gitjour bietet eine nette Weboberfläche um verfügbare Repositories zu sharen und clonen.
Ein paar Fotos vom Dreamland Margate und dem Railscamp gibt es in der Flickr-Gruppe RailscampUK aber auch im einzelnen hier, hier,hier, hier, und hier. Es war auf jeden Fall wieder eine sehr coole Zeit mit Mr. Jabba, Pat und Co. wir freuen uns auf das Railscamp nächstes Jahr. Nicht zu vergessen aber ist das Railscamp Münster am 28./29. November bei Zweitag! Alle weiteren Informationen findet ihr auf der Railscamp Seite.
Static content in your Rails application
Our heros over at thoughtbot.com blogged about static pages and their newly released Rails engine high_voltage. High Voltage helps you dealing with simple, stupid static content pages that nobody wants but everyone needs. ;) (With static pages I’m thinking of imprint, about us, etc.)
In our projects we had a similar solution but to edit the pages more easily and without the need to deploy the whole application we’re saving the content in the database.
Because the database part was missing in high_voltage but I’ve really liked the idea to extract that feature into a rails engine I’ve created a fork last night.
My fork checks if there is a valid template file in views/pages/ - if not it checks the Database and renders the views/pages/show template.
How to use it?
Installation
script/plugin install git://github.com/bumi/high_voltage.git
Create pages
this is up to you. ;)
You can add static files to your app/views/pages/ directory or create a database entry:
HighVoltage::Page.create(:title => "Hello world", :body => "High Voltage! High Voltage!")
That’s it!
For more information check the original thoughtbot post” - You should follow their blog anyway! - And have a look at the readme.
Hope you like my addons.
What are your solutions for static pages?
Continious integration mit Hudson und Integrity
Continious Integration ist ein wichtiger Bestandteil von Software, vor allem wenn mehrere Beteiligte am Projekt Teilnehmen. Nach jedem Push wird dann der aktuelle Code vom CI-System ausgecheckt und die gewünschten rake-Tasks ausgeführt. Neben dem schon bekannten CrusieControll.rb gibt es noch zwei andere interesannte Cnotinious Integration Tools die ich kurz vorstellen möchte: Integrity und Hudson.
Integrity
Integrity ist sehr einfach gestrickt. Nach der relativ simplen installation kann man verschiedene Projekte hinzufügen. Der einzige “overhead” der noch ensteht, ist das zusammenstellen eines rake-tasks den Integrity nach jedem pull ausführt. Dieser einfacher rake-Task kann als Einstieg dienen:
Nach jedem Build können die Entwickler auch über die zu verfügung stehenden Notifier (Email, Campfire, IRC, …) über den Stand informiert werden. Weiterhin gibt es auch ein Growl-Plugin und Dashboard-Widget. Der Build der Applikation wird über Github via einem POST-Webhook zu Integrity angetriggert.
Der einzige Nachteil ist, dass bei lang-andauernden Builds der entsprechende Webserver einen Timeout erreicht. Der kann natürlich hochgesetzt werden.
Hudson
Hudson ist eine weitere Alternative. Es ist ein Java-Basiertes CI-System und wird out-of-the-box mit einem Webserver ausgeliefert. Entsprechende Debian-Packages gibt es hier. Hudson bietet gegenüber Integrity mehr Konfigurationsmöglichkeiten, daher dauert es ein bisschen länger bis man sein neues CI-System am laufen hat. Meet-Hudson bietet eine gute Übersicht über Hudson.
Der oben schon vorgestellte Rake-Task kann ebenfalls für Hudson verwendet werden. Allerdings müssen Plugins für eine Rake- und Githubunterstützung installiert werden (Git-Plugin und Rake-Plugin).
Bei Hudson ist der initiale Konfigurationsaufwand zwar geringer als bei Integrity, dafür müssen viele Plugins installiert und konfiguriert werden um seine “perfekte” CI-Umgebung ans laufen zu bekommen. Unschön an Hudson ist die fehlende unterstützung des triggern eines Builds über einen POST-Webhook. Stattdessen kann dies nur über ein GET getriggert, was aber seitens Github nicht unterstützt wird. Eine Alternative ist das periodische abprüfen von Änderungen in der Repository.





