Class: Git::Daily::Hotfix

Inherits:
Release show all
Defined in:
lib/git-daily/command/hotfix.rb

Constant Summary

Constants inherited from Release

Release::SUBCOMMAND

Instance Method Summary collapse

Methods inherited from Release

#close, #list, #open, #run, #sync

Methods inherited from Command

branches, clean?, current_branch, develop, has_branch?, has_remote_branch?, logurl, master, merged_branches, pull_request_url, release_branches, remote, remote_branch, remotes, #run

Constructor Details

#initializeHotfix

Returns a new instance of Hotfix.



9
10
11
12
13
# File 'lib/git-daily/command/hotfix.rb', line 9

def initialize
  @base_branch = Command.master
  @branch_prefix = 'hotfix'
  @release_branch_prefix =  'release'
end

Instance Method Details

#helpObject



15
16
17
# File 'lib/git-daily/command/hotfix.rb', line 15

def help
  "hotfix\tOperation hotfix release"
end

#merge_branchesObject



19
20
21
22
23
24
25
26
# File 'lib/git-daily/command/hotfix.rb', line 19

def merge_branches
  rel_branches = Command.release_branches(@release_branch_prefix)
  if rel_branches.empty?
    return [Command.master, Command.develop]
  else
    return [Command.master, @release_branch_prefix]
  end
end

#usageObject



28
29
30
31
32
33
34
35
# File 'lib/git-daily/command/hotfix.rb', line 28

def usage
  "Usage: git daily hotfix open        : Open hotfix-release process\n   or: git daily hotfix list        : Show hotfix list\n   or: git daily hotfix sync        : Sync current opened hotfix process\n   or: git daily hotfix close       : Close to hotfix-release process\n"
end