Class: GitHubChangelogGenerator::ParserFile
- Inherits:
-
Object
- Object
- GitHubChangelogGenerator::ParserFile
- Defined in:
- lib/github_changelog_generator/parser_file.rb
Overview
ParserFile is a configuration file reader which sets options in the given Hash.
In your project’s root, you can put a file named .github_changelog_generator
to override defaults.
Example:
header_label=# My Super Changelog
; Comments are allowed
future-release=5.0.0
# Ruby-style comments, too
since-tag=1.0.0
The configuration format is some-key=value
or some_key=value
.
Instance Method Summary collapse
-
#initialize(options, file = open_settings_file) ⇒ ParserFile
constructor
A new instance of ParserFile.
-
#parse! ⇒ Object
Sets options using configuration file content.
Constructor Details
permalink #initialize(options, file = open_settings_file) ⇒ ParserFile
Returns a new instance of ParserFile.
26 27 28 29 |
# File 'lib/github_changelog_generator/parser_file.rb', line 26 def initialize(, file = open_settings_file) @options = @file = file end |
Instance Method Details
permalink #parse! ⇒ Object
Sets options using configuration file content
32 33 34 35 36 37 |
# File 'lib/github_changelog_generator/parser_file.rb', line 32 def parse! return unless @file @file.each_with_index { |line, i| parse_line!(line, i + 1) } @file.close end |