Class: Terradactyl::StacksPlanFilterGitDiffOriginBranch

Inherits:
StacksPlanFilterGitDiffHead show all
Defined in:
lib/terradactyl/filters.rb

Constant Summary

Constants included from Common

Common::BORDER_CHAR, Common::COLUMN_WIDTH

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StacksPlanFilterGitDiffHead

#sift

Methods inherited from StacksPlanFilterDefault

#sift, #stack_name

Methods included from Common

border, centre, config, cputs, dot_icon, print_content, print_crit, print_dot, print_header, print_line, print_message, print_ok, print_warning, required_versions_re, stack_icon, supported_revisions, tag, terraform_binary

Class Method Details

.descObject



70
71
72
# File 'lib/terradactyl/filters.rb', line 70

def self.desc
  'A list of all stacks that differ from Git origin/HEAD'
end

.nameObject



66
67
68
# File 'lib/terradactyl/filters.rb', line 66

def self.name
  'diff-origin'
end

Instance Method Details

#current_branchObject



74
75
76
# File 'lib/terradactyl/filters.rb', line 74

def current_branch
  `git symbolic-ref -q --short HEAD`
end

#git_cmdObject



78
79
80
81
82
# File 'lib/terradactyl/filters.rb', line 78

def git_cmd
  `git --no-pager diff --name-only origin/#{current_branch} .`
rescue StandardError
  String.new
end