Class: Pantograph::Actions::ImportFromGitAction

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

Constant Summary

Constants inherited from Pantograph::Action

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Pantograph::Action

action_name, author, deprecated_notes, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



50
51
52
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 50

def self.authors
  ['fabiomassimo', 'KrauseFx', 'Liquidsoul', 'johnknapprs']
end

.available_optionsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 20

def self.available_options
  [
    PantographCore::ConfigItem.new(
      key: :url,
      description: 'The URL of the repository to import the Pantfile from',
      default_value: nil,
      optional: false
    ),
    PantographCore::ConfigItem.new(
      key: :branch,
      description: 'The branch or tag to check-out on the repository',
      default_value: 'master',
      optional: true
    ),
    PantographCore::ConfigItem.new(
      key: :path,
      description: 'The path of the Pantfile in the repository',
      default_value: 'pantograph/Pantfile',
      optional: true
    ),
    PantographCore::ConfigItem.new(
      key: :version,
      description: 'The version to checkout on the repository. Optimistic match operator or multiple conditions can be used to select the version within constraints',
      default_value: nil,
      is_string: false,
      optional: true
    )
  ]
end

.categoryObject



83
84
85
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 83

def self.category
  :misc
end

.descriptionObject



12
13
14
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 12

def self.description
  'Import another Pantfile from a remote git repository to use its lanes'
end

.detailsObject



16
17
18
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 16

def self.details
  'This is useful when sharing the same lanes across multiple projects'
end

.example_codeObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 58

def self.example_code
  [
    ' # Simple import on master branch
      import_from_git(
        url: "[email protected]:urbanquakers/pantograph.git"
      )
    ',
    ' # Import a Pantfile with an Optimistic version match operator
      import_from_git(
        url: "[email protected]:urbanquakers/pantograph.git",
        branch: "master",
        path: "pantograph/Pantfile",
        version: "~> 1.0.0"
      )
    ',
    ' # Import a Pantfile with multiple version conditions
      import_from_git(
        url: "[email protected]:urbanquakers/pantograph.git", # The URL of the repository to import the Pantfile from.
        branch: "development", # The branch to checkout on the repository
        version: [">= 1.1.0", "< 2.0.0"]
      )
    '
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



54
55
56
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 54

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
# File 'pantograph/lib/pantograph/actions/import_from_git.rb', line 4

def self.run(params)
  # this is implemented in the pant_file.rb
end