Class: Pronto::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/pronto/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_hash = ConfigFile.new.to_h) ⇒ Config

Returns a new instance of Config.



3
4
5
# File 'lib/pronto/config.rb', line 3

def initialize(config_hash = ConfigFile.new.to_h)
  @config_hash = config_hash
end

Instance Method Details

#bitbucket_hostnameObject



28
29
30
# File 'lib/pronto/config.rb', line 28

def bitbucket_hostname
  URI.parse(bitbucket_web_endpoint).host
end

#consolidate_comments?Boolean

Returns:

  • (Boolean)


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

def consolidate_comments?
  !@config_hash['consolidate_comments'].nil?
end

#excluded_filesObject



18
19
20
21
22
# File 'lib/pronto/config.rb', line 18

def excluded_files
  @excluded_files ||= Array(exclude)
    .flat_map { |path| Dir[path.to_s] }
    .map { |path| File.expand_path(path) }
end

#github_hostnameObject



24
25
26
# File 'lib/pronto/config.rb', line 24

def github_hostname
  URI.parse(github_web_endpoint).host
end

#loggerObject



36
37
38
39
40
# File 'lib/pronto/config.rb', line 36

def logger
  @logger ||= begin
    @config_hash['verbose'] ? Logger.new($stdout) : Logger.silent
  end
end

#max_warningsObject



32
33
34
# File 'lib/pronto/config.rb', line 32

def max_warnings
  @config_hash['max_warnings']
end