os6sense / xumlidot

RUBY UML class diagram generator with XMI and DOT output.
MIT License
40 stars 7 forks source link

Assignment of an array in class/module body creates superclass #30

Closed os6sense closed 3 years ago

os6sense commented 3 years ago
# frozen_string_literal: true

module VersionModule
  def self.gem_version
    Gem::Version.new VERSION::STRING
  end 

  class Version
    # bug/missing feature, constants not defined
    MAJOR = 0 
    MINOR = 2 
    TINY  = 0 
    PRE   = 'alpha'

    # BUG - this ends up as being a superclass, it should just be a constant called STRING
    STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
  end 
end

The assignment to STRING will result in a superclass being created.

test

(bin/xumlidot spec/app/lib/version.rb | dot -Tpng -o test.png && xdg-open test.png)