Class: GithubBackup::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/github-backup/config.rb

Constant Summary collapse

DEFAULTS =
{
  :gitconfig_path => "#{ENV['HOME']}/.gitconfig",
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



10
11
12
13
14
# File 'lib/github-backup/config.rb', line 10

def initialize(options = {})
  @backup_root    = options.fetch(:backup_root)    { raise ArgumentError, 'A backup_root option is required' }
  @gitconfig_path = options.fetch(:gitconfig_path) { DEFAULTS[:gitconfig_path] }
  @token          = options.fetch(:token)          { default_token }
end

Instance Attribute Details

#backup_rootObject (readonly)

Returns the value of attribute backup_root.



8
9
10
# File 'lib/github-backup/config.rb', line 8

def backup_root
  @backup_root
end

#gitconfig_pathObject (readonly)

Returns the value of attribute gitconfig_path.



8
9
10
# File 'lib/github-backup/config.rb', line 8

def gitconfig_path
  @gitconfig_path
end

#tokenObject (readonly)

Returns the value of attribute token.



8
9
10
# File 'lib/github-backup/config.rb', line 8

def token
  @token
end