Module: Branch::Name::Locatable

Included in:
CLI, Configurable, Projectable
Defined in:
lib/branch/name/locatable.rb

Class Method Summary collapse

Class Method Details

.global_folder?Boolean

Is the current folder we’re in the same as the global folder?

Returns:

  • (Boolean)


23
24
25
# File 'lib/branch/name/locatable.rb', line 23

def global_folder?
  global_folder == local_folder
end

.home_folderObject Also known as: global_folder



12
13
14
# File 'lib/branch/name/locatable.rb', line 12

def home_folder
  Dir.home
end

.local_folderObject



18
19
20
# File 'lib/branch/name/locatable.rb', line 18

def local_folder
  Dir.pwd
end

.project_folder(options: {}) ⇒ Object



27
28
29
30
31
# File 'lib/branch/name/locatable.rb', line 27

def project_folder(options: {})
  return home_folder if options.blank?

  home_folder
end

.temp_folderObject



33
34
35
# File 'lib/branch/name/locatable.rb', line 33

def temp_folder
  Dir.tmpdir
end