class Git::Lint::Branches::Feature
Represents a feature branch.
Attributes
current_environment[R]
selected_environment[R]
Public Class Methods
new(environment: ENV, git_repo: GitPlus::Repository.new)
click to toggle source
# File lib/git/lint/branches/feature.rb, line 17 def initialize environment: ENV, git_repo: GitPlus::Repository.new message = "Invalid repository. Are you within a Git-enabled project?" fail Errors::Base, message unless git_repo.exist? @current_environment = environment @selected_environment = load_environment end
Private Instance Methods
key?(key)
click to toggle source
# File lib/git/lint/branches/feature.rb, line 38 def key?(key) = current_environment.fetch(key, "false").to_bool end
load_environment()
click to toggle source
# File lib/git/lint/branches/feature.rb, line 29 def load_environment if key? "CIRCLECI" then Environments::CircleCI.new elsif key? "GITHUB_ACTIONS" then Environments::GitHubAction.new elsif key? "NETLIFY" then Environments::NetlifyCI.new environment: current_environment elsif key? "TRAVIS" then Environments::TravisCI.new environment: current_environment else Environments::Local.new end end