From: Andy Allan Date: Wed, 2 Mar 2022 16:23:07 +0000 (+0000) Subject: Unnest OsmCommunityIndex X-Git-Tag: live~999^2~19 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1bcde09125777a0fd36ecb82a21deff558f4265a?ds=sidebyside Unnest OsmCommunityIndex No need for OsmCommunityIndex::OsmCommunityIndex.foo --- 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 diff --git a/lib/osm_community_index/osm_community_index.rb b/lib/osm_community_index/osm_community_index.rb deleted file mode 100644 index 475a5be67..000000000 --- a/lib/osm_community_index/osm_community_index.rb +++ /dev/null @@ -1,14 +0,0 @@ -module OsmCommunityIndex - class 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 -end