Class: GrowlGithubFeed::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



9
10
11
12
13
14
15
16
17
# File 'lib/growl-github-feed/config.rb', line 9

def initialize
  # set user parameters
  local_user = ENV["USER"]
  config = ParseConfig.new("/Users/#{local_user}/.gitconfig")
  @user = config['github']['user']
  @token= config['github']['token']
  @user = ask("Github user name: ") if @user.nil?
  @pass = ask("Github password: ") { |q| q.echo = false } if @token.nil?
end

Instance Attribute Details

#passObject (readonly)

Returns the value of attribute pass.



7
8
9
# File 'lib/growl-github-feed/config.rb', line 7

def pass
  @pass
end

#tokenObject (readonly)

Returns the value of attribute token.



7
8
9
# File 'lib/growl-github-feed/config.rb', line 7

def token
  @token
end

#userObject (readonly)

Returns the value of attribute user.



7
8
9
# File 'lib/growl-github-feed/config.rb', line 7

def user
  @user
end