Module: Gish::Configuration

Includes:
InputHelpers
Included in:
Gish
Defined in:
lib/gish/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InputHelpers

#capture_editor_input, #confirm, #prompt

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



6
7
8
# File 'lib/gish/configuration.rb', line 6

def access_token
  @access_token
end

#browserObject

Returns the value of attribute browser.



6
7
8
# File 'lib/gish/configuration.rb', line 6

def browser
  @browser
end

#editorObject

Returns the value of attribute editor.



6
7
8
# File 'lib/gish/configuration.rb', line 6

def editor
  @editor
end

#repositoryObject

Returns the value of attribute repository.



6
7
8
# File 'lib/gish/configuration.rb', line 6

def repository
  @repository
end

Class Method Details

.extended(base) ⇒ Object



8
9
10
# File 'lib/gish/configuration.rb', line 8

def self.extended(base)
  base.defaults
end

Instance Method Details

#defaultsObject



32
33
34
35
36
37
38
# File 'lib/gish/configuration.rb', line 32

def defaults
  @config_file = File.expand_path('~/.gish')
  self.access_token = retrieve_or_generate_token
  self.editor = (ENV['GISH_EDITOR'] || ENV['EDITOR']) || 'vi'
  self.browser = (ENV['GISH_BROWSER'] || ENV['BROWSER']) || 'open'
  self.repository = default_repository
end

#github_urlObject



28
29
30
# File 'lib/gish/configuration.rb', line 28

def github_url
  "http://github.com/#{@repository}"
end