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(scm, options) ⇒ Complete

Returns a new instance of Complete.



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

def initialize(scm, options)
  @scm = scm
  consumer = ::EacRubyUtils::OptionsConsumer.new(options)
  @skip_validations = consumer.consume(:skip_validations)
  validate_skip_validations
  consumer.validate
end

Instance Attribute Details

#scmObject (readonly)

Returns the value of attribute scm.



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

def scm
  @scm
end

#skip_validationsObject (readonly)

Returns the value of attribute skip_validations.



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

def skip_validations
  @skip_validations
end

Instance Method Details

#dirString

Returns:

  • (String)


25
26
27
# File 'lib/avm/git/issue/complete.rb', line 25

def dir
  scm.path.to_path
end

#issue_idObject



42
43
44
# File 'lib/avm/git/issue/complete.rb', line 42

def issue_id
  branch ? issue_id_parser.parse(branch_name) : nil
end

#issue_id_parserEacRubyUtils::RegexpParser

Returns:

  • (EacRubyUtils::RegexpParser)


47
48
49
# File 'lib/avm/git/issue/complete.rb', line 47

def issue_id_parser
  /\A#{Regexp.quote('issue_')}(\d+)\z/.to_parser { |m| m[1].to_i }
end

#runObject



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

def run
  return false unless valid?

  assert_tag
  push
  remove_local_branch
  true
end

#start_bannerObject



29
30
31
# File 'lib/avm/git/issue/complete.rb', line 29

def start_banner
  validations_banner
end