Mittwoch, 31. Juli 2013

Developing is rhythm and meaning

Henri Matisse said: "Jazz is rhythm and meaning". Perhaps, we can adapt it to: "Developing is rhythm and meaning"

I made my first pull request for the first story to the gem voluntary and Mathias exceptionally deployed it on production before the end of the iteration using capistrano to show the release process on the server, github and RubyGems.org.
So a registered user can now nest areas on production.

Also, we completed the story: areas filter for projects through area page. So we can see the area' s projects on the area page.

Then, we started a new story: areas filter for projects on the portal of recommended / qualified work for the worker and project monitor pages for the manager.

We decided to not directly show the stories table but the areas table after selecting a product as a worker, then show a projects table behind the area link and the old stories table behind the project link.

Probably we complete the current story on Friday.

Bye!!!





Dienstag, 30. Juli 2013

Completion of first story.

Today, we needed some extra time for the completion of our first story with its last task because of dependent new lessons about a new gem simple_navigation, cross site scripting protection through safe html, cucumber debugging, Array and String handling, meta programming through eval vs. send or method_missing and its pros/cons.

I also had the chance to put some previous lessons learned like "reverse engineering" and duck typing into practice.

The task was about including the links of ancestors in the breadcrumb of the area page.

To complete the story we covered all layers of the implementation with 1 new cucumber scenario (happy path) for the area resource and decided against separate unit tests for each layer.

We documented the story implementation through version control commits and pushed it to github (Diff).

Tomorrow we will start the next core story about filtering projects by area.

Bye!!!!

Montag, 29. Juli 2013

Implementation of first story: nesting support for areas

Today we started the first iteration with a story about enabling nesting of areas in the core product of voluntary.

On the areas page we only show root areas and on the area page we now show a table of child areas.
We also implemented a link on the area page to add a new child area by passing the current area as the parent through the new area form.

Tomorrow I will complete the story with the last open task to show the current path in the breadcrumb of the area page, increase the test coverage and start the next core story about filtering projects by area.

During the resolution of this story Mathias showed me some methods about studying new and old code to integrate a feature well like interaction diagrams and code traces.
I also get to know debugging to fix today's bugs with a debugger in a IDE like RubyMine, the debugger gem for the terminal, debugging for the poor man (raising exceptions) and the gem better_errors.

I also installed Aptana on my laptop to compare with Sublime.

Tomorrow more!!






Sonntag, 28. Juli 2013

Trees with Ancestry

Today I have been studying a railscasts for trees with Ancestry.

"http://railscasts.com/episodes/262-trees-with-ancestry?view=asciicast"

First of all, I created the model for Message. The problem is the model Message appears empty in the example code. To have the example running before using Ancestry, you need the following code:

class Message < ActiveRecord::Base
  attr_accessible :content
end

And the schema has to be:

  create_table "messages", :force => true do |t|
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.text     "content"
  end

A thing that I made different from the railscast is using simple_form for the form. The code I used is:

<%= simple_form_for @message, html: { class: 'form-horizontal' } do |f| %>
  <%= f.error_notification %>
  <%= f.hidden_field :parent_id %>
  <%= f.input :content, label: 'New Message', :input_html => { :rows => 8 } %>
  <%= f.button :submit, "Post Message" %>
<% end %>

I wasn't able to apply an indent in the nested messages using css, but at least I have ancestry running.

Step by step.





Freitag, 26. Juli 2013

Stories for the first iteration 2/2

Today we have completed the pragmatic story definition for the first iteration: https://www.pivotaltracker.com/s/projects/871843

The iteration should add a vacancy-resource-allocation through a new product voluntary_classified_advertisement and nested facet filter of areas at least for projects through the core product of voluntary.
As a reserve story I can also implement a nested facet filter of regions for projects.

My homework: Learn the concepts and code needed for next iteration with three railscasts:
  • http://railscasts.com/episodes/262-trees-with-ancestry
  • http://railscasts.com/episodes/162-tree-based-navigation-revised?view=asciicast
  • http://railscasts.com/episodes/273-geocoder
Good weekend!!


Mittwoch, 24. Juli 2013

Stories for the first iteration 1/2

After my last entry, I continued working and used "before_filter :require_login" in ApplicationController to apply Authorization in all the application. But, for some controllers I had to use "skip_before_filter :require_login". The login and sign up pages must be public!

Today, Mathias and I have been working together.

First of all, we reviewed my homework and talked hereby about descriptive and shallow nested routes. We used http://DiffChecker.com to see the differences of generated routes before and after using shallow routes and saw with this comparison that our Rails 3 version seem to not support it (it's also not mentioned on current Rails 3 guide for routing but on the guides for 2 and 4).

As a response to my last blog post he showed me examples for when it's a good idea to use Simple Form even when we don't have a model. For instance DRY usage of themes like Twitter Bootstrap, which I should enable for all the forms of my learning app).

He also explained the concept of mocking objects like (3rd Party) dependencies with RSpec and advantage of working on dependent stories like frontend and backend stories in parallel.

After this we started the backlog grooming and wrote some stories in Pivotal (https://www.pivotaltracker.com/s/projects/871843). We decided to use the ref number from Pivotal in commits to easily select code for the code review step in each story-lifecycle.

We created a quick wireframe with the web demo of http://balsamiq.com/ as a specification for the task review step story.







I have to say that extracting stories is a hard work but we plan to complete the backlog grooming together on Friday where we evaluate free ? map-services like http://OpenStreetMap.org and gems like http://www.rubygeocoder.com/ for easier geocoding of projects, vacancies as well as resources.

The start of the implementation iteration is planned for Monday. Each iteration is 2 weeks long.
Between iterations we will review stories, deploy accepted stories and specify stories for the next iteration in detail. Denied stories will be completed in the next iteration or moved to the ice box.

Tomorrow more discoveries!!!

Dienstag, 23. Juli 2013

How I test?

Today, I have made http://railscasts.com/episodes/275-how-i-test
It has been hard because there were new concepts for me.

The problems that I have found in the railscast are:

- In code "password_resets_spec.rb" after the "it "emails user when requesting password reset"" a "do" is needed
- Factory.define is deprecated, so I used FactoryGirl
- After "rake db:migrate", a command "rake db:test:prepare" is needed

I achieved pass all tests!!!!



Montag, 22. Juli 2013

Railscasts: Github, simple form and Authentication from scratch

Yesterday I read the following railscasts. They weren't difficult for me because we have been working these days with these concepts.

http://railscasts.com/episodes/300-contributing-to-open-source
http://railscasts.com/episodes/234-simple-form

Today I started to read the railscast:

http://railscasts.com/episodes/275-how-i-test

But if I wanted to follow it, I had to make a previous railscast:

http://railscasts.com/episodes/250-authentication-from-scratch?view=asciicast

So I started this railscast.

The differences between my code and this railscast are:
- I used my project_learning_app instead of creating a new one.
- I used the simple_form for the sign_up form
- I haven't changed my home page.
- I had to use
  attr_accessible :email
  attr_protected :password_hash, :password_salt

  instead of all attr_accessible.

- For the log_in form I didn't want to use simple form. The problem is for the log_in form you obtain data for an object (Session) that doesn't have a Model. Although there is a workaround for using simple form without a Model, I preferred using form_tag instead of simple_form.

From this point I'll add links for the navigation (the rest of the railscast) and then I have to bind the rest of the application with the Authentication.

Tomorrow more!!!

Freitag, 19. Juli 2013

Minimum viable Product for first Iteration

Today we have continued with the brainstorming about use cases and the future vision of the product.

Also, I have understood the model of voluntary.

As a summary of the brainstorming, we figured out the minimum viable product of disaster assistance for the crowdsourcing engine voluntary.
This is a more abstract product voluntary_classified_advertisement for which we will create stories in our backlog next week and then start our first implementation iteration of about 2 weeks.

At the end of the iteration we will release the new product on http://volontari.at, the example host for the voluntary engine and people will be able to create new disaster assistance projects for demo purposes there.

I have finished the task model with his views and controller. It works and is in Github.

Mathias gave me a short list of railscasts, which are good for my studies in this moment.

Have a nice weekend!




Mittwoch, 17. Juli 2013

Brainstorming

Today we had an interesting day.

First, Mathias taught me:

- nested resources in MVC pattern
- how to associate models through simple_form gem
- duck typing concept of a dynamic language like Ruby
- "Test driven development-Mantra": red/green/refactor

I made some changes in our learning application (yet another project management tool) to link the projects with the stories and filter them by its project.

Then we had a braimstorming to obtain the Use Cases of our disaster_assistance application. Some of the tools we used:

- PivotalTracker.com: For Scrum stories
- http://Etherpad.org through http://piratenpad.de: Realtime-Collaboration Document tool

My homework:

- In the learning project I should create all elements of a Task (Model, Controller, View)
- think about the disaster-assistance application
- replay all the new information of the past days

A lot of work but it's so beautiful!







Dienstag, 16. Juli 2013

Magic

We had two intense days with Rails.
I created an application called project_learning_app.
When I followed the railsguide (http://goo.gl/xxUQw) I didn't understand the relationship between the controller and urls. Mathias had explained me how Rails works internally and now I understand.
Part of the magic of Rails resides in convention. Thanks to this convention, when you go to a new project, you don't need a lot of time learning how the project is implemented.

Mathias also explained me:
- the semantic versioning and the groups in GemFile.
- the security with attributes of a model
- Callbacks
- Visibility (public, protected and private)
- Test with Cucumber and Rspec
- and more things

Some interesting tools we used:
- sextant to see the routes
- creately to make an UML diagram
- pgAdmin III to view databases in postgres
- FactoryGirl to create fake data
- P4Merge: Diff of files
- simplecov: Generate a report indicating the porcentage of your code that is covered with tests.

Tomorrow more.



Freitag, 12. Juli 2013

Rails 4 or Rails 3?

Today, I've been working with http://guides.rubyonrails.org/index.html. The last version of the guide uses Rails 4 and Volontari uses Rails 3.

First, I thought that I was able to make the blog of the guide with Rails 3, until I arrived to Strong Parameters. I had an error with these parameters, so I decided to use Rails 4.
For updating Rails, I used http://railscasts.com/episodes/415-upgrading-to-rails-4

I didn't know if updating Rails was going to affect to Volontari app. I solved the problem with the blog of the guide, but Volontari, didn't work. So I made a branch in Github, I installed with bundle, started the rails server and it worked. I don't want to make a commit to Volontari until I speak with Mathias.

Then, I continued until point 5.12. of the guide.

Although I was able to continue when I had an error, I have a lot of doubts about how Rails works. So, I'll have to ask Mathias about that. I think that today has been a good day of work and I was able to see how easy is making an application with Rails.





Mittwoch, 10. Juli 2013

Kick off of volontari.at

I arrived to Berlin on Monday to a new life. Part of this new life is learning Rails. And I have help from my coach Mathias Gawlista.

We had a kickoff today at http://sanktoberholz.de listening to Buena Vista Social Club (http://goo.gl/IZIvc) and more cool music. Mathias has showed me the arquitecture of Volontari and some examples that this platform can do. Volontari.at (future Voluntary.Services) is a demo crowdsourcing platform that uses http://rubygems.org/gems/voluntary.

With the help of Mathias, I have cloned the Voluntary project from, installed postgresql and mongodb, and run the Volontari app in my laptop. Finally, I have pushed to Github.

I have to learn a lot of things but I feel so excited for this project.

Berlin is Cool!!