Class: Avm::Tools::Git::CompleteIssue
- Inherits:
-
Object
- Object
- Avm::Tools::Git::CompleteIssue
- Includes:
- EacRubyUtils::Console::Speaker, EacRubyUtils::SimpleCache
- Defined in:
- lib/avm/tools/git/complete_issue.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #branch_hash ⇒ Object
- #branch_name ⇒ Object
-
#initialize(options) ⇒ CompleteIssue
constructor
A new instance of CompleteIssue.
- #issue_id ⇒ Object
- #remote_branch_hash ⇒ Object
- #remote_master_hash ⇒ Object
- #remote_tag_hash ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ CompleteIssue
14 15 16 17 |
# File 'lib/avm/tools/git/complete_issue.rb', line 14 def initialize() @git = ::EacLauncher::Git::Base.new(.fetch(:dir)) run end |
Instance Method Details
#branch ⇒ Object
26 27 28 |
# File 'lib/avm/tools/git/complete_issue.rb', line 26 def branch @git.current_branch end |
#branch_hash ⇒ Object
30 31 32 |
# File 'lib/avm/tools/git/complete_issue.rb', line 30 def branch_hash @git.rev_parse("refs/heads/#{branch}") end |
#branch_name ⇒ Object
34 35 36 |
# File 'lib/avm/tools/git/complete_issue.rb', line 34 def branch_name branch.split('/')[-1] end |
#issue_id ⇒ Object
38 39 40 41 |
# File 'lib/avm/tools/git/complete_issue.rb', line 38 def issue_id m = branch_name.match(/\A#{Regexp.quote('issue_')}(\d+)\z/) m ? m[1].to_i : nil end |
#remote_branch_hash ⇒ Object
47 48 49 |
# File 'lib/avm/tools/git/complete_issue.rb', line 47 def remote_branch_hash remote_hashs["refs/heads/#{branch}"] end |
#remote_master_hash ⇒ Object
43 44 45 |
# File 'lib/avm/tools/git/complete_issue.rb', line 43 def remote_master_hash remote_hashs['refs/heads/master'] end |
#remote_tag_hash ⇒ Object
51 52 53 |
# File 'lib/avm/tools/git/complete_issue.rb', line 51 def remote_tag_hash remote_hashs[tag] end |
#run ⇒ Object
19 20 21 22 23 24 |
# File 'lib/avm/tools/git/complete_issue.rb', line 19 def run check_issue_branch assert_tag push remove_local_branch end |