class Git::Cop::Branches::Feature
Represents a feature branch.
Attributes
environment[R]
Public Class Methods
environment()
click to toggle source
# File lib/git/cop/branches/feature.rb, line 14 def self.environment if ENV["CIRCLECI"] == "true" Environments::CircleCI.new elsif ENV["TRAVIS"] == "true" Environments::TravisCI.new else Environments::Local.new end end
new(git_repo: Git::Kit::Repo)
click to toggle source
# File lib/git/cop/branches/feature.rb, line 24 def initialize git_repo: Git::Kit::Repo message = "Invalid repository. Are you within a Git-enabled project?" fail(Errors::Base, message) unless git_repo.exist? @environment = self.class.environment end
Public Instance Methods
commits()
click to toggle source
# File lib/git/cop/branches/feature.rb, line 31 def commits shas.map { |sha| Commits::Saved.new sha: sha } end