module CartoCSSHelper::Configuration

Public Instance Methods

default_renderer() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 137
def default_renderer
  :tilemill
end
find_style_file_location() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 52
def find_style_file_location
  Find.find(get_path_to_cartocss_project_folder) do |path|
    return path if path =~ /.*\.style$/
  end
end
get_cartocss_project_name() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 43
def get_cartocss_project_name
  return get_path_to_cartocss_project_folder.split(File::SEPARATOR)[-1]
end
get_data_filename() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 112
def get_data_filename
  return get_path_to_folder_for_branch_specific_cache + 'data.osm'
end
get_max_z() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 20
def get_max_z
  return get_style_specific_data.max_z
end
get_min_z() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 24
def get_min_z
  if @style_specific_data == nil
    raise 'Set your configuration data using CartoCSSHelper::Configuration.set_style_specific_data(data)'
  end
  return get_style_specific_data.min_z
end
get_overpass_instance_url() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 125
def get_overpass_instance_url
  return @overpass_instance_url
end
get_path_to_cartocss_project_folder() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 36
def get_path_to_cartocss_project_folder
  if @style_path == nil
    raise 'Set your configuration data using CartoCSSHelper::Configuration.set_style_path(path)'
  end
  return @style_path
end
get_path_to_folder_for_branch_specific_cache() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 88
def get_path_to_folder_for_branch_specific_cache
  location = File.join(get_path_to_folder_for_cache, 'generated_images', CartoCSSHelper::Git.get_commit_hash, '')
  FileUtils.mkdir_p location
  return location
end
get_path_to_folder_for_cache() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 80
def get_path_to_folder_for_cache
  if @path_to_folder_for_cache == nil
    raise 'Set your configuration data using CartoCSSHelper::Configuration.set_path_to_folder_for_cache(path)'
  end
  FileUtils.mkdir_p @path_to_folder_for_cache
  return @path_to_folder_for_cache
end
get_path_to_folder_for_history_api_cache() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 106
def get_path_to_folder_for_history_api_cache
  location = File.join(get_path_to_folder_for_cache, 'history-api', '')
  FileUtils.mkdir_p location
  return location
end
get_path_to_folder_for_notes_api_cache() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 100
def get_path_to_folder_for_notes_api_cache
  location = File.join(get_path_to_folder_for_cache, 'notes-api', '')
  FileUtils.mkdir_p location
  return location
end
get_path_to_folder_for_output() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 68
def get_path_to_folder_for_output
  if @path_to_folder_for_output == nil
    raise 'Set your configuration data using CartoCSSHelper::Configuration.set_path_to_folder_for_output(path)'
  end
  FileUtils.mkdir_p @path_to_folder_for_output
  return @path_to_folder_for_output
end
get_path_to_folder_for_overpass_cache() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 94
def get_path_to_folder_for_overpass_cache
  location = File.join(get_path_to_folder_for_cache, 'overpass', '')
  FileUtils.mkdir_p location
  return location
end
get_style_file_location() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 47
def get_style_file_location
  @style_file = find_style_file_location if @style_file == nil
  return @style_file
end
get_style_specific_data() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 13
def get_style_specific_data
  if @style_specific_data == nil
    raise 'Set your configuration data using CartoCSSHelper::Configuration.set_style_specific_data(data)'
  end
  return @style_specific_data
end
mapnik_reference_version_override() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 150
def mapnik_reference_version_override
  @mapnik_reference_version
end
path_to_kosmtik() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 133
def path_to_kosmtik
  @kosmtik_path
end
project_file_location() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 58
def project_file_location
  Find.find(get_path_to_cartocss_project_folder) do |path|
    return path if path =~ /.*\.yaml$/
  end
end
renderer() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 145
def renderer
  return default_renderer if @renderer == nil
  return @renderer
end
set_known_alternative_overpass_url() click to toggle source
# File lib/cartocss_helper/configuration.rb, line 121
def set_known_alternative_overpass_url
  set_overpass_instance_url('http://overpass.osm.rambler.ru/cgi')
end
set_mapnik_reference_version_override(version) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 154
def set_mapnik_reference_version_override(version)
  @mapnik_reference_version = version
end
set_overpass_instance_url(path) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 117
def set_overpass_instance_url(path)
  @overpass_instance_url = path
end
set_path_to_cartocss_project_folder(path) click to toggle source

Link to project folder itself, not to folder containing various projects.

# File lib/cartocss_helper/configuration.rb, line 32
def set_path_to_cartocss_project_folder(path)
  @style_path = path
end
set_path_to_folder_for_cache(path) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 76
def set_path_to_folder_for_cache(path)
  @path_to_folder_for_cache = path
end
set_path_to_folder_for_output(path) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 64
def set_path_to_folder_for_output(path)
  @path_to_folder_for_output = path
end
set_path_to_kosmtik(path) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 129
def set_path_to_kosmtik(path)
  @kosmtik_path = path
end
set_renderer(renderer) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 141
def set_renderer(renderer)
  @renderer = renderer
end
set_style_specific_data(data) click to toggle source
# File lib/cartocss_helper/configuration.rb, line 9
def set_style_specific_data(data)
  @style_specific_data = data
end