Module: GitmeTime::Config

Defined in:
lib/gitme_time/config.rb

Class Method Summary collapse

Class Method Details

.domainObject



22
23
24
# File 'lib/gitme_time/config.rb', line 22

def domain
  project_data['domain']
end

.passwordObject



34
35
36
# File 'lib/gitme_time/config.rb', line 34

def password
  user_data['basecamp.password']
end

.project_config_fileObject



42
43
44
# File 'lib/gitme_time/config.rb', line 42

def project_config_file
  File.join project_directory, '.gitme_time.yml'
end

.project_data?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/gitme_time/config.rb', line 38

def project_data?
  File.exists? project_config_file
end

.project_directoryObject



10
11
12
# File 'lib/gitme_time/config.rb', line 10

def project_directory
  `git rev-parse --show-toplevel 2> /dev/null`.chomp
end

.project_directory?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/gitme_time/config.rb', line 6

def project_directory?
  project_directory.present?
end

.project_hook_fileObject



46
47
48
# File 'lib/gitme_time/config.rb', line 46

def project_hook_file
  File.expand_path '../.git/hooks/post-commit', Config.project_config_file
end

.project_idObject



26
27
28
# File 'lib/gitme_time/config.rb', line 26

def project_id
  project_data['project_id']
end

.project_tagObject



14
15
16
# File 'lib/gitme_time/config.rb', line 14

def project_tag
  project_data['tag']
end

.track_empty_hours?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/gitme_time/config.rb', line 18

def track_empty_hours?
  project_data['track_empty_hours']
end

.usernameObject



30
31
32
# File 'lib/gitme_time/config.rb', line 30

def username
  user_data['basecamp.username']
end