Module: Hanami::Version

Defined in:
lib/hanami/version.rb

Overview

Since:

  • 0.1.0

Constant Summary collapse

VERSION =

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

Since:

  • 0.9.0

'0.9.0'.freeze

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


15
16
17
18
19
20
21
# File 'lib/hanami/version.rb', line 15

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


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

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


25
26
27
# File 'lib/hanami/version.rb', line 25

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


9
10
11
# File 'lib/hanami/version.rb', line 9

def self.version
  VERSION
end