Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ull-esit-gradoii-pl/oop
https://github.com/ull-esit-gradoii-pl/oop
continuous-integration ecmascript6 js oop testing
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ull-esit-gradoii-pl/oop
- Owner: ULL-ESIT-GRADOII-PL
- Created: 2018-01-10T09:24:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-15T09:43:27.000Z (about 6 years ago)
- Last Synced: 2024-11-14T09:31:22.681Z (about 1 month ago)
- Topics: continuous-integration, ecmascript6, js, oop, testing
- Language: JavaScript
- Size: 80.1 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Eloquent JavaScript. Chapter 6: The Secret Life of Objects. Section *Laying out a table*
[![Build Status](https://travis-ci.org/ULL-ESIT-GRADOII-PL/OOP.svg?branch=master)](https://travis-ci.org/ULL-ESIT-GRADOII-PL/OOP)
#### Introduction
Example corresponds to the section **Laying out a table** of Chapter 6 **[The Secret Life of Objects](http://eloquentjavascript.net/06_object.html)**, book **[Eloquent javaScript](http://eloquentjavascript.net/)**#### Files:
```
package.json - configuration and dependenciesgulpfile.js - test: run mocha tests
- debugger: run the debbugger
- run: run the programsrc - source folder
input.json - input file
main.js - main program
Cell.js - class cell
RCell.js - class rcell
UnderlinedCell.js - class underlinedcell
Table.js - class tabletest - mocha test
test.js
```#### Description
This example consist in a program that, given an array of arrays of table cells in json format, builds up a string that contains a nicely laid out table.The *src* folder has the input file and the different classes, the main, all types of cell and the table. Also, in the *test* folder has the file the file with the developed tests.
**Example of input used:**
```javascript
~/ejs-chapter-6-oop-KevMCh $ cat src/input.json[
{"name": "Kilimanjaro\nMontaña mágica", "height": 5895, "country": "Tanzania"},
{"name": "Everest", "height": 8848, "country": "Nepal\nPaís lejano"},
{"name": "Mount Fuji", "height": 3776, "country": "Japan"},
{"name": "Mont Blanc", "height": 4808, "country": "Italy/France"},
{"name": "Vaalserberg", "height": 323, "country": "Netherlands"},
{"name": "Denali", "height": 6168, "country": "United States"},
{"name": "Popocatepetl", "height": 5465, "country": "Mexico"}
]
```If you want to run the code the different tasks is available in the gulp file.
* Run the program with the debugger.
* Run the program with the standard input.
* Run the tests.**Final result:**
```javascript
~/ejs-chapter-6-oop-KevMCh $ gulp run
[12:42:05] Using gulpfile ~/Desktop/ejs-chapter-6-oop-KevMCh/gulpfile.js
[12:42:05] Starting 'run'...
name height country
-------------- ------ -------------
Kilimanjaro 5895 Tanzania
Montaña mágica
Everest 8848 Nepal
País lejano
Mount Fuji 3776 Japan
Mont Blanc 4808 Italy/France
Vaalserberg 323 Netherlands
Denali 6168 United States
Popocatepetl 5465 Mexico
[12:42:05] Finished 'run' after 84 ms
```