viernes, 29 de abril de 2016

Interface disign and import thefiles (ASAP)

From this last 2 weeks i worked totally in Asap Portal. On this time, at the begging Cardoce help me to redesign the interface because i needed add the option that the user can get the csv file from your computer. When i sew the code i almost i didn't understood the code. He explained that the interface worked with Bootstrap and that classes to design and give to the element of a HTML. Also we can make a custom design, changing the input of the classes into a css file.
I investigating the code, saw that the project only had 1 windows, the rest was panels. At few time i find where needed add my code, then i investigate how create a file chooser into Ruby on rails, this video was really useful to create that feature. When i returned to saw the code, the label generated by the file chooser i didn't needed. To fix that problem, i needed create a css file where i hidden these elements.
With the file uploaded into the controller, I decided create my first pull request of the project. But when Jesus revised it, He tell to me that i needed create test from the controller functions. To help me with this work, I used the code of ICS and take a look on the testing that Jesus had done.When I check the code, only check if the file uploaded was the same to the test. 
When i was doing the test, i contemplate other cases. For example: When the user don't upload a file, or maybe if the user loads a different with different extension. Then I pursue to validate this cases.
When my pull request was merge it, I continued to create a new folder to create the functionality of the project. On this part, I needed import 2 files, the report files (transactions) and the mapping template.
The logic was moderately easy, because i used hash tables, i only imported the files and got only the necessary information, and concatenated the information. The real problem is the testing, until right now this theme  I am really week.
To gave the format and create the file i used the information of this gem to create it.
The last Wednesday Sirias, give me a retrospective of Tristan. On this he tell me that i didn't show him my progress. Then i tried to show my advance on the same day and ask him for a follow up.

jueves, 14 de abril de 2016

Finish ICS, take a look on Gigger and begining Asap

In the last 2 weeks i continue with the parser in ICS, i begin to understand the testting on rails, in the rails project has a folder called Spec, in this i create a test for each part of the app. Thanks to Christan i could understand the test with a blog made for him (I tried to find the blog but i can't). To create a test on ruby we need create a var with sentence "let". After, I need create the context or the cases, and finally i write the function "it". At the final i have some same to that:

let(:parser) { TransactionDescriptionParser.new(keywords, sentence) }

    context 'when sentence has correct grammatic' do
      it { expect(parser.sentence_keywords).to eq(['Fresh Market']) }
    end

Also I can use a FactorygGirl, to create the instances of the object. But this is only necessary when we are testing the model.

My first Pull request has too much errors, but was by don't think in other cases, for example:
  1. If i have a specials strings on the sentence
  2. If the word is not complete
To solve the first case, i only need remove this special characters. The second i was talkig with Jesus to find a solution. i recommended use Backtraking to comparate how many as similar the string, and apply the learned on the university. I was investigate about that, but when i ask a opinion a patner school, she told me that could be dangerous because the work can change the meaning very easy. Then i don't implement.

Finally, Jesus explained me that the sintaxis on Ruby is the most import. In other words, i can read the code as a book.

The next week, i was in a new project called Gigger. On this Cardoce suggest me that do a Training about ruby on Rails. On this talk about how to develop a project on Ruby using Heroku (New for me). I don't finish the book right now, but i tried to finished this weekend and explain it in the next blog better.

On the same week, Carlos give to me of development a project "alone". The client is a American investor called Tristan. After that Carlos explain me the situation, i was nervous thinking: Holy Molly,  where do i star?. The project consist a cast of files, between CSV to IIF. On this day i tried look the tools that Tristan give me. The first i investigate some about the iif file, because was the first time in hear it. When i see the Gem to work the project i say: "OMG this gem don't has support since 2012". After i open the excel file i can't understand it, them i ask for help to Jesus. He says me that the file was not a CSV file or something like that. Immediately i send a e mail to Tristan to explain me the file.