From cd6062548906fba1fd8f5b5db6f003fc3eb2b2c1 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Sun, 24 Jan 2021 16:18:54 +0800 Subject: [PATCH] new --- .../carto/api/analyses_controller.rb | 1 + .../carto/builder/builder_users_module.rb | 2 + .../carto/oauth_login_controller.rb | 2 + app/controllers/sessions_controller.rb | 1 + config/application.rb | 2 + config/environments/development.rb | 2 + config/environments/development.rb.front | 2 + config/environments/production.rb | 2 + config/environments/staging.rb | 2 + config/environments/test.rb | 2 + config/initializers/float.rb | 4 +- config/initializers/repository.rb | 1 + config/initializers/string.rb | 2 + config/routes.rb | 2 + .../infowindow/infowindow-click-view.js | 1 - .../javascripts/cartodb/old_common/header.js | 1 + .../views/background_importer.jst.ejs | 6 +- .../cartodb/table/menu_modules/infowindow.js | 2 + lib/url_signer.rb | 2 + lib/user_account_creator.rb | 2 + script/create_dev_user | 55 +++++++------------ script/fill_geocoder.sh | 13 ----- script/geocoder.sh | 40 -------------- script/geocoder_server.sql | 36 ------------ script/setup_organization.sh | 19 ------- script/sync_tables_trigger.sh | 8 --- spec/acceptance_helper.rb | 2 + spec/connectors/importer_spec.rb | 1 + spec/doubles/request.rb | 2 + spec/doubles/result.rb | 2 + spec/doubles/support_tables.rb | 2 + spec/factories/groups.rb | 1 + spec/factories/organizations_contexts.rb | 1 + .../visualization_creation_helpers.rb | 2 + spec/lib/carto/bolt_spec.rb | 2 + spec/lib/carto/db/sanitize_spec.rb | 2 + spec/lib/carto/db/sql_interface_spec.rb | 2 + spec/lib/carto/db/user_schema_spec.rb | 2 + spec/lib/carto/definition_spec.rb | 2 + spec/lib/carto/email_domain_validator_spec.rb | 2 + spec/lib/carto/file_system/sanitize_spec.rb | 2 + spec/lib/carto/form_spec.rb | 2 + spec/lib/carto/forms_definition_spec.rb | 2 + spec/lib/carto/http/client_spec.rb | 2 + spec/lib/carto/named_maps/template_spec.rb | 2 + spec/lib/carto/password_validator_spec.rb | 2 + spec/lib/carto/styles/cartography_spec.rb | 2 + spec/lib/carto/styles/polygon_spec.rb | 2 + .../carto/valid_table_name_proposer_spec.rb | 2 + spec/lib/cartodb/stats/importer_spec.rb | 1 + spec/lib/errors_spec.rb | 2 + spec/models/carto/account_type_spec.rb | 2 + spec/rspec_configuration.rb | 1 + spec/spec_helper_min.rb | 1 + 54 files changed, 105 insertions(+), 157 deletions(-) delete mode 100755 script/fill_geocoder.sh delete mode 100644 script/geocoder.sh delete mode 100644 script/geocoder_server.sql delete mode 100644 script/setup_organization.sh delete mode 100755 script/sync_tables_trigger.sh diff --git a/app/controllers/carto/api/analyses_controller.rb b/app/controllers/carto/api/analyses_controller.rb index 9cdd553..b69c8a2 100644 --- a/app/controllers/carto/api/analyses_controller.rb +++ b/app/controllers/carto/api/analyses_controller.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require_dependency 'carto/uuidhelper' require_relative '../builder/builder_users_module' diff --git a/app/controllers/carto/builder/builder_users_module.rb b/app/controllers/carto/builder/builder_users_module.rb index 62a97bd..0fe7131 100644 --- a/app/controllers/carto/builder/builder_users_module.rb +++ b/app/controllers/carto/builder/builder_users_module.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + module Carto module Builder module BuilderUsersModule diff --git a/app/controllers/carto/oauth_login_controller.rb b/app/controllers/carto/oauth_login_controller.rb index c44e17c..640478e 100644 --- a/app/controllers/carto/oauth_login_controller.rb +++ b/app/controllers/carto/oauth_login_controller.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + require_dependency 'carto/oauth/github/api' require_dependency 'carto/oauth/github/config' require_dependency 'carto/oauth/google/api' diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 395a88d..e03b90d 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,3 +1,4 @@ +# encoding: UTF-8 require_dependency 'carto/oauth/github/config' require_dependency 'carto/oauth/google/config' require_dependency 'carto/saml_service' diff --git a/config/application.rb b/config/application.rb index 32e8806..1b1e700 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,3 +1,5 @@ +# coding: utf-8 + require File.expand_path('../boot', __FILE__) require "action_controller/railtie" diff --git a/config/environments/development.rb b/config/environments/development.rb index ac0e498..dfc5394 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'carto/configuration' CartoDB::Application.configure do diff --git a/config/environments/development.rb.front b/config/environments/development.rb.front index 15e88dc..a6b51af 100644 --- a/config/environments/development.rb.front +++ b/config/environments/development.rb.front @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'carto/configuration' CartoDB::Application.configure do diff --git a/config/environments/production.rb b/config/environments/production.rb index d5b8675..98556e5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'carto/configuration' CartoDB::Application.configure do diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 0acfa99..56af3ca 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'carto/configuration' CartoDB::Application.configure do diff --git a/config/environments/test.rb b/config/environments/test.rb index 7e48953..50a1cb0 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + CartoDB::Application.configure do # Settings specified here will take precedence over those in config/application.rb diff --git a/config/initializers/float.rb b/config/initializers/float.rb index cd95d50..e422275 100644 --- a/config/initializers/float.rb +++ b/config/initializers/float.rb @@ -1,4 +1,6 @@ - class Float + # coding: UTF-8 + +class Float def self.random_latitude rand(40) * [1,-1][rand(2)] + (rand(10000.0) / 1000.0) diff --git a/config/initializers/repository.rb b/config/initializers/repository.rb index 469de86..cc433d2 100644 --- a/config/initializers/repository.rb +++ b/config/initializers/repository.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require_relative '../../services/data-repository/backend/sequel' require_relative '../../app/models/visualization/collection' require_relative '../../app/models/synchronization/collection' diff --git a/config/initializers/string.rb b/config/initializers/string.rb index bc1d4cb..cdc40e1 100644 --- a/config/initializers/string.rb +++ b/config/initializers/string.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + class String def self.random(length=10) ('a'..'z').sort_by {rand}[0,length].join diff --git a/config/routes.rb b/config/routes.rb index b1fbcc2..89fe78f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + # rubocop:disable Metrics/LineLength, Style/ExtraSpacing, Style/SingleSpaceBeforeFirstArg # NOTES: diff --git a/lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-click-view.js b/lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-click-view.js index 2c3ad46..7b421a6 100755 --- a/lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-click-view.js +++ b/lib/assets/javascripts/builder/editor/layers/layer-content-views/infowindow/infowindow-click-view.js @@ -43,7 +43,6 @@ module.exports = InfowindowBaseView.extend({ label: _t('editor.layers.infowindow.style.infowindow_header_with_url'), tooltip: _t('editor.layers.infowindow.tooltips.infowindow_header_with_url') } - ]; } diff --git a/lib/assets/javascripts/cartodb/old_common/header.js b/lib/assets/javascripts/cartodb/old_common/header.js index c7c8dcc..3fe6b7f 100644 --- a/lib/assets/javascripts/cartodb/old_common/header.js +++ b/lib/assets/javascripts/cartodb/old_common/header.js @@ -1,3 +1,4 @@ + /** * Common header for vis view ( table | derived ) * diff --git a/lib/assets/javascripts/cartodb/old_common/views/background_importer.jst.ejs b/lib/assets/javascripts/cartodb/old_common/views/background_importer.jst.ejs index cc27d89..5e6b482 100644 --- a/lib/assets/javascripts/cartodb/old_common/views/background_importer.jst.ejs +++ b/lib/assets/javascripts/cartodb/old_common/views/background_importer.jst.ejs @@ -1,6 +1,6 @@ <% if (state=='checking') { %> - 检查倒入 + 检查导入
<% } %> @@ -12,7 +12,7 @@ <% if (state=='preprocessing') { %> 创建表格
- (可以随意开始新的数据倒入) + (可以随意开始新的数据导入) <% } %> <% if (state=='complete') { %> @@ -20,5 +20,5 @@ <% } %> <% if (state=='failure') { %> - 倒入数据时发生了错误 + 导入数据时发生了错误 <% } %> diff --git a/lib/assets/javascripts/cartodb/table/menu_modules/infowindow.js b/lib/assets/javascripts/cartodb/table/menu_modules/infowindow.js index 8c2d7a2..f86c7ff 100644 --- a/lib/assets/javascripts/cartodb/table/menu_modules/infowindow.js +++ b/lib/assets/javascripts/cartodb/table/menu_modules/infowindow.js @@ -1,3 +1,5 @@ + + cdb.admin.mod = cdb.admin.mod || {}; diff --git a/lib/url_signer.rb b/lib/url_signer.rb index 328d5c7..5fb48f7 100644 --- a/lib/url_signer.rb +++ b/lib/url_signer.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'base64' require 'uri' require 'openssl' diff --git a/lib/user_account_creator.rb b/lib/user_account_creator.rb index e47a80e..9477dfd 100644 --- a/lib/user_account_creator.rb +++ b/lib/user_account_creator.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'securerandom' require_dependency 'carto/password_validator' require_dependency 'carto/strong_password_strategy' diff --git a/script/create_dev_user b/script/create_dev_user index 6543e35..e9a5bf0 100755 --- a/script/create_dev_user +++ b/script/create_dev_user @@ -1,42 +1,25 @@ #!/bin/sh -set -e +if test -n "$1"; then + SUBDOMAIN="$1" +else + echo -n "Enter a subdomain: "; read SUBDOMAIN +fi -SUBDOMAIN="dev" -PASSWORD="pass1234" -ADMIN_PASSWORD="pass1234" -EMAIL="dev@contoso.com" +if test -n "$2"; then + PASSWORD="$2" +else + echo -n "Enter a password (cleartext!): "; read PASSWORD +fi -echo "--- Creating databases" -bundle exec rake cartodb:db:setup +if test -n "$3"; then + EMAIL="$3" +else + echo -n "Enter an email: "; read EMAIL +fi -echo "--- Create '${SUBDOMAIN}' user" -bundle exec rake cartodb:db:create_user --trace SUBDOMAIN="${SUBDOMAIN}" \ - PASSWORD="${PASSWORD}" ADMIN_PASSWORD="${ADMIN_PASSWORD}" \ +echo "--- Creating dev user" +bundle exec rake cartodb:db:create_dev_user --trace SUBDOMAIN="${SUBDOMAIN}" \ + PASSWORD="${PASSWORD}" \ EMAIL="${EMAIL}" - -# # Update your quota to 100GB -echo "--- Updating quota to 100GB" -bundle exec rake cartodb:db:set_user_quota["${SUBDOMAIN}",102400] - -# # Allow unlimited tables to be created -echo "--- Allowing unlimited tables creation" -bundle exec rake cartodb:db:set_unlimited_table_quota["${SUBDOMAIN}"] - -# # Allow user to create private tables in addition to public -echo "--- Allowing private tables creation" -bundle exec rake cartodb:db:set_user_private_tables_enabled["${SUBDOMAIN}",'true'] - -# # Set the account type -echo "--- Setting cartodb account type" -bundle exec rake cartodb:db:set_user_account_type["${SUBDOMAIN}",'[DEDICATED]'] - -# Set dataservices server -bundle exec rake cartodb:db:configure_geocoder_extension_for_non_org_users[$SUBDOMAIN] - -# Set import limits -bundle exec rake cartodb:set_custom_limits_for_user["${SUBDOMAIN}",10240000000,100000000,1] - - -# Enable sync tables -echo "UPDATE users SET sync_tables_enabled=true WHERE username='${SUBDOMAIN}'" | psql -U postgres -t carto_db_development +if test $? -ne 0; then exit 1; fi diff --git a/script/fill_geocoder.sh b/script/fill_geocoder.sh deleted file mode 100755 index 8edd7d1..0000000 --- a/script/fill_geocoder.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# See https://github.com/CartoDB/data-services/issues/228#issuecomment-280037353 -# Not run during Docker build phase as it would make the image too big -cd /data-services/geocoder -./geocoder_download_dumps -GEOCODER_DB=`echo "SELECT database_name FROM users WHERE username='geocoder'" | psql -U postgres -t carto_db_development` -./geocoder_restore_dump postgres $GEOCODER_DB db_dumps/*.sql -rm -r db_dumps -chmod +x geocoder_download_patches.sh geocoder_apply_patches.sh -./geocoder_download_patches.sh -./geocoder_apply_patches.sh postgres $GEOCODER_DB data_patches/*.sql -rm -r data_patches diff --git a/script/geocoder.sh b/script/geocoder.sh deleted file mode 100644 index 7a711a7..0000000 --- a/script/geocoder.sh +++ /dev/null @@ -1,40 +0,0 @@ -cd /cartodb - -bundle exec rake cartodb:db:create_user --trace SUBDOMAIN="geocoder" \ - PASSWORD="pass1234" ADMIN_PASSWORD="pass1234" \ - EMAIL="geocoder@contoso.com" - -# # Update your quota to 100GB -echo "--- Updating quota to 100GB" -bundle exec rake cartodb:db:set_user_quota[geocoder,102400] - -# # Allow unlimited tables to be created -echo "--- Allowing unlimited tables creation" -bundle exec rake cartodb:db:set_unlimited_table_quota[geocoder] - -GEOCODER_DB=`echo "SELECT database_name FROM users WHERE username='geocoder'" | psql -U postgres -t carto_db_development` -psql -U postgres $GEOCODER_DB < /cartodb/script/geocoder_server.sql - -# Import observatory test dataset -psql -U postgres -d $GEOCODER_DB -f /observatory-extension/src/pg/test/fixtures/load_fixtures.sql -# Setup permissions for observatory -psql -U postgres -d $GEOCODER_DB -c "BEGIN;CREATE EXTENSION IF NOT EXISTS observatory VERSION 'dev'; COMMIT" -e -psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT SELECT ON ALL TABLES IN SCHEMA cdb_observatory TO geocoder; COMMIT" -e -psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA cdb_observatory TO geocoder; COMMIT" -e -psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT SELECT ON ALL TABLES IN SCHEMA observatory TO geocoder; COMMIT" -e -psql -U postgres -d $GEOCODER_DB -c "BEGIN;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA observatory TO geocoder; COMMIT" -e - -# Setup dataservices client -# dev user -USER_DB=`echo "SELECT database_name FROM users WHERE username='dev'" | psql -U postgres -t carto_db_development` -echo "CREATE EXTENSION cdb_dataservices_client;" | psql -U postgres $USER_DB -echo "SELECT CDB_Conf_SetConf('user_config', '{"'"is_organization"'": false, "'"entity_name"'": "'"dev"'"}');" | psql -U postgres $USER_DB -echo -e "SELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=${GEOCODER_DB# } user=postgres\"}');" | psql -U postgres $USER_DB -bundle exec rake cartodb:services:set_user_quota['dev',geocoding,100000] - -# example organization -ORGANIZATION_DB=`echo "SELECT database_name FROM users WHERE username='admin4example'" | psql -A -U postgres -t carto_db_development` -echo "CREATE EXTENSION cdb_dataservices_client;" | psql -U postgres $ORGANIZATION_DB -echo "SELECT CDB_Conf_SetConf('user_config', '{"'"is_organization"'": true, "'"entity_name"'": "'"example"'"}');" | psql -U postgres $ORGANIZATION_DB -echo -e "SELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=${GEOCODER_DB# } user=postgres\"}');" | psql -U postgres $ORGANIZATION_DB -bundle exec rake cartodb:services:set_org_quota['example',geocoding,100000] diff --git a/script/geocoder_server.sql b/script/geocoder_server.sql deleted file mode 100644 index 5faa480..0000000 --- a/script/geocoder_server.sql +++ /dev/null @@ -1,36 +0,0 @@ -create extension cdb_geocoder; -create extension plproxy; -create extension observatory; -create extension cdb_dataservices_server; -create extension cdb_dataservices_client; - -SELECT CDB_Conf_SetConf( - 'redis_metadata_config', - '{"redis_host": "localhost", "redis_port": 6379, "sentinel_master_id": "", "timeout": 0.1, "redis_db": 5}' -); -SELECT CDB_Conf_SetConf( - 'redis_metrics_config', - '{"redis_host": "localhost", "redis_port": 6379, "sentinel_master_id": "", "timeout": 0.1, "redis_db": 5}' -); - -SELECT CDB_Conf_SetConf( - 'user_config', - '{"is_organization": false, "entity_name": "geocoder"}' -); - -SELECT CDB_Conf_SetConf( - 'server_conf', - '{"environment": "development"}' -); - -SELECT cartodb.cdb_conf_setconf('logger_conf', '{"geocoder_log_path": "/tmp/geocodings.log"}'); - --- dummy conf from https://github.com/CartoDB/dataservices-api/blob/master/server/extension/test/sql/00_install_test.sql -SELECT cartodb.cdb_conf_setconf('redis_metrics_config', '{"redis_host": "localhost", "redis_port": 6379, "timeout": 0.1, "redis_db": 5}'); -SELECT cartodb.cdb_conf_setconf('redis_metadata_config', '{"redis_host": "localhost", "redis_port": 6379, "timeout": 0.1, "redis_db": 5}'); -SELECT cartodb.cdb_conf_setconf('heremaps_conf', '{"geocoder": {"app_id": "dummy_id", "app_code": "dummy_code", "geocoder_cost_per_hit": 1}, "isolines": {"app_id": "dummy_id", "app_code": "dummy_code"}}'); -SELECT cartodb.cdb_conf_setconf('mapzen_conf', '{"routing": {"api_key": "routing_dummy_api_key", "monthly_quota": 1500000}, "geocoder": {"api_key": "geocoder_dummy_api_key", "monthly_quota": 1500000}, "matrix": {"api_key": "matrix_dummy_api_key", "monthly_quota": 1500000}}'); -SELECT cartodb.cdb_conf_setconf('mapbox_conf', '{"routing": {"api_keys": ["routing_dummy_api_key"], "monthly_quota": 1500000}, "geocoder": {"api_keys": ["geocoder_dummy_api_key"], "monthly_quota": 1}, "matrix": {"api_keys": ["matrix_dummy_api_key"], "monthly_quota": 1500000}}'); -SELECT cartodb.cdb_conf_setconf('tomtom_conf', '{"routing": {"api_keys": ["routing_dummy_api_key"], "monthly_quota": 1500000}, "geocoder": {"api_keys": ["geocoder_dummy_api_key"], "monthly_quota": 1500000}, "isolines": {"api_keys": ["matrix_dummy_api_key"], "monthly_quota": 1500000}}'); -SELECT cartodb.cdb_conf_setconf('logger_conf', '{"geocoder_log_path": "/dev/null"}'); -SELECT cartodb.cdb_conf_setconf('data_observatory_conf', '{"connection": {"whitelist": ["ethervoid"], "production": "host=localhost port=5432 dbname=dataservices_db user=geocoder_api", "staging": "host=localhost port=5432 dbname=dataservices_db user=geocoder_api"}, "monthly_quota": 100000}'); diff --git a/script/setup_organization.sh b/script/setup_organization.sh deleted file mode 100644 index 39a25e5..0000000 --- a/script/setup_organization.sh +++ /dev/null @@ -1,19 +0,0 @@ -ORGANIZATION_NAME="example" -USERNAME="admin4example" -EMAIL="admin@contoso.com" -PASSWORD="pass1234" - -bundle exec rake cartodb:db:create_user EMAIL="${EMAIL}" PASSWORD="${PASSWORD}" SUBDOMAIN="${USERNAME}" -bundle exec rake cartodb:db:set_unlimited_table_quota["${USERNAME}"] -bundle exec rake cartodb:db:set_user_quota["${USERNAME}",102400] -bundle exec rake cartodb:db:create_new_organization_with_owner ORGANIZATION_NAME="${ORGANIZATION_NAME}" USERNAME="${USERNAME}" ORGANIZATION_SEATS=100 ORGANIZATION_QUOTA=102400 ORGANIZATION_DISPLAY_NAME="${ORGANIZATION_NAME}" -bundle exec rake cartodb:db:set_organization_quota[$ORGANIZATION_NAME,5000] -bundle exec rake cartodb:db:configure_geocoder_extension_for_organizations[$ORGANIZATION_NAME] -bundle exec rake cartodb:set_custom_limits_for_user["${USERNAME}",10240000000,100000000,1] - -# Enable sync tables -echo "UPDATE users SET sync_tables_enabled=true WHERE username='${USERNAME}'" | psql -U postgres -t carto_db_development -# Enable private maps -echo "UPDATE users SET private_maps_enabled = 't'" | psql -U postgres -t carto_db_development - -bundle exec rake cartodb:features:enable_feature_for_all_users["new_dashboard"] diff --git a/script/sync_tables_trigger.sh b/script/sync_tables_trigger.sh deleted file mode 100755 index 8c01fc5..0000000 --- a/script/sync_tables_trigger.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while : -do -sleep $SYNC_TABLES_INTERVAL -cd /cartodb -bundle exec rake cartodb:sync_tables[true] -done diff --git a/spec/acceptance_helper.rb b/spec/acceptance_helper.rb index bc1ebdf..18da01b 100644 --- a/spec/acceptance_helper.rb +++ b/spec/acceptance_helper.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative './spec_helper' require 'capybara/rails' require "capybara/dsl" diff --git a/spec/connectors/importer_spec.rb b/spec/connectors/importer_spec.rb index 07937cf..6753cc5 100644 --- a/spec/connectors/importer_spec.rb +++ b/spec/connectors/importer_spec.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require_relative '../spec_helper' require_relative '../../app/connectors/importer' require_relative '../doubles/result' diff --git a/spec/doubles/request.rb b/spec/doubles/request.rb index a5c35f3..8b99b12 100644 --- a/spec/doubles/request.rb +++ b/spec/doubles/request.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + module Doubles class Request diff --git a/spec/doubles/result.rb b/spec/doubles/result.rb index 8074346..b205abc 100644 --- a/spec/doubles/result.rb +++ b/spec/doubles/result.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + module CartoDB module Doubles module Importer2 diff --git a/spec/doubles/support_tables.rb b/spec/doubles/support_tables.rb index 2d6f79a..1f05ceb 100644 --- a/spec/doubles/support_tables.rb +++ b/spec/doubles/support_tables.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + module CartoDB module Doubles module Visualization diff --git a/spec/factories/groups.rb b/spec/factories/groups.rb index e0098ab..d739738 100644 --- a/spec/factories/groups.rb +++ b/spec/factories/groups.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require 'helpers/unique_names_helper' include UniqueNamesHelper diff --git a/spec/factories/organizations_contexts.rb b/spec/factories/organizations_contexts.rb index 5cb505f..a85fc2e 100644 --- a/spec/factories/organizations_contexts.rb +++ b/spec/factories/organizations_contexts.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require_relative '../support/factories/users' require 'helpers/unique_names_helper' diff --git a/spec/factories/visualization_creation_helpers.rb b/spec/factories/visualization_creation_helpers.rb index 7ac92ea..097d37c 100644 --- a/spec/factories/visualization_creation_helpers.rb +++ b/spec/factories/visualization_creation_helpers.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../support/factories/tables' require 'helpers/unique_names_helper' diff --git a/spec/lib/carto/bolt_spec.rb b/spec/lib/carto/bolt_spec.rb index 997f447..37d83e0 100644 --- a/spec/lib/carto/bolt_spec.rb +++ b/spec/lib/carto/bolt_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../spec_helper_min.rb' require_relative '../../../lib/carto/bolt.rb' diff --git a/spec/lib/carto/db/sanitize_spec.rb b/spec/lib/carto/db/sanitize_spec.rb index 2743fe8..354ec82 100644 --- a/spec/lib/carto/db/sanitize_spec.rb +++ b/spec/lib/carto/db/sanitize_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../../lib/carto/db/sanitize.rb' module Carto diff --git a/spec/lib/carto/db/sql_interface_spec.rb b/spec/lib/carto/db/sql_interface_spec.rb index b4dae16..1cd9bb2 100644 --- a/spec/lib/carto/db/sql_interface_spec.rb +++ b/spec/lib/carto/db/sql_interface_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'carto/db/sql_interface' require_relative '../../../spec_helper' diff --git a/spec/lib/carto/db/user_schema_spec.rb b/spec/lib/carto/db/user_schema_spec.rb index efb193f..84247d5 100644 --- a/spec/lib/carto/db/user_schema_spec.rb +++ b/spec/lib/carto/db/user_schema_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../spec_helper_min.rb' require 'carto/db/user_schema' diff --git a/spec/lib/carto/definition_spec.rb b/spec/lib/carto/definition_spec.rb index 2849b1e..ba31d6a 100644 --- a/spec/lib/carto/definition_spec.rb +++ b/spec/lib/carto/definition_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' module Carto diff --git a/spec/lib/carto/email_domain_validator_spec.rb b/spec/lib/carto/email_domain_validator_spec.rb index a76905c..94430bd 100644 --- a/spec/lib/carto/email_domain_validator_spec.rb +++ b/spec/lib/carto/email_domain_validator_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../lib/carto/email_domain_validator.rb' module Carto diff --git a/spec/lib/carto/file_system/sanitize_spec.rb b/spec/lib/carto/file_system/sanitize_spec.rb index 967b017..c1b3636 100644 --- a/spec/lib/carto/file_system/sanitize_spec.rb +++ b/spec/lib/carto/file_system/sanitize_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../../lib/carto/file_system/sanitize.rb' module Carto diff --git a/spec/lib/carto/form_spec.rb b/spec/lib/carto/form_spec.rb index 403cd38..197be96 100644 --- a/spec/lib/carto/form_spec.rb +++ b/spec/lib/carto/form_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' module Carto diff --git a/spec/lib/carto/forms_definition_spec.rb b/spec/lib/carto/forms_definition_spec.rb index e0d79a6..6531958 100644 --- a/spec/lib/carto/forms_definition_spec.rb +++ b/spec/lib/carto/forms_definition_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' module Carto diff --git a/spec/lib/carto/http/client_spec.rb b/spec/lib/carto/http/client_spec.rb index 3a1074e..7ca7f17 100644 --- a/spec/lib/carto/http/client_spec.rb +++ b/spec/lib/carto/http/client_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../spec_helper' require 'rspec/core' diff --git a/spec/lib/carto/named_maps/template_spec.rb b/spec/lib/carto/named_maps/template_spec.rb index cfeb04b..057ca99 100644 --- a/spec/lib/carto/named_maps/template_spec.rb +++ b/spec/lib/carto/named_maps/template_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../spec_helper_min' require_relative '../../../../lib/carto/named_maps/template' diff --git a/spec/lib/carto/password_validator_spec.rb b/spec/lib/carto/password_validator_spec.rb index ade592b..c7049c7 100644 --- a/spec/lib/carto/password_validator_spec.rb +++ b/spec/lib/carto/password_validator_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' module Carto diff --git a/spec/lib/carto/styles/cartography_spec.rb b/spec/lib/carto/styles/cartography_spec.rb index 1be38dc..f81e79e 100644 --- a/spec/lib/carto/styles/cartography_spec.rb +++ b/spec/lib/carto/styles/cartography_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' module Carto diff --git a/spec/lib/carto/styles/polygon_spec.rb b/spec/lib/carto/styles/polygon_spec.rb index 4bd12ab..c7b6c5d 100644 --- a/spec/lib/carto/styles/polygon_spec.rb +++ b/spec/lib/carto/styles/polygon_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' module Carto diff --git a/spec/lib/carto/valid_table_name_proposer_spec.rb b/spec/lib/carto/valid_table_name_proposer_spec.rb index 9a1c0b1..e1e4c44 100644 --- a/spec/lib/carto/valid_table_name_proposer_spec.rb +++ b/spec/lib/carto/valid_table_name_proposer_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require_relative '../../../lib/carto/valid_table_name_proposer.rb' module Carto diff --git a/spec/lib/cartodb/stats/importer_spec.rb b/spec/lib/cartodb/stats/importer_spec.rb index 75e134f..7382754 100644 --- a/spec/lib/cartodb/stats/importer_spec.rb +++ b/spec/lib/cartodb/stats/importer_spec.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require_relative '../../../simplecov_helper' require 'rspec/core' require 'rspec/expectations' diff --git a/spec/lib/errors_spec.rb b/spec/lib/errors_spec.rb index 93ff42f..a0d11d3 100644 --- a/spec/lib/errors_spec.rb +++ b/spec/lib/errors_spec.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'spec_helper' describe CartoDB do diff --git a/spec/models/carto/account_type_spec.rb b/spec/models/carto/account_type_spec.rb index 2b371fd..88415d5 100644 --- a/spec/models/carto/account_type_spec.rb +++ b/spec/models/carto/account_type_spec.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + require 'spec_helper_min' require 'support/helpers' require 'helpers/account_types_helper' diff --git a/spec/rspec_configuration.rb b/spec/rspec_configuration.rb index ed7efe5..2aa28f4 100644 --- a/spec/rspec_configuration.rb +++ b/spec/rspec_configuration.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 require 'rspec/core' require 'rspec/expectations' require 'rspec/mocks' diff --git a/spec/spec_helper_min.rb b/spec/spec_helper_min.rb index 500dfa7..5e7d6c9 100644 --- a/spec/spec_helper_min.rb +++ b/spec/spec_helper_min.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 # This file provides a minimal Rails integration test environment with an empty database, without users. require 'simplecov_helper' require 'rspec_configuration'