Class: Fastlane::Helper::ReleaseNoteShortMetadataBlock

Inherits:
ReleaseNoteMetadataBlock show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb

Instance Attribute Summary

Attributes inherited from ReleaseNoteMetadataBlock

#keep_key, #new_key, #rel_note_key, #release_version

Attributes inherited from StandardMetadataBlock

#content_file_path

Attributes inherited from MetadataBlock

#block_key

Instance Method Summary collapse

Methods inherited from ReleaseNoteMetadataBlock

#extract_key, #generate_keys, #handle_line, #is_int?

Methods inherited from StandardMetadataBlock

#handle_line

Methods inherited from MetadataBlock

#handle_line

Constructor Details

#initialize(block_key, content_file_path, release_version) ⇒ ReleaseNoteShortMetadataBlock

Returns a new instance of ReleaseNoteShortMetadataBlock.



6
7
8
9
10
11
# File 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb', line 6

def initialize(block_key, content_file_path, release_version)
  super
  @rel_note_key = 'release_note_short'
  @release_version = release_version
  generate_keys(release_version)
end

Instance Method Details

#generate_block(file) ⇒ Object



18
19
20
# File 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb', line 18

def generate_block(file)
  super unless File.empty?(@content_file_path)
end

#is_handler_for(key) ⇒ Object



13
14
15
16
# File 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata/release_note_short_metadata_block.rb', line 13

def is_handler_for(key)
  values = key.split('_')
  key.start_with?(@rel_note_key) && values.length == 4 && is_int?(values[3].sub(/^0*/, ''))
end