Module: Hanami::Version Private

Defined in:
lib/hanami/version.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Hanami version

Since:

  • 0.9.0

Constant Summary collapse

VERSION =

Since:

  • 0.9.0

"2.1.1"

Class Method Summary collapse

Class Method Details

.gem_requirementObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.9.0



20
21
22
23
24
25
26
# File 'lib/hanami/version.rb', line 20

def self.gem_requirement
  if prerelease?
    version
  else
    "~> #{major_minor}"
  end
end

.major_minorObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.9.0



36
37
38
# File 'lib/hanami/version.rb', line 36

def self.major_minor
  version.scan(/\A\d{1,2}\.\d{1,2}/).first
end

.prerelease?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.9.0



30
31
32
# File 'lib/hanami/version.rb', line 30

def self.prerelease?
  version =~ /alpha|beta|rc/
end

.versionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.9.0



14
15
16
# File 'lib/hanami/version.rb', line 14

def self.version
  VERSION
end