Module: PivoFlow::State

Included in:
Cli, Pivotal
Defined in:
lib/pivo_flow/state.rb

Class Method Summary collapse

Class Method Details

.current_branch_nameObject



5
6
7
# File 'lib/pivo_flow/state.rb', line 5

def current_branch_name
  Grit::Repo.new(Dir.pwd).head.name
end

.current_story_idObject



19
20
21
22
23
# File 'lib/pivo_flow/state.rb', line 19

def current_story_id
  return nil unless File.exist?(current_story_id_file_path)

  File.read(current_story_id_file_path)
end

.current_story_id_file_pathObject



13
14
15
16
17
# File 'lib/pivo_flow/state.rb', line 13

def current_story_id_file_path
  flat_branch_name = current_branch_name.gsub('/', '--')

  File.join(story_id_tmp_path, flat_branch_name)
end

.story_id_tmp_pathObject



9
10
11
# File 'lib/pivo_flow/state.rb', line 9

def story_id_tmp_path
  "#{Dir.pwd}/tmp/.pivo_flow/stories"
end