Since I came to Ruby from the Java and PHP world I’ve found many expressions used in Ruby cryptic and I’ve been trying to avoid them in my daily life. After years and thousand lines of Ruby code I’ve read, I feel a need to change the way I write the code. I want to make my code look better, readable and preferably save some keystrokes.
In software engineering, an anti-pattern (or antipattern) is a pattern that may be commonly used but is ineffective and/or counterproductive in practice.
Read moreWhen we started working on Deltacloud API rewrite to Sinatra, we realized that creating routes for every single Deltacloud collection can be pretty frustrating. Usually, when you writing REST based application in Sinatra you end-up with typing the same CRUD operations for every collection of resources your application have.
This was a bit frustrating, since many operations are similar and basically doing the same thing. For example the ‘show’ operation is usually defined like this:
Read moreDeltacloud API was presented at FOSDEM 2012 in Brussels. As I promised to some people on the conference, I published an online version of my talk. I was asked some interesting questions about extending the API to support more features like Amazon RDS or how OpenStack compete with Deltacloud API. Both are worth more discussion, so if anyone is interested in starting this thread in Deltacloud API mailing list, feel fres to do so.
Read moreAs you may already know, Red Hat announced it’s own opensource PaaS called OpenShift this year. As many other PaaS services, like Heroku you can deploy your Rack applications easely using GIT without configuring anything. Since the Deltacloud API project I’m working on is a Sinatra application, thus Rack compatible, it would be great to offer our potential users a way how to quickly deploy Deltacloud API inside OpenShift. There are several benefits of doing that, like you don’t need to mess your system with installing Ruby libraries (which could be pretty painfull process, especially in operating systems like Windows).
Read moreThe main goal of writing such thing as a DSL is ussualy helping yourself to not repeat the same code over and over (keeping code DRY). Tradeoff for this approach is ussualy a piece of unreadable and complex code with simple purpose: To handle this DSL and translate it to Ruby language. Lets take a quick example:
rule :apache do enable 80 enable 8080 enable 443 name ’example.com' directory ‘/var/www/example.com’ update 120 end
Read moreYesterday we proudly announced the official release of Deltacloud API version 0.4.0. I would like to share with us the new features which are included in this release. I took several month to bump the release version so the list of new things is pretty log.
New command-line options The deamonized server is started on the background and it automatically logs to the system log. This option will be used widely in init scripts on Linux OS.
Read moreEven if we try hard in Deltacloud project to support as many different cloud providers as we can, we just can’t cover every cloud. Also, it might come that you’re building your own cloud based on some virtualization like libvirt or Xen and you have your custom tools to manage it but you want to offer a REST API for your service to make your customers happy. Then this small guide might be handy for you.
Read more