Module: CartoCSSHelper::Configuration
- Included in:
- Heuristic
- Defined in:
- lib/cartocss_helper/configuration.rb
Instance Method Summary collapse
- #default_renderer ⇒ Object
- #find_style_file_location ⇒ Object
- #get_cartocss_project_name ⇒ Object
- #get_data_filename ⇒ Object
- #get_max_z ⇒ Object
- #get_min_z ⇒ Object
- #get_overpass_instance_url ⇒ Object
- #get_path_to_cartocss_project_folder ⇒ Object
- #get_path_to_folder_for_branch_specific_cache ⇒ Object
- #get_path_to_folder_for_cache ⇒ Object
- #get_path_to_folder_for_history_api_cache ⇒ Object
- #get_path_to_folder_for_notes_api_cache ⇒ Object
- #get_path_to_folder_for_output ⇒ Object
- #get_path_to_folder_for_overpass_cache ⇒ Object
- #get_style_file_location ⇒ Object
- #get_style_specific_data ⇒ Object
- #mapnik_reference_version_override ⇒ Object
- #path_to_kosmtik ⇒ Object
- #project_file_location ⇒ Object
- #renderer ⇒ Object
- #set_known_alternative_overpass_url ⇒ Object
- #set_mapnik_reference_version_override(version) ⇒ Object
- #set_overpass_instance_url(path) ⇒ Object
-
#set_path_to_cartocss_project_folder(path) ⇒ Object
Link to project folder itself, not to folder containing various projects.
- #set_path_to_folder_for_cache(path) ⇒ Object
- #set_path_to_folder_for_output(path) ⇒ Object
- #set_path_to_kosmtik(path) ⇒ Object
- #set_renderer(renderer) ⇒ Object
- #set_style_specific_data(data) ⇒ Object
Instance Method Details
#default_renderer ⇒ Object
137 138 139 |
# File 'lib/cartocss_helper/configuration.rb', line 137 def default_renderer :tilemill end |
#find_style_file_location ⇒ Object
52 53 54 55 56 |
# 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 ⇒ Object
43 44 45 |
# 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 ⇒ Object
112 113 114 |
# 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 ⇒ Object
20 21 22 |
# File 'lib/cartocss_helper/configuration.rb', line 20 def get_max_z return get_style_specific_data.max_z end |
#get_min_z ⇒ Object
24 25 26 27 28 29 |
# 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 ⇒ Object
125 126 127 |
# File 'lib/cartocss_helper/configuration.rb', line 125 def get_overpass_instance_url return @overpass_instance_url end |
#get_path_to_cartocss_project_folder ⇒ Object
36 37 38 39 40 41 |
# 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 ⇒ Object
88 89 90 91 92 |
# 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 ⇒ Object
80 81 82 83 84 85 86 |
# 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 ⇒ Object
106 107 108 109 110 |
# 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 ⇒ Object
100 101 102 103 104 |
# 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 ⇒ Object
68 69 70 71 72 73 74 |
# 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 ⇒ Object
94 95 96 97 98 |
# 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 ⇒ Object
47 48 49 50 |
# 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 ⇒ Object
13 14 15 16 17 18 |
# 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 ⇒ Object
150 151 152 |
# File 'lib/cartocss_helper/configuration.rb', line 150 def mapnik_reference_version_override @mapnik_reference_version end |
#path_to_kosmtik ⇒ Object
133 134 135 |
# File 'lib/cartocss_helper/configuration.rb', line 133 def path_to_kosmtik @kosmtik_path end |
#project_file_location ⇒ Object
58 59 60 61 62 |
# 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 ⇒ Object
145 146 147 148 |
# File 'lib/cartocss_helper/configuration.rb', line 145 def renderer return default_renderer if @renderer == nil return @renderer end |
#set_known_alternative_overpass_url ⇒ Object
121 122 123 |
# 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) ⇒ Object
154 155 156 |
# 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) ⇒ Object
117 118 119 |
# 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) ⇒ Object
Link to project folder itself, not to folder containing various projects.
32 33 34 |
# 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) ⇒ Object
76 77 78 |
# 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) ⇒ Object
64 65 66 |
# 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) ⇒ Object
129 130 131 |
# File 'lib/cartocss_helper/configuration.rb', line 129 def set_path_to_kosmtik(path) @kosmtik_path = path end |
#set_renderer(renderer) ⇒ Object
141 142 143 |
# File 'lib/cartocss_helper/configuration.rb', line 141 def set_renderer(renderer) @renderer = renderer end |
#set_style_specific_data(data) ⇒ Object
9 10 11 |
# File 'lib/cartocss_helper/configuration.rb', line 9 def set_style_specific_data(data) @style_specific_data = data end |