Class: Releaseko::AppVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/releaseko/app_version.rb

Overview

Class responsible for managing the file ./metadata/app-version.

Constant Summary collapse

METHODS =
%w[major minor build].freeze
FILE_PATH =
File.join(Dir.pwd, 'metadata', 'app-version').freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method) ⇒ AppVersion

Returns a new instance of AppVersion.



11
12
13
14
# File 'lib/releaseko/app_version.rb', line 11

def initialize(method)
  @method = method
  validate!
end

Instance Attribute Details

#breakdownObject (readonly)

Returns the value of attribute breakdown.



9
10
11
# File 'lib/releaseko/app_version.rb', line 9

def breakdown
  @breakdown
end

#methodObject (readonly)

Returns the value of attribute method.



9
10
11
# File 'lib/releaseko/app_version.rb', line 9

def method
  @method
end

Instance Method Details

#performObject



16
17
18
19
20
# File 'lib/releaseko/app_version.rb', line 16

def perform
  breakdown_version
  increment_on_method
  build_version!
end