Class: GitHubChangelogGenerator::FileParserChooser
- Inherits:
-
Object
- Object
- GitHubChangelogGenerator::FileParserChooser
- Defined in:
- lib/github_changelog_generator/parser_file.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ FileParserChooser
constructor
A new instance of FileParserChooser.
- #parse!(_argv) ⇒ Object
- #resolve_path ⇒ Object
Constructor Details
#initialize(options) ⇒ FileParserChooser
Returns a new instance of FileParserChooser.
9 10 11 12 |
# File 'lib/github_changelog_generator/parser_file.rb', line 9 def initialize() @options = @config_file = Pathname.new([:config_file]) end |
Instance Method Details
#parse!(_argv) ⇒ Object
14 15 16 17 18 |
# File 'lib/github_changelog_generator/parser_file.rb', line 14 def parse!(_argv) return nil unless (path = resolve_path) ParserFile.new(@options, File.open(path)).parse! end |
#resolve_path ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/github_changelog_generator/parser_file.rb', line 20 def resolve_path return @config_file if @config_file.exist? path = @config_file. return path if File.exist?(path) nil end |