Class: InchCI::Action::EnsureProjectAndBranch

Inherits:
Object
  • Object
show all
Defined in:
lib/inch_ci/action.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url_or_params, branch_name, origin = nil) ⇒ EnsureProjectAndBranch

Returns a new instance of EnsureProjectAndBranch.


58
59
60
61
62
63
64
65
66
# File 'lib/inch_ci/action.rb', line 58

def initialize(url_or_params, branch_name, origin = nil)
  @project = InchCI::Store::EnsureProject.call(project_url(url_or_params), origin)
  @project = update_project(@project) if !@project.default_branch
  if branch_name.nil?
    @branch = InchCI::Store::FindDefaultBranch.call(@project)
  else
    @branch = InchCI::Store::EnsureProjectAndBranch.call(project_url(url_or_params), branch_name)
  end
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch


52
53
54
# File 'lib/inch_ci/action.rb', line 52

def branch
  @branch
end

#projectObject (readonly)

Returns the value of attribute project


52
53
54
# File 'lib/inch_ci/action.rb', line 52

def project
  @project
end

Class Method Details

.call(*args) ⇒ Object


54
55
56
# File 'lib/inch_ci/action.rb', line 54

def self.call(*args)
  new(*args).branch
end