Tuesday, April 15, 2008
Tuesday, April 8, 2008
Google App Engine and dynamic languages
Google has launched Google App Engine. It's a big news. But look at this:
You see, Python is their first choice as the main language for Google App Engine. It's not that surprising, Google is known to be a Python company. I'm pretty sure that Java, .Net and Ruby support will be available very soon as well. I wonder when will be the first time that some of the Google (or other companies) services are available only with dynamic languages.
What is my point here?
Python or Ruby seem to be good candidates. If you ask me - if you come from .NET world go for IronPython, if you come from Java choose JRuby. That's a good start. Good luck!
"Although Python is currently the only language supported by Google App Engine, we look forward to supporting more languages in the future."
You see, Python is their first choice as the main language for Google App Engine. It's not that surprising, Google is known to be a Python company. I'm pretty sure that Java, .Net and Ruby support will be available very soon as well. I wonder when will be the first time that some of the Google (or other companies) services are available only with dynamic languages.
What is my point here?
If you are serious about your career in IT then you have to start learning how to develop software with dynamic languages.
Python or Ruby seem to be good candidates. If you ask me - if you come from .NET world go for IronPython, if you come from Java choose JRuby. That's a good start. Good luck!
Wednesday, April 2, 2008
BDD examples with user stories and Webrat
This is the best BDD explanation I have ever seen. It explains all the philosophy behind BDD, shows how it fits with RSpec stories, and how you can use Webrat to create a high-level integration test. It even shows how to use Selenium with RSpec stories!
Integration Testing in Ruby with RSpec's Story Automation Framework by David Chelimsky
Big thanks to David Chelimsky!
Integration Testing in Ruby with RSpec's Story Automation Framework by David Chelimsky
Big thanks to David Chelimsky!
Thursday, March 27, 2008
Going to Euruko 2008?
Oh, how I love the conference season!
After attending the SFI conference in Krakow (which was great, BTW!) I'm ready to go to Prague.I'm going to be at the Euruko 2008 conference. Their program looks really interesting! All things that I like: Ruby, JRuby, testing. Hey, there's even a talk about AOP in Ruby!
I'll be in Prague from Friday afternoon till Sunday evening, and I'm always happy to chat about Rails, TDD, Agile, JRuby.
I'll try to comment about the conference on my Twitter. Peter Cooper is also going to update his twitter. Any other Twitterers in Prague?
See you in Prague!
After attending the SFI conference in Krakow (which was great, BTW!) I'm ready to go to Prague.I'm going to be at the Euruko 2008 conference. Their program looks really interesting! All things that I like: Ruby, JRuby, testing. Hey, there's even a talk about AOP in Ruby!
I'll be in Prague from Friday afternoon till Sunday evening, and I'm always happy to chat about Rails, TDD, Agile, JRuby.
I'll try to comment about the conference on my Twitter. Peter Cooper is also going to update his twitter. Any other Twitterers in Prague?
See you in Prague!
Andrzej's Rails tips #9
link_to_remote and GET request
If you're working with link_to_remote and you are surprised with a message like the following:
Only get, put, and delete requests are allowed.
then you just need to know that link_to_remote uses POST request by default. All you need is to do is to add :method => :get to the method call.
Use schema.rb to create a new database
Keep the schema.rb file in your Subversion/Git/Mercurial repository and make sure it's up-to-date. It's very useful when you want to create a database without using migrations. You just call rake db:schema:load.
As the documentation states:
"Note that this schema.rb definition is the authoritative source for your database schema. If you need to create the application database on another system, you should be using db:schema:load, not running all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations you'll amass, the slower it'll run and the greater likelihood for issues)."
If you're working with link_to_remote and you are surprised with a message like the following:
Only get, put, and delete requests are allowed.
then you just need to know that link_to_remote uses POST request by default. All you need is to do is to add :method => :get to the method call.
Use schema.rb to create a new database
Keep the schema.rb file in your Subversion/Git/Mercurial repository and make sure it's up-to-date. It's very useful when you want to create a database without using migrations. You just call rake db:schema:load.
As the documentation states:
"Note that this schema.rb definition is the authoritative source for your database schema. If you need to create the application database on another system, you should be using db:schema:load, not running all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations you'll amass, the slower it'll run and the greater likelihood for issues)."
Monday, February 25, 2008
Andrzej's Rails tips #8
Resource controller and 'new' action
If you want to refer to the 'new' action using resource controller, you have to use the 'new_action' method.
BTW, if you want to do the same operation before both 'new' and 'edit' actions in a resource controller, you can do it like that:
Migrations and removing defaults
If you have some default values set on some columns, then you can remove them using ':default => nil'.
Like that:
If you want to refer to the 'new' action using resource controller, you have to use the 'new_action' method.
BTW, if you want to do the same operation before both 'new' and 'edit' actions in a resource controller, you can do it like that:
[new_action, edit].each do |action|
action.before { @product_types = ProductType.find(:all) }
end
Migrations and removing defaults
If you have some default values set on some columns, then you can remove them using ':default => nil'.
Like that:
change_column :users, :name, :string, :default => nil
Tuesday, February 19, 2008
Andrzej's Rails tips #7
Dumping and loading data
Recently, I was in a need to dump data from a sqlite database and load it to a mysql database. There are many ways of doing such a task. One of them is using a plugin released by the Heroku people - YamlDb.
You can install it with the following:
attachment-fu and capistrano
I use attachment-fu for one of my projects. One of the open questions here is how to deal with the files that our users uploaded to the server. I use capistrano 2, and ideally I prefer to have everything automated. The way you can use capistrano to deal with uploaded files is to have a directory which will be shared across different releases (the same as logs).
First, we need to tell attachment-fu that the upload directory is going to be public/uploads. Then, we need to tell Capistrano that public/uploads is going to be a shared directory. Both those things are nicely explained in the following article:
Working with attachment_fu
Recently, I was in a need to dump data from a sqlite database and load it to a mysql database. There are many ways of doing such a task. One of them is using a plugin released by the Heroku people - YamlDb.
rake db:data:dump
rake db:data:load
You can install it with the following:
script/plugin install http://opensource.heroku.com/svn/rails_plugins/yaml_db
attachment-fu and capistrano
I use attachment-fu for one of my projects. One of the open questions here is how to deal with the files that our users uploaded to the server. I use capistrano 2, and ideally I prefer to have everything automated. The way you can use capistrano to deal with uploaded files is to have a directory which will be shared across different releases (the same as logs).
First, we need to tell attachment-fu that the upload directory is going to be public/uploads. Then, we need to tell Capistrano that public/uploads is going to be a shared directory. Both those things are nicely explained in the following article:
Working with attachment_fu
Subscribe to:
Posts (Atom)