Class: Git::Lint::Branches::Environments::NetlifyCI
- Inherits:
-
Object
- Object
- Git::Lint::Branches::Environments::NetlifyCI
- Defined in:
- lib/git/lint/branches/environments/netlify_ci.rb
Overview
Provides Netlify CI build environment feature branch information.
Instance Method Summary collapse
- #commits ⇒ Object
-
#initialize(repository: GitPlus::Repository.new, shell: Open3, environment: ENV) ⇒ NetlifyCI
constructor
A new instance of NetlifyCI.
- #name ⇒ Object
Constructor Details
#initialize(repository: GitPlus::Repository.new, shell: Open3, environment: ENV) ⇒ NetlifyCI
Returns a new instance of NetlifyCI.
11 12 13 14 15 |
# 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 |
Instance Method Details
#commits ⇒ Object
21 22 23 24 25 |
# File 'lib/git/lint/branches/environments/netlify_ci.rb', line 21 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 ⇒ Object
17 18 19 |
# File 'lib/git/lint/branches/environments/netlify_ci.rb', line 17 def name environment["HEAD"] end |