lib/prawn/icon.rb in prawn-icon-1.1.1 vs lib/prawn/icon.rb in prawn-icon-1.2.0

- old
+ new

@@ -4,25 +4,15 @@ # # Copyright October 2014, Jesse Doyle. All rights reserved. # # This is free software. Please see the LICENSE and COPYING files for details. -require 'prawn' +require_relative 'icon/base' require_relative 'icon/font_data' require_relative 'icon/parser' module Prawn - module Errors - # Error raised when an icon glyph is not found - # - IconNotFound = Class.new(StandardError) - - # Error raised when an icon key is not provided - # - IconKeyEmpty = Class.new(StandardError) - end - # Easy icon font usage within Prawn. Currently # supported icon fonts include: FontAwesome, # Zurb Foundicons, GitHub Octicons, as well as # PaymentFont. # @@ -32,11 +22,11 @@ # methods. Keys map directly to a unicode character # within the font that produces a given icon. As a # rule, included icon keys should match the keys from # the font provider. The icon key mapping is specified # in the font's +legend_file+, which is a +YAML+ file - # located in Prawn::Icon::FONTDIR/font/font.yml. + # located in Prawn::Icon::Base::FONTDIR/font/font.yml. # # Prawn::Icon:: # Houses the methods and interfaces necessary for # rendering icons to the Prawn::Document. # @@ -51,11 +41,10 @@ # inline_format: true option. The input string is parsed # once for <icon></icon> tags, then the output is provided # to Prawn's internal formatted text parser. # class Icon - FONTDIR = File.join \ - File.expand_path('../../..', __FILE__), 'data/fonts' + FONTDIR = Icon::Base::FONTDIR module Interface # Set up and draw an icon on this document. This # method operates much like +Prawn::Text::Box+. #