I'm starting to work on the project/discuss and project/vote stuff and have a 
few questions.

I am having a hard time seeing the entire picture considering that some of the 
application runs on the server and some runs on the client. From the top, 
looking at the project/icla directory, config.ru is read by some component 
which tells it to run Sinatra::Application. Which then finds main.rb which 
somehow inherits the Sinatra code and routes the url to the proper code via the 
get function.

The get function is invoked when an https get comes in. It declares some 
variables like @view, @pmcs, @ppmcs, user, committees, and ipmc. What is the 
naming convention for these? Which of them are sent to the client? 

In the get function the last line is _html :app. What is the :app?

I envision using project/discuss and project/vote in addition to project/icla. 
To structure this as one application, would it be better to use project/icla as 
the root and use project/icla/discuss, project/icla/vote in addition to the 
existing project/icla/invite and project/icla/interview?

The code in the existing main.rb in get '/invite' sets several variables that 
will be useful in discuss and vote. DRY says this code should only be in one 
place. How can variables be shared among multiple get and post paths?

I'd like to be able to test this code more easily by being able to mock users. 
That is, I'd like to be able to run the code as another user. So I would invoke 
the application via: https://whimsy.apache.org/project/icla/discuss?mock=rubys. 
Then, the code would set the user to rubys in order to test what happens with 
rubys. But I don't want just anyone to be able to pretend to be rubys. So I 
guess the code should only allow mock= to be used if the real user is a member 
of the whimsy developer team.

I would like to store the intermediate results in a file, as previously 
discussed. Using a unique file name (generated by a random string uuid 
generator) I can open the file with suffix .json or .yaml. Any idea which would 
be better for this application? The object stored would contain the status of 
the process for the user, so a sample file might be:

status: 'voting',
proposedBy: 'clr',
candidateName: 'Greg Rousseau',
candidateEmail: 'greg.rouss...@gmail.com',
votes: [
{member: 'clr', vote: '+1', comment: 'seems like a good guy'},
{member: 'rubys', vote: '+1', comment: 'seems like a better guy'},
{member: 'max', vote: '+0', comment: 'don't no this guy'},
{member: 'sebb', vote: '+1', comment: ''}
],
discussion: [
{member: 'clr', comment: 'seems like a good guy'},
{member: 'rubys', comment: 'seems like a better guy'},
{member: 'sebb', comment: 'seems like a best guy'},
]

The above is json. Would it be trivial to make a ruby object out of this and 
transmit it to and from the client? Is a complex object like this suitable for 
sending to the client?

Thanks,

Craig "the noob"

Craig L Russell
Secretary, Apache Software Foundation
c...@apache.org http://db.apache.org/jdo

Reply via email to