Class: Fastlane::Actions::DangerAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/danger.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, output, return_value, sh, step_text

Class Method Details

.authorsObject



36
37
38
# File 'lib/fastlane/actions/danger.rb', line 36

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
# File 'lib/fastlane/actions/danger.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
                                 env_name: "FL_DANGER_USE_BUNDLE_EXEC",
                                 description: "Use bundle exec when there is a Gemfile presented",
                                 is_string: false,
                                 default_value: true)
  ]
end

.descriptionObject



14
15
16
# File 'lib/fastlane/actions/danger.rb', line 14

def self.description
  "Runs `danger` for the project"
end

.detailsObject



18
19
20
# File 'lib/fastlane/actions/danger.rb', line 18

def self.details
  "More information: https://github.com/danger/danger"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/fastlane/actions/danger.rb', line 32

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/fastlane/actions/danger.rb', line 4

def self.run(params)
  Actions.verify_gem!('danger')
  cmd = []

  cmd << ['bundle exec'] if File.exist?('Gemfile') && params[:use_bundle_exec]
  cmd << ['danger']

  Actions.sh(cmd.join(' '))
end