lib/usps_flags.rb in usps_flags-0.1.26 vs lib/usps_flags.rb in usps_flags-0.2.0

- old
+ new

@@ -12,14 +12,24 @@ require 'usps_flags/helpers' require 'usps_flags/core' require 'usps_flags/generate' # Dir['./lib/usps_flags/core/**'].map { |d| d.split("/").last.split(".rb").first } - %w[anchor binoculars ensign field footer headers lighthouse pennant star trident trident_spec trumpet us wheel].each do |d| + %w[anchor binoculars ensign field footer headers lighthouse pennant star trident tridents trident_spec trumpet us wheel].each do |d| require "usps_flags/core/#{d}" end + # Dir['./lib/usps_flags/generate/**'].map { |d| d.split("/").last.split(".rb").first } + %w[flag].each do |d| + require "usps_flags/generate/#{d}" + end + + # Dir['./lib/usps_flags/helpers/**'].map { |d| d.split("/").last.split(".rb").first } + %w[builders spec_arrows].each do |d| + require "usps_flags/helpers/#{d}" + end + # Constructor for individual flags. # # @example Generate insignia at default scale for Lt/C # f = USPSFlags.new do # type "LtC" @@ -124,10 +134,10 @@ # Generates the constructed file as SVG. # # @return [String] Returns the SVG file output path, or the svg data if no path was specified. def svg - svg = USPSFlags::Generate.get(self.type, outfile: self.svg_file, scale: self.scale, field: self.field) + svg = USPSFlags::Generate.svg(self.type, outfile: self.svg_file, scale: self.scale, field: self.field) (self.svg_file.nil? || self.svg_file == "") ? svg : self.svg_file end # Generates the constructed file as PNG. #