Class: Studio::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Studio::Engine
- Defined in:
- lib/studio/engine.rb
Class Method Summary collapse
-
.default_email_banner_logical_paths ⇒ Object
Logical asset paths ("emails/magic-link.png") for every default banner the gem ships.
-
.subdivision_flag_logical_paths ⇒ Object
Logical asset paths ("state-flags/wa.svg") for every subdivision flag the gem ships.
Class Method Details
.default_email_banner_logical_paths ⇒ Object
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. Dir[File.("../../app/assets/images/emails/*", __dir__)] .select { |path| File.file?(path) } .map { |path| "emails/#{File.basename(path)}" } .sort end |
.subdivision_flag_logical_paths ⇒ Object
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.("../../app/assets/images/state-flags/*", __dir__), File.("../../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 |