class Git::Lint::Branches::Environments::NetlifyCI

Provides Netlify CI build environment feature branch information.

Public Class Methods

new(repository: GitPlus::Repository.new, shell: Open3, environment: ENV) click to toggle source
# File lib/git/lint/branches/environments/netlify_ci.rb, line 11
def initialize repository: GitPlus::Repository.new, shell: Open3, environment: ENV
  @repository = repository
  @shell = shell
  @environment = environment
end

Public Instance Methods

commits() click to toggle source
# File lib/git/lint/branches/environments/netlify_ci.rb, line 19
def commits
  shell.capture3 "git remote add -f origin #{environment["REPOSITORY_URL"]}"
  shell.capture3 "git fetch origin #{name}:#{name}"
  repository.commits "origin/#{repository.branch_default}..origin/#{name}"
end
name(= environment["HEAD"]) click to toggle source
# File lib/git/lint/branches/environments/netlify_ci.rb, line 17
  def name = environment["HEAD"]

  def commits
    shell.capture3 "git remote add -f origin #{environment["REPOSITORY_URL"]}"
    shell.capture3 "git fetch origin #{name}:#{name}"
    repository.commits "origin/#{repository.branch_default}..origin/#{name}"
  end

  private

  attr_reader :repository, :shell, :environment
end