From a4e98163fb80d476ee8e841420f7eefff0e31eed Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 11:13:49 +0100 Subject: [PATCH 01/14] set ICU_DATA env variable at app bootstrap --- app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.js b/app.js index 9270cac0..f74b1e0b 100755 --- a/app.js +++ b/app.js @@ -16,6 +16,16 @@ if (!semver.satisfies(nodejsVersion, '>=6.9.0')) { process.exit(1); } +// See https://github.com/CartoDB/support/issues/984 +// CartoCSS properties text-wrap-width/text-wrap-character not working +// This function should be called as soon as possible. +function setICUEnvVariable() { + if (process.env['ICU_DATA'] === undefined) { + process.env['ICU_DATA'] = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/share/mapnik/icu'; + } +} +setICUEnvVariable(); + var argv = require('yargs') .usage('Usage: $0 [options]') .help('h') From c016175a23163148f8603306d892fa90a9f91698 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 11:24:08 +0100 Subject: [PATCH 02/14] please jshint --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index f74b1e0b..34c0bf45 100755 --- a/app.js +++ b/app.js @@ -20,8 +20,8 @@ if (!semver.satisfies(nodejsVersion, '>=6.9.0')) { // CartoCSS properties text-wrap-width/text-wrap-character not working // This function should be called as soon as possible. function setICUEnvVariable() { - if (process.env['ICU_DATA'] === undefined) { - process.env['ICU_DATA'] = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/share/mapnik/icu'; + if (process.env.ICU_DATA === undefined) { + process.env.ICU_DATA = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/share/mapnik/icu'; } } setICUEnvVariable(); From d292a922f6eccc2f8ce8f81b6958696400f63b64 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 14:51:48 +0100 Subject: [PATCH 03/14] set ICU_DATA 3 alternatives --- app.js | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 34c0bf45..bfef2b44 100755 --- a/app.js +++ b/app.js @@ -18,10 +18,43 @@ if (!semver.satisfies(nodejsVersion, '>=6.9.0')) { // See https://github.com/CartoDB/support/issues/984 // CartoCSS properties text-wrap-width/text-wrap-character not working -// This function should be called as soon as possible. +// This function should be called before the require('yargs'). function setICUEnvVariable() { if (process.env.ICU_DATA === undefined) { - process.env.ICU_DATA = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/share/mapnik/icu'; + // There are 3 ways to set the env variable. Option 1 doesn't work. Option 2 is the best alternative. + + // 1 + // The best approach to generate the path where the ICU DATA is stored is by calling binary.find() + // Sadly, it fails. It generates the correct path, but mapnik raises "could not create BreakIterator: U_MISSING_RESOURCE_ERROR" + const binary = require('node-pre-gyp'); + let binding_path = binary.find(path.resolve(path.join(__dirname, 'node_modules/mapnik/package.json'))); + binding_path = path.dirname(binding_path); + // If we hardcode de path, it works. the call to binary.find seems to be the problem here. + // var binding_path = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/'; + process.env.ICU_DATA1 = path.join(binding_path, 'share/mapnik/icu/'); + console.log('process.env.ICU_DATA1: ', process.env.ICU_DATA1); + + // 2 + // Alternative to 1 using glob module. + const glob = require('glob'); + let directory = glob.sync(__dirname + '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/'); + + if (directory && directory.length > 0) { + process.env.ICU_DATA2 = directory[0]; + } + console.log('process.env.ICU_DATA2: ', process.env.ICU_DATA2); + + // 3 + // hardcoded. not multiplatform (just works in some linuxes) + process.env.ICU_DATA3 = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/share/mapnik/icu/'; + console.log('process.env.ICU_DATA3: ', process.env.ICU_DATA3); + + + console.log(process.env.ICU_DATA1 === process.env.ICU_DATA2); + console.log(process.env.ICU_DATA2 === process.env.ICU_DATA3); + + process.env.ICU_DATA = process.env.ICU_DATA3; + console.log(process.env.ICU_DATA) } } setICUEnvVariable(); From 9c556964e5b3309b5971d5c295978f245de98758 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 15:15:43 +0100 Subject: [PATCH 04/14] use glob module to get the icu_data directory --- app.js | 30 +----------------------------- package.json | 1 + 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/app.js b/app.js index bfef2b44..60a502a3 100755 --- a/app.js +++ b/app.js @@ -21,40 +21,12 @@ if (!semver.satisfies(nodejsVersion, '>=6.9.0')) { // This function should be called before the require('yargs'). function setICUEnvVariable() { if (process.env.ICU_DATA === undefined) { - // There are 3 ways to set the env variable. Option 1 doesn't work. Option 2 is the best alternative. - - // 1 - // The best approach to generate the path where the ICU DATA is stored is by calling binary.find() - // Sadly, it fails. It generates the correct path, but mapnik raises "could not create BreakIterator: U_MISSING_RESOURCE_ERROR" - const binary = require('node-pre-gyp'); - let binding_path = binary.find(path.resolve(path.join(__dirname, 'node_modules/mapnik/package.json'))); - binding_path = path.dirname(binding_path); - // If we hardcode de path, it works. the call to binary.find seems to be the problem here. - // var binding_path = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/'; - process.env.ICU_DATA1 = path.join(binding_path, 'share/mapnik/icu/'); - console.log('process.env.ICU_DATA1: ', process.env.ICU_DATA1); - - // 2 - // Alternative to 1 using glob module. const glob = require('glob'); let directory = glob.sync(__dirname + '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/'); if (directory && directory.length > 0) { - process.env.ICU_DATA2 = directory[0]; + process.env.ICU_DATA = directory[0]; } - console.log('process.env.ICU_DATA2: ', process.env.ICU_DATA2); - - // 3 - // hardcoded. not multiplatform (just works in some linuxes) - process.env.ICU_DATA3 = __dirname + '/node_modules/mapnik/lib/binding/node-v48-linux-x64/share/mapnik/icu/'; - console.log('process.env.ICU_DATA3: ', process.env.ICU_DATA3); - - - console.log(process.env.ICU_DATA1 === process.env.ICU_DATA2); - console.log(process.env.ICU_DATA2 === process.env.ICU_DATA3); - - process.env.ICU_DATA = process.env.ICU_DATA3; - console.log(process.env.ICU_DATA) } } setICUEnvVariable(); diff --git a/package.json b/package.json index 8443a49b..d523c029 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "dot": "~1.0.2", "express": "~4.16.0", "fastly-purge": "~1.0.1", + "glob": "^7.1.2", "log4js": "cartodb/log4js-node#cdb", "lru-cache": "2.6.5", "lzma": "~2.3.2", From 5e53920aae009b572269c414079f8e4a4ba1578e Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 16:27:51 +0100 Subject: [PATCH 05/14] move glob require to the beginning of the file --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 60a502a3..19dada53 100755 --- a/app.js +++ b/app.js @@ -4,6 +4,7 @@ var path = require('path'); var fs = require('fs'); var _ = require('underscore'); var semver = require('semver'); +const glob = require('glob'); // jshint undef:false var log = console.log.bind(console); @@ -21,7 +22,6 @@ if (!semver.satisfies(nodejsVersion, '>=6.9.0')) { // This function should be called before the require('yargs'). function setICUEnvVariable() { if (process.env.ICU_DATA === undefined) { - const glob = require('glob'); let directory = glob.sync(__dirname + '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/'); if (directory && directory.length > 0) { From 60d2cc0a4fc7c6c7d22f6b99dfcdef1742f7c261 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 21:06:47 +0100 Subject: [PATCH 06/14] set ICU_DATA env variable also in tests --- test/support/test_helper.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/support/test_helper.js b/test/support/test_helper.js index 96a109ff..57011698 100644 --- a/test/support/test_helper.js +++ b/test/support/test_helper.js @@ -21,6 +21,17 @@ global.environment = require(__dirname + '/../../config/environments/test'); global.environment.name = 'test'; process.env.NODE_ENV = 'test'; +// See https://github.com/CartoDB/support/issues/984 +// CartoCSS properties text-wrap-width/text-wrap-character not working +function setICUEnvVariable() { + const glob = require('glob'); + const path = require('path'); + let directory = glob.sync(path.join(__dirname, '../..', '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/')); + if (directory && directory.length > 0) { + process.env.ICU_DATA = directory[0]; + } +} +setICUEnvVariable(); // don't output logs in test environment to reduce noise log4js.configure({ appenders: [] }); From bcd14e4f77fb0e5ff056c452011a76655a0e1926 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 22:20:19 +0100 Subject: [PATCH 07/14] add test to check that labels are wrapped --- test/acceptance/label-wrap.js | 69 ++++++++++++++++++++++++++++++++ test/fixtures/text_wrap.png | Bin 0 -> 1234 bytes test/fixtures/text_wrap_bad.png | Bin 0 -> 1142 bytes 3 files changed, 69 insertions(+) create mode 100644 test/acceptance/label-wrap.js create mode 100644 test/fixtures/text_wrap.png create mode 100644 test/fixtures/text_wrap_bad.png diff --git a/test/acceptance/label-wrap.js b/test/acceptance/label-wrap.js new file mode 100644 index 00000000..e520953e --- /dev/null +++ b/test/acceptance/label-wrap.js @@ -0,0 +1,69 @@ +require('../support/test_helper'); +var TestClient = require('../support/test-client'); + +var assert = require('../support/assert'); +var IMAGE_TOLERANCE = 20; + +describe('CartoCSS wrap', function () { + const options = { + sql: ` + SELECT + 5 as cartodb_id, + ST_Transform(ST_SetSRID(ST_MakePoint(-57.65625,-15.6230368),4326),3857) as the_geom_webmercator, + ST_SetSRID(ST_MakePoint(-57.65625,-15.62303683),4326) as the_geom, + 'South America' as continent + `, + cartocss: ` + #continent_points::labels { + text-name: [continent]; + text-face-name: 'Open Sans Italic'; + text-size: 10; + text-fill: lighten(#000,40); + text-transform: uppercase; + text-wrap-width: 30; + text-character-spacing: 2; + text-placement: point; + text-placement-type: dummy; + [zoom >= 3]{ + text-character-spacing: 2; + text-size: 11; + } + } + `, + cartocss_version: '3.0.12' + }; + + const type = 'mapnik'; + + const mapConfig = { + version: '1.6.0', + layers: [ + { + type, + id: 'layerLabel', + options + } + ] + }; + + + var keysToDelete; + + beforeEach(function () { + keysToDelete = {}; + }); + + afterEach(function (done) { + if (this.testClient) { + this.testClient.drain(done); + } + }); + + it.only("Label should be text-wrapped", function (done) { + this.testClient = new TestClient(mapConfig); + this.testClient.getTile(1, 0, 1, { layers: [0] }, (err, res, body) => { + var textWrapPath = './test/fixtures/text_wrap.png'; + assert.imageIsSimilarToFile(body, textWrapPath, IMAGE_TOLERANCE, done); + }); + }); +}); diff --git a/test/fixtures/text_wrap.png b/test/fixtures/text_wrap.png new file mode 100644 index 0000000000000000000000000000000000000000..96774343346d122dc60fe76675f4ca37f3f62599 GIT binary patch literal 1234 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|GzJEinVv3=Ar*7p-qFrUb{Ao| zu+;nZq7@5*61%ya%nG`drnZQ%tbO!HMkq6InrK@aYdb3&+bqepHofSOs4L}5t*<>v zo3re0&eE{w9{!(dY|gWN{eBSZk~OFHXEXbj|Gz#l{`KF<@0tGi z-eg>#TsCiA{;y3lekPmgSAMRmtS>7Qdmlf|>h!IP#a}n9_}(viaLWIce_VD{&dg`G zIeq128M|?z&j0P%aetQOznt+>dA+y2lz@?an3Q<)?_&){{f#Q@lke6wF#b~wKEAu( z@5ZIgH{Wcp3pNPj2wWcj?)bC#E7>pae6W_^BD=ctuH(Pv+C~YLU%XBaxI20G-`P+t zJ$IYl-sR{1#FqS6>Adf>I_t(Q|5F2=>si;Gxp#WkM2SUjE36Do#D8n{yDPx5Z$iwv z_fL~|%nh8IH(`c*y8P9dX&>Z^H1}U$&v$BX+uQ5E*Zr0O$IOBHNZU@1JsT>P*;{4H z_rFiud{h4K$^9HBX0E%R-I8E)`TU84uC~?_ma|9S4BdPF#l5$G9OOLXt~e~Puoswr z_9w#+o{J}=pRY-+l*owm`?vMnp2%10c(1*D%#c*@!vE*fg$vo4-Q)~*t=!1G^z3Sx z60_@98UHz1_swQBUwmLb|67TCH>S92ldCEXUToVYo0Sm2Blq{=LL1#559ZYKsQI6L zBdH_8eBk%RdO?Qs6Q2JN|M_dxf9Ae3yH85~vbucz=W#iHrs_??_qR`V>3n?u%%<)+ z8(;gkfBrY8ew)3F&#v!x-1f$3+WhKgd?2|g_+IMqzY*uZZ10={xY7(BT;2?JAJR~I-RhmKes$`jQAKlyZ?ZcDUbPL zhVa=9hQZrof7F%9w|;ete!I%JCf+_=V0E?2@7GGKp9>$S{jA(@G2d?8ZyR|28itGy b|39g>f3sgupt=)ORxxB_1) zqPO|c?@4|;LccH1TYi3J@X_7nK-1B|9}ahS_j(x_85^JZN5AZR|9kni$ZyA=zx(my z$MakEv(MJey_LT^TP*g!()#){``7P!9>4AJ%YXB;{%0@yoR?J7{B8ZmHS2QA>+Aoo z-@JKqeAMluN00hjF8fyZ{I2O~nfFS^B7ZL{tebOdJ^Oh({rk^j@7v#fe)@{t|9Rh= z|HrT#efjdGmd39K=N|0WJwCm*z%AkGw!?=H-@m3ZX|L3arGK^F1@|=N~K8)>oF_yOk1rUs)(6ggLf8#999K$CD>d{`PIWJ5QbQ!~Ti(UyeI={$9yH z!<6&ELbVBYic`L&t~S~AZFx}B@#mSBXB6Koxcn~q_o*EF?$1d%6IF^LKdfQu{C?W# zzpJX?`-xMJJk8)V@Zfm(TJ|>gr@3Lmug#9=oi1c~+ugf0 zZ%%b-r(p7$sjlaa?B3XOLh_&9?c`IQ2w6iK#On3LU=%=$J z?)%9WhltIbv(NQIuhs;fN2$|(OfQUk-R-qPum0EG347AE-_sX9m0UM{v($s;CsudV z8_lQA&e*-!v|5-^)^TUvS*e4f*NPqM^WJZr`#7%lRq^9GQ^h03uYV{zUMcL~*PWOAIWnl{{Yt&<=;?nL@*l*1 YHm^vt{g)8fup8t(Pgg&ebxsLQ0O!WlnE(I) literal 0 HcmV?d00001 From 4d11403be273244122c6c422927449313dde0d31 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 11 Jan 2018 10:49:46 +0100 Subject: [PATCH 08/14] console.log error in test. For testing purposes only. --- test/acceptance/label-wrap.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/acceptance/label-wrap.js b/test/acceptance/label-wrap.js index e520953e..3e3d137c 100644 --- a/test/acceptance/label-wrap.js +++ b/test/acceptance/label-wrap.js @@ -62,6 +62,7 @@ describe('CartoCSS wrap', function () { it.only("Label should be text-wrapped", function (done) { this.testClient = new TestClient(mapConfig); this.testClient.getTile(1, 0, 1, { layers: [0] }, (err, res, body) => { + if (err) console.log(err) var textWrapPath = './test/fixtures/text_wrap.png'; assert.imageIsSimilarToFile(body, textWrapPath, IMAGE_TOLERANCE, done); }); From ae48a01e2684c12f05972f243187666780116a3f Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 11 Jan 2018 11:57:11 +0100 Subject: [PATCH 09/14] extract setICUEnvVariable() to it's own module --- app.js | 13 +------------ lib/cartodb/utils/icu_data_env_setter.js | 18 ++++++++++++++++++ test/support/test_helper.js | 11 +---------- 3 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 lib/cartodb/utils/icu_data_env_setter.js diff --git a/app.js b/app.js index 19dada53..1dd465f0 100755 --- a/app.js +++ b/app.js @@ -4,7 +4,7 @@ var path = require('path'); var fs = require('fs'); var _ = require('underscore'); var semver = require('semver'); -const glob = require('glob'); +const setICUEnvVariable = require('./lib/cartodb/utils/icu_data_env_setter'); // jshint undef:false var log = console.log.bind(console); @@ -17,18 +17,7 @@ if (!semver.satisfies(nodejsVersion, '>=6.9.0')) { process.exit(1); } -// See https://github.com/CartoDB/support/issues/984 -// CartoCSS properties text-wrap-width/text-wrap-character not working // This function should be called before the require('yargs'). -function setICUEnvVariable() { - if (process.env.ICU_DATA === undefined) { - let directory = glob.sync(__dirname + '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/'); - - if (directory && directory.length > 0) { - process.env.ICU_DATA = directory[0]; - } - } -} setICUEnvVariable(); var argv = require('yargs') diff --git a/lib/cartodb/utils/icu_data_env_setter.js b/lib/cartodb/utils/icu_data_env_setter.js new file mode 100644 index 00000000..1b4a0f3f --- /dev/null +++ b/lib/cartodb/utils/icu_data_env_setter.js @@ -0,0 +1,18 @@ +'use strict'; + +const glob = require('glob'); +const path = require('path'); + +// See https://github.com/CartoDB/support/issues/984 +// CartoCSS properties text-wrap-width/text-wrap-character not working +function setICUEnvVariable() { + if (process.env.ICU_DATA === undefined) { + let directory = glob.sync(path.join(__dirname, '../../..', '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/')); + + if (directory && directory.length > 0) { + process.env.ICU_DATA = directory[0]; + } + } +} + +module.exports = setICUEnvVariable; diff --git a/test/support/test_helper.js b/test/support/test_helper.js index 57011698..7d5c6a7c 100644 --- a/test/support/test_helper.js +++ b/test/support/test_helper.js @@ -15,22 +15,13 @@ var redis = require('redis'); var nock = require('nock'); var log4js = require('log4js'); var pg = require('pg'); +const setICUEnvVariable = require('../../lib/cartodb/utils/icu_data_env_setter'); // set environment specific variables global.environment = require(__dirname + '/../../config/environments/test'); global.environment.name = 'test'; process.env.NODE_ENV = 'test'; -// See https://github.com/CartoDB/support/issues/984 -// CartoCSS properties text-wrap-width/text-wrap-character not working -function setICUEnvVariable() { - const glob = require('glob'); - const path = require('path'); - let directory = glob.sync(path.join(__dirname, '../..', '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/')); - if (directory && directory.length > 0) { - process.env.ICU_DATA = directory[0]; - } -} setICUEnvVariable(); // don't output logs in test environment to reduce noise From 9934d697368a58c1fd62abcf530f0cb1cbd91ff3 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 11 Jan 2018 11:57:36 +0100 Subject: [PATCH 10/14] adjust test image tolerance --- test/acceptance/label-wrap.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/acceptance/label-wrap.js b/test/acceptance/label-wrap.js index 3e3d137c..ff1c6aaf 100644 --- a/test/acceptance/label-wrap.js +++ b/test/acceptance/label-wrap.js @@ -2,7 +2,7 @@ require('../support/test_helper'); var TestClient = require('../support/test-client'); var assert = require('../support/assert'); -var IMAGE_TOLERANCE = 20; +var IMAGE_TOLERANCE = 5; describe('CartoCSS wrap', function () { const options = { @@ -62,7 +62,6 @@ describe('CartoCSS wrap', function () { it.only("Label should be text-wrapped", function (done) { this.testClient = new TestClient(mapConfig); this.testClient.getTile(1, 0, 1, { layers: [0] }, (err, res, body) => { - if (err) console.log(err) var textWrapPath = './test/fixtures/text_wrap.png'; assert.imageIsSimilarToFile(body, textWrapPath, IMAGE_TOLERANCE, done); }); From 86d58fea7bffff400d2cd85bd37a622a72800bd4 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 11 Jan 2018 12:09:04 +0100 Subject: [PATCH 11/14] use DejaVu Sans Book instead of Open Sans Italic in test --- test/acceptance/label-wrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acceptance/label-wrap.js b/test/acceptance/label-wrap.js index ff1c6aaf..5b51b0d5 100644 --- a/test/acceptance/label-wrap.js +++ b/test/acceptance/label-wrap.js @@ -16,7 +16,7 @@ describe('CartoCSS wrap', function () { cartocss: ` #continent_points::labels { text-name: [continent]; - text-face-name: 'Open Sans Italic'; + text-face-name: 'DejaVu Sans Book'; text-size: 10; text-fill: lighten(#000,40); text-transform: uppercase; From 86e20b4b260d8977c12ea0d9a53bfebb0c3b803b Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 11 Jan 2018 12:15:23 +0100 Subject: [PATCH 12/14] recreate test images with new font --- test/fixtures/text_wrap.png | Bin 1234 -> 1210 bytes test/fixtures/text_wrap_bad.png | Bin 1142 -> 1149 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/test/fixtures/text_wrap.png b/test/fixtures/text_wrap.png index 96774343346d122dc60fe76675f4ca37f3f62599..6841686e52a047cef8a0eb4c2fb65a3a8b24f97a 100644 GIT binary patch delta 976 zcmV;>126p23Azc8B!7WPL_t(|obBANPaR1d0C42hHdS|jL1lyFM9rxNfxet%fe-|h zpiU#J@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Kx6p5-qglfoHi!tdSy0000dCZl%L1UKXN1r{-46bZkL zAq0g)BC#lBYh){IJM4O%U>;!a>73deifVeqF0Ii~i0=iN2S9Pc8=S^K7Oew^B` z2hTn)-{)Q5Ki%ic)IR^7_k;gj1jT>p>FFvc`ryvszb(g?eQ-u#)waXK!{62k_BM@sI%g*X?Pkz-8-X1G9>*Ezi#{o2vbpWA&wFgQ_sGBdgfi=sPbQ?b z$t%9!mJBz&AH0d_$M{rd#U_5NksMkOg$(Y8?)vLGJN5~owBPizXtpn+N+^HF^XWMs zzGK|?ISY@H%_=cW{lDk&c_y!Uci!4$Q{N*JWK;uPe^f&s+wsZC$@@)#-JT}_@V}8i z^v6Mo`>79@H3{IMCXhZMl=fw-G`jYuQi8|lY15c<*>KbDTl>mvKa2BXY>^~#S@5g^ ziTBGg|3xJc?~#?n`n{06X1Cri6Ut+Lm$Mq+gXB8gCxJJWn`pbEHG2~Q z9YMKn%^JZK*T*@dHGYVI9BnklEZuD~e&~}>75C^j2y+?nPeSM_l-1wyjM|>>wVmT$ zed=@Lel;P)Gwb*xLDX@NzKd>S^I1}i@2M`g0000000000005Jl1Iv@30}dGAU-LJ3 WW Date: Thu, 11 Jan 2018 12:22:51 +0100 Subject: [PATCH 13/14] please jshint --- lib/cartodb/utils/icu_data_env_setter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/utils/icu_data_env_setter.js b/lib/cartodb/utils/icu_data_env_setter.js index 1b4a0f3f..a4678821 100644 --- a/lib/cartodb/utils/icu_data_env_setter.js +++ b/lib/cartodb/utils/icu_data_env_setter.js @@ -7,7 +7,8 @@ const path = require('path'); // CartoCSS properties text-wrap-width/text-wrap-character not working function setICUEnvVariable() { if (process.env.ICU_DATA === undefined) { - let directory = glob.sync(path.join(__dirname, '../../..', '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/')); + const regexedPath = '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/'; + const directory = glob.sync(path.join(__dirname, '../../..', regexedPath)); if (directory && directory.length > 0) { process.env.ICU_DATA = directory[0]; From 8e68e5395dc44d1f6504c262315b41a80d35c2b6 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Thu, 11 Jan 2018 12:23:16 +0100 Subject: [PATCH 14/14] remove .only from test --- test/acceptance/label-wrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acceptance/label-wrap.js b/test/acceptance/label-wrap.js index 5b51b0d5..d4482b01 100644 --- a/test/acceptance/label-wrap.js +++ b/test/acceptance/label-wrap.js @@ -59,7 +59,7 @@ describe('CartoCSS wrap', function () { } }); - it.only("Label should be text-wrapped", function (done) { + it("Label should be text-wrapped", function (done) { this.testClient = new TestClient(mapConfig); this.testClient.getTile(1, 0, 1, { layers: [0] }, (err, res, body) => { var textWrapPath = './test/fixtures/text_wrap.png';