Class: Fastlane::Actions::PodLibLintAction

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, method_missing, other_action, sh, step_text

Class Method Details

.authorsObject



74
75
76
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 74

def self.authors
  ["thierryxing"]
end

.available_optionsObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 43

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
                                   description: "Use bundle exec when there is a Gemfile presented",
                                   is_string: false,
                                   default_value: true),
    FastlaneCore::ConfigItem.new(key: :verbose,
                                   description: "Allow ouput detail in console",
                                   optional: true,
                                   is_string: false),
    FastlaneCore::ConfigItem.new(key: :allow_warnings,
                                   description: "Allow warnings during pod lint",
                                   optional: true,
                                   is_string: false),
    FastlaneCore::ConfigItem.new(key: :sources,
                                   description: "The sources of repos you want the pod spec to lint with, separated by commas",
                                   optional: true,
                                   is_string: false,
                                   verify_block: proc do |value|
                                     raise "Sources must be an array.".red unless value.kind_of?(Array)
                                   end)
  ]
end

.descriptionObject



35
36
37
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 35

def self.description
  "Pod lib lint"
end

.detailsObject



39
40
41
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 39

def self.details
  "Test the syntax of your Podfile by linting the pod against the files of its directory"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 78

def self.is_supported?(platform)
  true
end

.outputObject



67
68
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 67

def self.output
end

.return_valueObject



70
71
72
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 70

def self.return_value
  nil
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fastlane/actions/pod_lib_lint.rb', line 4

def self.run(params)
  command = []

  if File.exist?("Gemfile") && params[:use_bundle_exec]
    command << "bundle exec"
  end

  command << "pod lib lint"

  if params[:verbose]
    command << "--verbose"
  end

  if params[:sources]
    sources = params[:sources].join(",")
    command << "--sources='#{sources}'"
  end

  if params[:allow_warnings]
    command << "--allow-warnings"
  end

  result = Actions.sh(command.join(' '))
  Helper.log.info "Pod lib lint Successfully ⬆️ ".green
  return result
end