lib/usps_flags/burgees/customs.rb in usps_flags-burgees-0.0.22 vs lib/usps_flags/burgees/customs.rb in usps_flags-burgees-0.1.0

- old
+ new

@@ -1,15 +1,18 @@ +# frozen_string_literal: true + # Helper class for handling user-provided burgees. # # @private class USPSFlags::Burgees::Customs def self.available Dir.glob("#{USPSFlags.configuration.burgees_dir}/**/*.svg").map do |b| - b.split("/").last.split(".svg").first.to_sym + b.split('/').last.split('.svg').first.to_sym end end def self.get(burgee) raise USPSFlags::Errors::UnknownBurgee unless self.available.include?(burgee) + ::File.read("#{USPSFlags.configuration.burgees_dir}/#{burgee}.svg") end end