Class: SlnProject::SolutionConfigurationPlatformsBlock

Inherits:
GlobalSectionBlock show all
Defined in:
lib/fastlane/plugin/sapfire/sln_project/global_block.rb

Constant Summary

Constants inherited from GlobalSectionBlock

GlobalSectionBlock::TYPES

Instance Attribute Summary collapse

Attributes inherited from GlobalSectionBlock

#type

Instance Method Summary collapse

Methods inherited from GlobalSectionBlock

#initialize

Constructor Details

This class inherits a constructor from SlnProject::GlobalSectionBlock

Instance Attribute Details

#platformsObject

Returns the value of attribute platforms.



98
99
100
# File 'lib/fastlane/plugin/sapfire/sln_project/global_block.rb', line 98

def platforms
  @platforms
end

Instance Method Details

#parse(block_str) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/fastlane/plugin/sapfire/sln_project/global_block.rb', line 100

def parse(block_str)
  is_header = false
  content_reader = StringIO.new(block_str)
  self.platforms = {}

  content_reader.each_line do |line|
    unless is_header
      is_header = true
      next
    end

    assignment = Assignment.new(line).key
    assignment_parts = assignment.split("|")
    configuration = assignment_parts[0]
    platform = assignment_parts[1]

    self.platforms[configuration] = [] unless self.platforms[configuration].is_a?(Array) && !self.platforms[configuration].empty?
    self.platforms[configuration].append(platform)
  end
end