X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/30b3a971bc63771eef0e42a5856b8f0aa5edcb36..1bcde09125777a0fd36ecb82a21deff558f4265a:/lib/osm_community_index.rb diff --git a/lib/osm_community_index.rb b/lib/osm_community_index.rb new file mode 100644 index 000000000..f738e8ae8 --- /dev/null +++ b/lib/osm_community_index.rb @@ -0,0 +1,12 @@ +module OsmCommunityIndex + require "yaml" + + def self.community_index + @community_index ||= community_index_from_json + end + + def self.community_index_from_json + json_file = Rails.root.join("node_modules/osm-community-index/dist/resources.json") + JSON.parse(File.read(json_file)) + end +end