Class: Fastlane::Actions::PropertyFileReadAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



16
17
18
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 16

def self.authors
  ["Peter Turza"]
end

.available_optionsObject



29
30
31
32
33
34
35
36
37
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 29

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :file,
                            env_name: "PROPERTY_FILE_READ_FILE",
                         description: "Property file to read",
                            optional: false,
                                type: String)
  ]
end

.descriptionObject



12
13
14
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 12

def self.description
  "Reads property file into dictionary"
end

.detailsObject



24
25
26
27
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 24

def self.details
  # Optional:
  "Reads property file into dictionary. Used mostly in Android development as configuration files for gradle builds."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
42
43
44
45
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 39

def self.is_supported?(platform)
  # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
  # See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
  #
  # [:ios, :mac, :android].include?(platform)
  true
end

.return_valueObject



20
21
22
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 20

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/fastlane/plugin/property_file_read/actions/property_file_read_action.rb', line 4

def self.run(params)
  properties = {}
  IO.foreach(params[:file]) do |line|
    properties[$1.strip] = $2 if line =~ %r{([^=]*)=(.*)\/\/(.*)} || line =~ /([^=]*)=(.*)/
  end
  properties
end