2 # require 'sprockets/railtie'
6 # include Sprockets::Helpers::RailsHelper
8 def self.local_chapters
9 self.load_local_chapters
14 def self.load_local_chapters
16 json_file = File.expand_path("node_modules/osm-community-index/dist/completeFeatureCollection.json", Dir.pwd);
17 # json_file = File.expand_path("./node_modules/osm-community-index", Dir.pwd);
19 path = File.exist?(json_file) # Dir.pwd # File.open(json_file, "r")
20 community_index = JSON.parse(File.read(json_file))
23 community_index['features'].each do |feature|
24 feature['properties']['resources'].each do |id, data|
25 data.each do |key, value|
26 if key == "type" and value == "osm-lc"
27 array_of_entries.push(id);
33 return array_of_entries