Skip to content

Dryml rexml CONST NAME_STR not loading #202

@iox

Description

@iox

Not sure why, but a legacy project suddenly failed to restart with the following error:

/var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:84:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'hobo'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant Dryml::Parser::BaseParser::NAME_STR
Backtrace for gem load error is:
/home/donations/app/vendor/bundle/ruby/2.3.0/gems/dryml-2.1.1/lib/dryml/parser/base_parser.rb:9:in <class:BaseParser>'
/home/donations/app/vendor/bundle/ruby/2.3.0/gems/dryml-2.1.1/lib/dryml/parser/base_parser.rb:3:in <module:Parser>'
/home/donations/app/vendor/bundle/ruby/2.3.0/gems/dryml-2.1.1/lib/dryml/parser/base_parser.rb:1:in <top (required)>'

It seems like the REXML base parser does not have some of these constants anymore?

As a quick workaround, I opened ./vendor/bundle/ruby/2.3.0/gems/dryml-2.1.1/lib/dryml/parser/base_parser.rb and I added some constants from the REXML base parser at the top of the file:

module Dryml::Parser

  class BaseParser < REXML::Parsers::BaseParser
      LETTER = '[:alpha:]'
      DIGIT = '[:digit:]'

      COMBININGCHAR = '' # TODO
      EXTENDER = ''      # TODO

      NCNAME_STR= "[#{LETTER}_:][-[:alnum:]._:#{COMBININGCHAR}#{EXTENDER}]*"
      NAME_STR= "(?:(#{NCNAME_STR}):)?(#{NCNAME_STR})"
      UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions