From 1bcde09125777a0fd36ecb82a21deff558f4265a Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 2 Mar 2022 16:23:07 +0000 Subject: [PATCH] Unnest OsmCommunityIndex No need for OsmCommunityIndex::OsmCommunityIndex.foo --- lib/osm_community_index.rb | 12 ++++++++++++ lib/osm_community_index/osm_community_index.rb | 14 -------------- 2 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 lib/osm_community_index.rb delete mode 100644 lib/osm_community_index/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 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 -- 2.45.1