Class: Avm::Git::Issue::Complete

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/git/issue/complete.rb,
lib/avm/git/issue/complete/push.rb,
lib/avm/git/issue/complete/test.rb,
lib/avm/git/issue/complete/remote.rb,
lib/avm/git/issue/complete/commits.rb,
lib/avm/git/issue/complete/tracker.rb,
lib/avm/git/issue/complete/local_tag.rb,
lib/avm/git/issue/complete/validation.rb,
lib/avm/git/issue/complete/validations.rb,
lib/avm/git/issue/complete/git_subrepos.rb,
lib/avm/git/issue/complete/local_branch.rb,
lib/avm/git/issue/complete/working_tree.rb

Defined Under Namespace

Modules: Commits, GitSubrepos, LocalBranch, LocalTag, Push, Remote, Test, Tracker, Validations, WorkingTree Classes: Validation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Complete

Returns a new instance of Complete.



15
16
17
18
19
20
21
# File 'lib/avm/git/issue/complete.rb', line 15

def initialize(options)
  consumer = ::EacRubyUtils::OptionsConsumer.new(options)
  dir, @skip_validations = consumer.consume_all(:dir, :skip_validations)
  validate_skip_validations
  consumer.validate
  @git = ::Avm::Launcher::Git::Base.new(dir)
end

Instance Attribute Details

#skip_validationsObject (readonly)

Returns the value of attribute skip_validations.



13
14
15
# File 'lib/avm/git/issue/complete.rb', line 13

def skip_validations
  @skip_validations
end

Instance Method Details

#issue_idObject



37
38
39
40
# File 'lib/avm/git/issue/complete.rb', line 37

def issue_id
  m = branch_name.match(/\A#{Regexp.quote('issue_')}(\d+)\z/)
  m ? m[1].to_i : nil
end

#runObject



27
28
29
30
31
32
33
34
35
# File 'lib/avm/git/issue/complete.rb', line 27

def run
  return false unless valid?

  assert_tag
  push
  remove_local_branch
  clipboard_copy_tracker_message
  true
end

#start_bannerObject



23
24
25
# File 'lib/avm/git/issue/complete.rb', line 23

def start_banner
  validations_banner
end