Class: Fastlane::OtherAction

Inherits:
Object
  • Object
show all
Defined in:
fastlane/lib/fastlane/other_action.rb

Overview

This class is used to call other actions from within actions We use a separate class so that we can easily identify when we have dependencies between actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner) ⇒ OtherAction

Returns a new instance of OtherAction.



8
9
10
# File 'fastlane/lib/fastlane/other_action.rb', line 8

def initialize(runner)
  self.runner = runner
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &_block) ⇒ Object

Allows the user to call an action from an action



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'fastlane/lib/fastlane/other_action.rb', line 13

def method_missing(method_sym, *arguments, &_block)
  # We have to go inside the fastlane directory
  # since in the fastlane runner.rb we do the following
  #   custom_dir = ".."
  #   Dir.chdir(custom_dir) do
  # this goes one folder up, since we're inside the "fastlane"
  # folder at that point
  # Since we call an action from an action we need to go inside
  # the fastlane folder too

  self.runner.trigger_action_by_name(method_sym,
                                     FastlaneCore::FastlaneFolder.path,
                                     true,
                                     *arguments)
end

Instance Attribute Details

#runnerObject

Returns the value of attribute runner.



6
7
8
# File 'fastlane/lib/fastlane/other_action.rb', line 6

def runner
  @runner
end