lib/resme/templates/resume.json.erb in resme-0.2.0 vs lib/resme/templates/resume.json.erb in resme-0.3.0

- old
+ new

@@ -1,16 +1,16 @@ { "basics": { - "name": "<%= data.basics.first_name %> <%= data.basics.middle_name %><%= data.basics.last_name %>", - "label": "<%= data.basics.title %>", + "name": "<%= full_name(data).to_json %>", + "label": "<%= data.basics.title.to_json %>", "picture": "<%= data.basics.picture %>", "email": "<%= e = data.contacts.select { |x| x.label == "email" }.first; e.value if e %>", "phone": "<%= p = data.contacts.select { |x| x.label == "mobile" }.first; p.value if p %>", "website": "<%= w = data.web_presence.select { |x| x.label == "website" }.first; w.value if w %>", - "summary": "<%= data.summary.gsub("\n", "\\n") %>", + "summary": "<%= data.summary.to_json %>", "location": { - "address": "<%= data.addresses[0].street %>", + "address": "<%= data.addresses[0].street.to_json %>", "postalCode": "<%= data.addresses[0].zip_code %>", "city": "<%= data.addresses[0].city %>", "countryCode": "<%= data.addresses[0].country %>", "region": "<%= data.addresses[0].region %>" }, @@ -26,41 +26,41 @@ ] }, "work": [ <% sequence = data.work || []; sequence.each_with_index do |job, index| %> { - "company": "<%= job.who %>", - "position": "<%= job.role %>", + "company": "<%= job.who.to_json %>", + "position": "<%= job.role.to_json %>", "website": "<%= job.website %>", "startDate": "<%= job.from %>", "endDate": "<%= job.till %>", - "summary": "<%= job.summary.gsub("\n", "\\n") %>" + "summary": "<%= job.summary.to_json %>" <%# "highlights": [ "Started the company" ] %> } <%= "," unless index == sequence.size - 1 %> <% end %> ], "volunteer": [ <% sequence = data.volunteer || []; sequence.each_with_index do |job, index| %> { - "organization": "<%= job.who %>", - "position": "<%= job.role %>", + "organization": "<%= job.who.to_json %>", + "position": "<%= job.role.to_json %>", "website": "<%= job.website %>", "startDate": "<%= job.from %>", "endDate": "<%= job.till %>", - "summary": "<%= job.summary.gsub("\n", "\\n") %>" + "summary": "<%= job.summary.to_json %>" <%# "highlights": [ "Started the company" ] %> } <%= "," unless index == sequence.size - 1 %> <% end %> ], "education": [ <% sequence = data.education.select { |x| x.publish }; sequence.each_with_index do |edu, index| %> { - "institution": "<%= edu.school %>", - "area": "<%= edu.topic %>", - "studyType": "<%= edu.degree %>", + "institution": "<%= edu.school.to_json %>", + "area": "<%= edu.topic.to_json %>", + "studyType": "<%= edu.degree.to_json %>", "startDate": "<%= edu.from %>", "endDate": "<%= edu.till %>", "gpa": "<%= edu.score %>" <%# "courses": [ "DB1101 - Basic SQL" ] %> } @@ -68,69 +68,69 @@ <% end %> ], "awards": [ <% sequence = data.awards || []; sequence.each_with_index do |award, index| %> { - "title": "<%= award.title %>", + "title": "<%= award.title.to_json %>", "date": "<%= award.date %>", - "awarder": "<%= award.who %>" - "summary": "<%= award.summary.gsub("\n", "\\n") %>" + "awarder": "<%= award.who.to_json %>" + "summary": "<%= award.summary.to_json %>" } <%= "," unless index == sequence.size - 1 %> <% end %> ], "publications": [ <% squence = data.publications || []; sequence.each_with_index do |pub, index| %> { - "name": "<%= pub.title %>", - "publisher": "<%= pub.publisher %>", + "name": "<%= pub.title.to_json %>", + "publisher": "<%= pub.publisher.to_json %>", "releaseDate": "<%= pub.date %>", "website": "<%= pub.url %>", - "summary": "<%= pub.summary.gsub("\n", "\\n") %>" + "summary": "<%= pub.summary.to_json %>" } <%= "," unless index == sequence.size - 1 %> <% end %> ], "skills": [ <% sequence = data.skills || []; sequence.each_with_index do |skill, index| %> { - "name": "<%= skill.name %>", - "level": "<%= skill.level %>" + "name": "<%= skill.name.to_json %>", + "level": "<%= skill.level.to_json %>" <%# "keywords": [...] %> } <%= "," unless index == sequence.size - 1 %> <% end %> ], "languages": [ <% data.languages.mother_tongues.each do |mt| %> { - "name": "<%= mt.language%>", + "name": "<%= mt.language.to_json %>", "level": "Native speaker" } <%= "," unless data.languages.foreign == nil %> <% end %> <% sequence = data.languages.foreign || []; sequence.each_with_index do |lang, index| %> { - "name": "<%= lang.language%>", - "level": "<%= lang.level %>" + "name": "<%= lang.language.to_json %>", + "level": "<%= lang.level.to_json %>" } <%= "," unless index == sequence.size - 1 %> <% end %> ], "interests": [ <% sequence = data.interests || []; sequence.each_with_index do |interest, index| %> { - "name": "<%= interest.name %>", + "name": "<%= interest.name.to_json %>", <%# "keywords": [...] %> }, <%= "," unless index == sequence.size - 1 %> <% end %> ], "references": [ <% sequence = data.references || []; sequence.each_with_index do |reference, index| %> { - "name": "<%= reference.name %>", - "reference": "<%= reference.reference %>" + "name": "<%= reference.name.to_json %>", + "reference": "<%= reference.reference.to_json %>" } <%= "," unless index == sequence.size - 1 %> <% end %> ] }