Class: Pantograph::Actions::DefaultPlatformAction

Inherits:
Pantograph::Action show all
Defined in:
pantograph/lib/pantograph/actions/default_platform.rb

Constant Summary

Constants inherited from Pantograph::Action

Pantograph::Action::AVAILABLE_CATEGORIES, Pantograph::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Pantograph::Action

action_name, authors, available_options, deprecated_notes, details, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



40
41
42
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 40

def self.author
  'KrauseFx'
end

.categoryObject



36
37
38
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 36

def self.category
  :misc
end

.descriptionObject



20
21
22
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 20

def self.description
  'Defines a default platform to not have to specify the platform'
end

.example_codeObject



30
31
32
33
34
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 30

def self.example_code
  [
    'default_platform(:gradle)'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



44
45
46
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 44

def self.is_supported?(platform)
  true
end

.outputObject



24
25
26
27
28
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 24

def self.output
  [
    ['DEFAULT_PLATFORM', 'The default platform']
  ]
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'pantograph/lib/pantograph/actions/default_platform.rb', line 8

def self.run(params)
  if params.first.nil?
    UI.user_error!('You forgot to pass the default platform')
  end

  platform = params.first.to_sym

  SupportedPlatforms.verify!(platform)

  Actions.lane_context[SharedValues::DEFAULT_PLATFORM] = platform
end