Class: BigKeeper::GitflowOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/big_keeper/util/gitflow_operator.rb

Overview

Operator for gitflow

Instance Method Summary collapse

Instance Method Details

#finish_release(path, release_name) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/big_keeper/util/gitflow_operator.rb', line 39

def finish_release(path, release_name)
  Dir.chdir(path) do
    p `git checkout master`
    p `git merge release/#{release_name}`
    p `git push`
    p `git checkout develop`
    p `git merge release/#{release_name}`
    p `git push`
    p `git branch -d release/#{release_name}`
  end
end

#start(path, name, type) ⇒ Object



6
7
8
9
10
11
# File 'lib/big_keeper/util/gitflow_operator.rb', line 6

def start(path, name, type)
  Dir.chdir(path) do
    gitflow_type_name = GitflowType.name(type)
    `git flow #{gitflow_type_name} start #{name}`
  end
end

#verify_git_flow(path) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/big_keeper/util/gitflow_operator.rb', line 23

def verify_git_flow(path)
  has_git_flow = false
  Dir.chdir(path) do
    clear_flag = 'Already initialized for gitflow'
    IO.popen('git flow init -d') do |io|
      io.each do |line|
        if line.include? clear_flag
          has_git_flow = true
          break
        end
      end
    end
  end
  has_git_flow
end

#verify_git_flow_commandObject



13
14
15
16
17
18
19
20
21
# File 'lib/big_keeper/util/gitflow_operator.rb', line 13

def verify_git_flow_command
  has_git_flow_command = false
  IO.popen('command -v git-flow') do |io|
    io.each do |line|
      has_git_flow_command = true
    end
  end
  has_git_flow_command
end