Ruby On Rails, Design, Simplicity, Web 2.0, Ajax, Mac and Tons of Pizza.

May 06

List tasks, upload files and hours worked.

Posted by Annalisa Afeltra in 2 comments digg this add to delicious

WhoDoes 2.0 has focused on making it easier for Project managers and their team members to collaborate and share files.

Project managers have an overview of the workload that is assigned to each team member and team members can view which tasks have been completed or which still need to be completed. Use the simple drag and drop tool to assign unassigned tasks to team members.

The following screenshot shows you how the task list is a clear overview of the workload assigned to each team member.

Screenshot of Task list

You can manage the documents required for a project inside the task to which the document might belong to, keeping documents accessible to other team members and in a unique place. Keep track of the number of hrs that has been dedicated to the task by uploading the hours worked on it with the easy to use hrs worked uploading table.

Screenshot of Uploading Task document and Hours worked

WhoDoes 2.0 Launch is coming soon…

May 06

WhoDoes 2.0 amazing groupware features

Posted by Massimo Sgrelli in Ruby on Rails - Whodo.es - no comments digg this add to delicious

WhoDoes 2.0 is almost ready to go, but in the meantime I’d like to show you one of most interesting features we have introduced with this wonderful new version: groupware.

Now you can let other people look for you inside the WhoDoes user’s directory and allow them to make you part of their team. This is actually a real innovative feature in project management tools where you can now staff your team in seconds.

To enable other people to find you easily, you’ll have to check your settings inside the Settings tab of WhoDoes 2.0:

You can easily decide to keep your identity hidden or simply let people that share your email domain find and staff you automatically or set it that all users using WhoDoes invite you inside their projects.

May 05

Your task list in WhoDoes 2.0

Posted by Massimo Sgrelli in Ruby on Rails - Whodo.es - 2 comments digg this add to delicious

As you probably already know, we will release a completely renewed version of our project management tool in a few days. It’s named WhoDoes 2.0 and could dramatically make project organization easier in your company, in your team or simply in your daily life.

One of the new features WhoDoes 2.0 introduces is the ability to group all the tasks in a project by team member, independently from the milestones through which the tasks are bound together.

It’s easier to understand how useful it is, by observing this screenshot:

Stay tuned to learn more about this revolutionary tool.

May 04

No useless marketing, improve your product!

Posted by Massimo Sgrelli in Got Things Done - no comments digg this add to delicious

I’ve just spent 2 hours reading a good book, I bought it about a year ago in Portland. It’s titled “Founders at work” by Jessica Livingston_. I’ve been very inspired by the interview of Joel Spolsky from Fog Creek, author of Joel on software – a blog I’ve been following since 2001.

He talked about the early days at Fog Creek and Fog Bugz product’s strategy. He said something about not to waste your time into complicated marketing strategies instead of working on your product. In this specific case he was referring to an affiliate program they developed up to Fog Creek:

The one thing we learned over 5 years is that nothing works better than just improving your product. Every minute, every developer hour we spent on anyone of these crazy things – although they had some marginal return on the work that we put into them – was nothing compared to just making a better version of the product and releasing it. If we had taken all the effort we put into these schemes and put it into moving our software development schedule ahead by the equivalent amount, it would have paid off much more.

Good tip Joel.

BTW I’ve seen he will be present at RailsConf in Portland this year
I look forward to see you there.

Apr 30

Tasking with WhoDoes 2.0

Posted by Annalisa Afeltra in News - Ruby on Rails - Whodo.es - no comments digg this add to delicious

Tasking items has never been so easy and simple with WhoDoes 2.0

How it is done…

The Task List gives you a clear indication of the workload for each team member, all tasks assigned to team members appear below their names and closed tasks are shown with the number of tasks that are closed.

WhoDoes 2.0 has taken working on paper and implementing it into the application. The shortcut add new task link enables you, just as in jotting down a “To-Do” list, to add new tasks unassigned or assigned to team members quickly and effortlessly.

With the simple drag and drop functionality, tasks that have not yet been assigned can be passed to team members by simply dragging the task to the name of the team member.

Any documents related to the tasks can be uploaded in the Documents uploaded section. Shared documents for the task are stored in a central point for team members to retrieve.

The project manager is kept up to date with the progress of the project and the number of hours that have been dedicated to each task. This is done with the easy-to-use hour uploading system within the task view, when the task has been updated the team is informed with an e-mail keeping everyone up to date.

Apr 29

Introduction to WhoDoes 2.0

Posted by Sandro Paganotti in News - Ruby on Rails - Whodo.es - 2 comments digg this add to delicious

Upcoming WhoDoes 2.0 is improved with more intuitive and easy-to-use features.

What’s new?

WhoDoes 2.0 makes it possible to start managing a project in a just few minutes, even more efficiently. Using just one of the new features Fast Planning, assigning tasks to team members, defining due dates, implementing task priorities and keeping your project’s progress under control is done simply and easily with WhoDoes 2.0

A new and innovative idea of sharing documents and e-mails has been built into WhoDoes 2.0, lost documents and e-mails will no longer be a problem. Team members will be kept up to date with WhoDoes’ new advanced centralized document and e-mail repository system which contains all the material that is related to the project with a new Project e-mail functionality.

Limited resources for a project is something in the past, WhoDoes 2.0 introduces network Teamwork. This will enable you to invite people to your team who are part of the WhoDoes network and have chosen to be visible. Finding resources is easier and simple. Not only can you find people to assign to your project with the WhoDoes network but you don’t need to re-invite users that already have a WhoDoes account, they can simply be added as a team member.

WhoDoes 2.0 has managed to integrate instruments into an online application making collaboration between team members and sharing of documents more efficient and easy for projects managed within the same office or projects with team members dispersed all over the world.

Apr 28

Coming Soon: Whodo.es 2.0

Posted by Sandro Paganotti in Events - News - Whodo.es - no comments digg this add to delicious

It took us a while but we’re finally close to the release date of Whodo.es 2.0.

The philosophy

What drove us to this release was the need to make our product as simple as working on paper. Most of your daily planning is normally done without following any particular schema, you simply start writing activities as soon as they come to mind and only then you choose who will be the person responsible for them.

While working in a team, it could occur that all players need to plan (or detail) their activities that could influence others, in this way it is necessary to use a tool that mixes collaborating and handling deadlines, in a smart way.

Nowadays a to-do list driven management system is the key factor for smart and easy project management. This statement is true, but we believe that it is not enough to manage a project’s workflow, the upcoming screencast gives you a taste of one of the amazing features that we have incorporated into the new version of whodoes to help make managing projects easier and successful.

The Screencast

More to come

Stay tuned to railsonwave.com to discover all the new whodo.es 2.0 features ! As usual we would be very greatful for any constructive criticism, comments or suggestions you would like to make about the upcoming whodo.es version.

Apr 23

Playing with methods

Posted by Sandro Paganotti in Ruby on Rails - 1 comment digg this add to delicious

I’ve recently bought a copy of The Ruby Way and I’m getting deeper and deeper into the most hidden and powerful Ruby features.

Yesterday I attempted for the first time to play with instance methods and I’m going to share what I discovered with you.

To start I want to remind you one of the most known Ruby introspection method:


 "ciao".methods
=> ["send", "%", "index", "collect", "[]=", "inspect", ... ]

by calling ‘methods’ on an object you get an array containing the name of all the methods that you can invoke on it (this include both its methods and the ones inherited from parent classes). But let’s go further: you can actually store a reference of one of these methods in a variable.


txt = "ciao" 
len = txt.method(:length)
len.call
=> 4

Now ‘len’ points to the method ‘length’ of the variable ‘txt’ (which is an istance of a String), so if we try to modify ‘txt’ then also ‘len’ change its result according to the changes:


txt << " a tutti" 
len.call
=> 12

But we can do more, by calling ‘unbind’ on ‘len’ you can separate the method ‘len’ is pointing at (i.e.: length) from the istance at which you get it (i.e.: txt), getting the vanilla ‘length’ method that you can next ‘bind’ to a new variable.


len_unbinded = len.unbind

new_txt = "haloa!" 
new_len = len_unbinded.bind(new_txt)
new_len.call
=> 6

That’s really impressive! And can turn pretty useful if you need to move a singleton method from one instance to another. There are more interesting features related to the Method class that can be found on the Method class RDoc, so if you are interested in this topic, or just curious, please have a look.

Apr 15

Create getter and setter on a valorized variable

Posted by Sandro Paganotti in Ruby on Rails - 2 comments digg this add to delicious

I noticed that none of the attr_* (attr_reader, attr_accessor and attr_writer) has the capability to let you assign a value to the variable you’re creating.

This can be solved using the Class constructor method but it can lead you to define the initialize function just to make these assignements.

So I created an attr_with_value method that can be added to the Object class in order to make it avaiable to all the Classes and that can let you use the following sintax:


class Printer
  attr_with_value :pippo, 5
  attr_with_value :printer, Proc.new{|a| p "saying: #{a}" }
end

pr = Printer.new
pr.printer.call("hello!")
# "saying: hello!" 
p pr.pippo
# 5

pr.printer = Proc.new{|a| p "whispering #{a}"}
pr.printer.call("hello!")
# "whispering hello!" 

In the following snippet you can find the method:


class Object
  def self.attr_with_value(name,value)

    class_eval <<-EOS

      define_method(name.to_s) do      
        @#{name}_starter.nil? ? value : @#{name} 
      end

      define_method(name.to_s+"=") do |val|
        @#{name}_starter = true; @#{name} = val
      end

    EOS

  end  
end

I’m looking for a way to improve it (in particular I’m trying to find a clever way to handle the initial assignment), so every suggestion is welcome!

Mar 29

Matz's speech from Euruko 2008

Posted by Sandro Paganotti in News - Ruby on Rails - no comments digg this add to delicious

I’m writting this post from Prague’s Euruko 2008 Ruby conference. The conference is taking place inside the city university and it is organized by Czech and Slovak Ruby User Group.

This morning we have attended to Matz’s speech titled ‘The Past, The Presen and The Future of Ruby’. Matz did a great comparison between all the current Ruby interpreters, JRuby, YARV, Rubinius. In particoular YARV impressed me much because, as explained by its author, Sasada Koichi, is up to 20x faster than the original Ruby interpreter!

Next Matz talk about some of the new Ruby 1.9 features, as enumerator chain:


            ary.map.with_index{|x,i|
                ...
            }

and a cool way to interact with enumerators out of a block:


    e1= [1,2,3,4]
    e2=[10,11,4]

    loop {
        p e1.next+e2.next
    }  
    #=>11,13,7

The last part of the speech was about Ruby 2.0, Matz sad that the keyword for this new release is scalability. Last but not least Matz talk about a new pre and post method hooks that will be implemented in Ruby 2.0 giving us more control on our functions (and maybe lead us to a design by contract paradigm in Ruby).

Mar 23

Bruce Sterling talks about Web 2.0 in Italy

Posted by Massimo Sgrelli in Web 2.0 - no comments digg this add to delicious

I’ve just discovered this speech that Bruce Sterling made in Turin, Italy, just a few days ago. Bruce temporary transfered in Italy for 6-8 months to organize the Share Festival and met students to talk about Web 2.0 in a very easy way. The streaming is quite long, but it’s definitely interesting.

A small note: He talked about many things that could be the future of the Web like “3d web”, industry consolidation, the computing cloud … and… by the way in his opinion “semantic web” is not included, at the moment.

Mar 21

Ruby Pocket Session #3 - Callbacks

Posted by Massimo Sgrelli in Ruby on Rails - no comments digg this add to delicious

Active Records is the standard way that Rails provides to let your source code interact with databases. Active Records make available some standard callback functions to interact with their core tasks. Through callbacks you can intercept actions on databases, to perform some extra code before and after those actions. I found this topics interesting while refreshing my Ruby basics on the Ruby Pocket Reference and then I decided to go deeper through “Pro ActiveRecord – Databases with Ruby and Rails” (Amazon). I discovered this book some months ago reading Ruby Inside blog by Peter Cooper.

There are 2 ways to add a callback to your code:

  • overwriting the method
  • using macros

The best way to go through this, is using macros because of an inheritance hierarchy issue.

I’ll show a small example. Let’s suppose we have to define a Party and Customer model classes and we want to write a log when they have saved on the database:

Defining a callback using overwriting


class Party < ActiveRecord::Base
  def after_save
    writelog_party_saved
  end
end

class Customer < Party
  def after_save 
    writelog_customer_saved
  end
end

Defining a callback using macro


class Party < ActiveRecord::Base
  after_save :writelog_party_saved
end

class Customer < Party
  after_save :writelog_customer_saved
end

Using macros you preserve the inheritance chain of calls. So in the first case when you save a Customer record, no Party log is written. In the second case both callbacks are called, so the program writes a log for the Party record and one for the Customer record.

Mar 17

Observers: observing when changes have been made...

Posted by Annalisa Afeltra in Ruby on Rails - 3 comments digg this add to delicious

I wanted to find a solution that only sends an email to notify when a change has been made to the page. I came across the Observer. It works great when you need to compare if the value have been changed from before the save button to after.

This is how it works:

In the controller, add the following at the top of the page:


observer :mail_observer

and in the model, add the following to get the changed attributes:


attr_accessor :changed_attributes

Create a new model:

mail_observer.rb

Your mail_observer should look similar to this, I call two callback methods before_save and after_save:


class MailObserver < ActiveRecord::Observer
  #observe and the name of your model
  observe Task 

  def before_save(model)

   #Place the old values into a hash table only if it is not a new record being inserted
    old_attr = Hash.new
    if !model.new_record?
      old_model = model.class.find(model.id)
      old_attr = old_model.attributes
    end

    tmp_diff = Hash.new

    #delete the values in the hash table where the values have not changed, leaving you with the changed values
    model.attributes.delete_if do |key,value|
      old_attr[key] == value    
    end.keys.each do |k|
      tmp_diff[k] = old_attr[k]
    end

    model.changed_attributes = tmp_diff   
  end

In the after_save function I check which values have changed by !model.changed_attributes[‘resource_name’].nil?, for example if a task that has been assigned to a person, is changed to another person, an email is sent to alert the new person that a task has been assigned to them.


  #the after save function you can check which values have been changed and do something for it, depending on what has changed

  def after_save(model)      
      #task resource_name
      if !model.changed_attributes['resource_name'].nil?
         #send an email to the person that has been assigned this new task
         puts 'the owner of this task is has been changed.' 
      end
 end

This could be a good example to check when changes have been made to a page and to alert the changes that have been made.

Mar 05

RVG and SVuGy: create vector graphic with Ruby

Posted by Sandro Paganotti in Ruby on Rails - 4 comments digg this add to delicious

Today we’re going to discover two ways to create vectorial graphic with Ruby;

RVG

The first way is called RVG and it’s part of the well-known Rmagick library. With RVG you can create custom shapes and then render them to images. Here there is a simple example (taken from the RMagic docs and modified a bit):


require 'rvg/rvg'

target = Magick::RVG.new.viewbox(0,0,200,200) do |targ|
    targ.g.styles(:stroke_width=>20, :stroke=>'#ff5600', :fill=>'#abd600') do |grp|
        grp.circle(90, 100, 100)
        grp.circle(60, 100, 100)
        grp.circle(30, 100, 100)
    end
end

rvg = Magick::RVG.new(258, 100) do |canvas|
    canvas.use(target, 0, 0, 100, 100)
    canvas.use(target, 100, 16.6667, 66.7, 66.7)
    canvas.use(target, 166.6667, 25, 50, 50)
    canvas.use(target, 216.6667, 30, 40, 40)
end

rvg.draw.write('nested_rvg.gif')

And this is its output:

SvuGy

This library acts in a very similar way with the small but noticeable difference that its output is not an image but a pure .svg file. Here is the code to product the same sample as above ( I know, it is not so DRY but i didn’t find smarter ways to do this, in part due to a lack of documentation):



require 'SVuGy'

drawing1 = SVuGy::Document.new(530, 200) do

    tri = group.style(:stroke_width=>20, :stroke=>'#ff5600', :fill=>'#abd600'){
      el2 = ellipse(100, 100, 90, 90)
      el1 = ellipse(100, 100, 60, 60)
      el0 = ellipse(100, 100, 30, 30)
    }

    tri2 = group.style(:stroke_width=>20, :stroke=>'#ff5600', :fill=>'#abd600').translate(200,30).scale(0.66){
      el2 = ellipse(100, 100, 90, 90)
      el1 = ellipse(100, 100, 60, 60)
      el0 = ellipse(100, 100, 30, 30)
    }

    tri3 = group.style(:stroke_width=>20, :stroke=>'#ff5600', :fill=>'#abd600').translate(330,50).scale(0.5){
      el2 = ellipse(100, 100, 90, 90)
      el1 = ellipse(100, 100, 60, 60)
      el0 = ellipse(100, 100, 30, 30)
    }

    tri4 = group.style(:stroke_width=>20, :stroke=>'#ff5600', :fill=>'#abd600').translate(430,60).scale(0.4){
      el2 = ellipse(100, 100, 90, 90)
      el1 = ellipse(100, 100, 60, 60)
      el0 = ellipse(100, 100, 30, 30)
    }

end

print drawing1.to_svg

And here you can admire the generated SVG (download the file):

Considerations

Now that I found out this library I’m thinking about an hypothetic world where these two libraries works with the same syntax letting you generate SVG if the browser support this format and otherwise printing a simple image. Another big improvement could be create a SVG to RVG parser, by this way you can import complex SVGs generated with WYSIWYG programs and then add to them dynamic functionalities.

Mar 04

Ruby Pocket Session #2 - Duck typing

Posted by Massimo Sgrelli in Ruby on Rails - no comments digg this add to delicious

I have to admit it. I have never heard of duck typing, probably because I read “Ruby Programming” to quickly. “Duck typing” is the way Ruby treats variable types. I mean, Ruby is a dynamic language and so variables don’t have explicit type assignments or declarations. Ruby has dynamic typing, but why has it been called duck typing?

Well, Dave Thomas puts it in this way: if it walks like a duck and quacks like a duck, then I would call it a duck.

BTW you can read more about the original meaning of this concept on Wikipedia searching for duck test .

Duck Typing is a distinctive feature of dynamic languages like Lisp, Perl, Ruby, Python, Caml and Groovy and it’s part of the “funky stuff” that characterized those wonderful languages. Some people are worried about this feature, because they think that late-binding could be dangerous: you can pass an object to a method not actually “quacking like a duck” and you wouldn’t know since runtime, when this line of code would be executed.

I don’t think this is a real issue. The fact is that using Duck Typing saves you a lot of time with a very low risk of delivering buggy code because of this feature. The truth is that normally people release buggy code because of their poor testing, and it doesn’t depend on static or dynamic binding.

I love this concept. Thanks Ruby. Thanks Dave

(Ref. See Ruby Pocket Reference p. 11)

Categories:

Tags:

Powered by Mephisto, Valid XHTML 1.1, Valid CSS - Supported by Wave Factory