Class: Studio::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/studio/engine.rb

Class Method Summary collapse

Class Method Details

.default_email_banner_logical_pathsObject

Logical asset paths ("emails/magic-link.png") for every default banner the gem ships.



75
76
77
78
79
80
# File 'lib/studio/engine.rb', line 75

def self.default_email_banner_logical_paths
  Dir[File.expand_path("../../app/assets/images/emails/*", __dir__)]
    .select { |path| File.file?(path) }
    .map { |path| "emails/#{File.basename(path)}" }
    .sort
end

.subdivision_flag_logical_pathsObject

Logical asset paths ("state-flags/wa.svg") for every subdivision flag the gem ships. Both the vector art and the small rasters behind it: the badge renders one SVG, /admin/geo's grid renders 52 PNGs (the SVG set is ~10 MB of real vector art, which is not a page's worth of downloads for 16px squares).



87
88
89
90
91
92
93
# File 'lib/studio/engine.rb', line 87

def self.subdivision_flag_logical_paths
  Dir[File.expand_path("../../app/assets/images/state-flags/*", __dir__),
      File.expand_path("../../app/assets/images/state-flags/thumb/*", __dir__)]
    .select { |path| File.file?(path) }
    .map { |path| path.include?("/thumb/") ? "state-flags/thumb/#{File.basename(path)}" : "state-flags/#{File.basename(path)}" }
    .sort
end