]> git.openstreetmap.org Git - rails.git/commitdiff
Unnest OsmCommunityIndex
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Mar 2022 16:23:07 +0000 (16:23 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 2 Mar 2022 16:23:07 +0000 (16:23 +0000)
No need for OsmCommunityIndex::OsmCommunityIndex.foo

lib/osm_community_index.rb [new file with mode: 0644]
lib/osm_community_index/osm_community_index.rb [deleted file]

diff --git a/lib/osm_community_index.rb b/lib/osm_community_index.rb
new file mode 100644 (file)
index 0000000..f738e8a
--- /dev/null
@@ -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 (file)
index 475a5be..0000000
+++ /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