Sha256: 7bace9adc735de0fe3e10613693b593e46914db0d0eeb0760d1b76efb04629da
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 KB
Contents
# frozen_string_literal: true require 'core_ext' require 'puffy/parser.tab' require 'puffy/formatters/base' require 'puffy/formatters/iptables' require 'puffy/formatters/iptables4' require 'puffy/formatters/iptables6' require 'puffy/formatters/pf' require 'puffy/puppet' require 'puffy/resolver' require 'puffy/rule' require 'puffy/rule_factory' require 'puffy/version' module Puffy # Base class for application errors with a configuration file class PuffyError < RuntimeError def initialize(message, token) super(message) @token = token end def filename @token[:filename] end def lineno @token[:lineno] end def line @token[:line] end def position @token[:position] end def length @token.fetch(:length, 1) end def extra '~' * (length - 1) end def to_s <<~MESSAGE #{filename}:#{lineno}:#{position + 1}: #{super} #{line} #{' ' * position}^#{extra} MESSAGE end end # Invalid configuration file class ParseError < PuffyError end # Syntax error in configuration file class SyntaxError < PuffyError end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
puffy-1.0.0 | lib/puffy.rb |
puffy-0.3.1 | lib/puffy.rb |
puffy-0.2.0 | lib/puffy.rb |