Sha256: de71f9cbabdb427972d65dfc5ec04f2eb4de7b8ddd3c798b1f1720480d909ed4
Contents?: true
Size: 1.23 KB
Versions: 3
Compression:
Stored size: 1.23 KB
Contents
# frozen_string_literal: true require "forwardable" module Git module Lint module Branches # Represents a feature branch. class Feature extend Forwardable def_delegators :selected_environment, :name, :shas def initialize environment: ENV, git_repo: Git::Kit::Repo.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 def commits shas.map { |sha| Commits::Saved.new sha: sha } end private attr_reader :current_environment, :selected_environment 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 def key? key current_environment[key] == "true" end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
git-lint-1.4.0 | lib/git/lint/branches/feature.rb |
git-lint-1.3.0 | lib/git/lint/branches/feature.rb |
git-lint-1.2.0 | lib/git/lint/branches/feature.rb |