module Grouik::Concerns::Versionable::ClassMethods

Public Instance Methods

version_info() click to toggle source
# File src/lib/grouik/concerns/versionable.rb, line 26
def version_info
  unless const_defined?(:VERSION)
    include VersionInfo

    VersionInfo.file_format = :yaml
    self.VERSION.file_name = version_filepath
    self.VERSION.load
  end

  self.VERSION.to_hash.freeze
end

Protected Instance Methods

version_filepath() click to toggle source

Get path to the “version“ file

@return [Pathname]

# File src/lib/grouik/concerns/versionable.rb, line 43
def version_filepath
  name = ActiveSupport::Inflector.underscore(self.name)
  dirs = ['..'] * self::VERSION_PATH_LEVELS

  Pathname.new(__dir__).join(*(dirs + [name, 'version_info.yml'])).realpath
end