Class: GitSleep::CredentialsFile

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/git-sleep/credentials_file.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



11
12
13
14
15
16
# File 'lib/git-sleep/credentials_file.rb', line 11

def destroy
  File.delete(path)
  true
rescue Errno::ENOENT
  false
end

#pathObject



18
19
20
# File 'lib/git-sleep/credentials_file.rb', line 18

def path
  @path ||= File.expand_path('~/.netrc')
end

#present?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/git-sleep/credentials_file.rb', line 7

def present?
  File.exist?(path)
end