Module: JsImagePaths::Generator

Defined in:
lib/js_image_paths/generator.rb

Class Method Summary collapse

Class Method Details

.generateObject



5
6
7
# File 'lib/js_image_paths/generator.rb', line 5

def self.generate
  image_hash.to_json
end

.image_hashObject



9
10
11
12
13
14
# File 'lib/js_image_paths/generator.rb', line 9

def self.image_hash
  images = context.environment.each_logical_path(->(_, path) { path.include? "images" })
  images.each_with_object({}) do |path, images|
    images[path] = context.asset_path(path)
  end
end