Class: Bard::CLI::CI

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/bard/ci.rb,
lib/bard/ci/local.rb,
lib/bard/ci/jenkins.rb,
lib/bard/ci/github_actions.rb

Defined Under Namespace

Classes: GithubActions, Jenkins, Local

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_name, branch, local: false) ⇒ CI

Returns a new instance of CI.



5
6
7
8
9
# File 'lib/bard/ci.rb', line 5

def initialize project_name, branch, local: false
  @project_name = project_name
  @branch = branch
  @local = !!local
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



11
12
13
# File 'lib/bard/ci.rb', line 11

def branch
  @branch
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



11
12
13
# File 'lib/bard/ci.rb', line 11

def project_name
  @project_name
end

#runnerObject (readonly)

Returns the value of attribute runner.



11
12
13
# File 'lib/bard/ci.rb', line 11

def runner
  @runner
end

Instance Method Details

#shaObject



13
14
15
# File 'lib/bard/ci.rb', line 13

def sha
  @sha ||= `git rev-parse #{branch}`.chomp
end