Class: Pronto::Config
- Inherits:
-
Object
- Object
- Pronto::Config
- Defined in:
- lib/pronto/config.rb
Instance Method Summary collapse
- #bitbucket_hostname ⇒ Object
- #consolidate_comments? ⇒ Boolean
- #excluded_files ⇒ Object
- #github_hostname ⇒ Object
-
#initialize(config_hash = ConfigFile.new.to_h) ⇒ Config
constructor
A new instance of Config.
- #logger ⇒ Object
- #max_warnings ⇒ Object
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_hostname ⇒ Object
28 29 30 |
# File 'lib/pronto/config.rb', line 28 def bitbucket_hostname URI.parse(bitbucket_web_endpoint).host end |
#consolidate_comments? ⇒ Boolean
14 15 16 |
# File 'lib/pronto/config.rb', line 14 def consolidate_comments? !@config_hash['consolidate_comments'].nil? end |
#excluded_files ⇒ Object
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.(path) } end |
#github_hostname ⇒ Object
24 25 26 |
# File 'lib/pronto/config.rb', line 24 def github_hostname URI.parse(github_web_endpoint).host end |
#logger ⇒ Object
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_warnings ⇒ Object
32 33 34 |
# File 'lib/pronto/config.rb', line 32 def max_warnings @config_hash['max_warnings'] end |