Class: Danger::Changelog::ChangelogFile
- Inherits:
-
Object
- Object
- Danger::Changelog::ChangelogFile
- Defined in:
- lib/changelog/changelog_file.rb
Overview
A CHANGELOG.md file reader.
Instance Attribute Summary collapse
-
#bad_lines ⇒ Object
readonly
Returns the value of attribute bad_lines.
-
#exists ⇒ Object
readonly
Returns the value of attribute exists.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #bad? ⇒ Boolean
-
#bad_lines? ⇒ Boolean
Any bad_lines?.
- #exists? ⇒ Boolean
- #good? ⇒ Boolean
-
#initialize(filename = 'CHANGELOG.md') ⇒ ChangelogFile
constructor
A new instance of ChangelogFile.
- #your_contribution_here? ⇒ Boolean
Constructor Details
#initialize(filename = 'CHANGELOG.md') ⇒ ChangelogFile
Returns a new instance of ChangelogFile.
7 8 9 10 11 |
# File 'lib/changelog/changelog_file.rb', line 7 def initialize(filename = 'CHANGELOG.md') @filename = filename @exists = File.exist?(filename) parse if @exists end |
Instance Attribute Details
#bad_lines ⇒ Object (readonly)
Returns the value of attribute bad_lines.
5 6 7 |
# File 'lib/changelog/changelog_file.rb', line 5 def bad_lines @bad_lines end |
#exists ⇒ Object (readonly)
Returns the value of attribute exists.
5 6 7 |
# File 'lib/changelog/changelog_file.rb', line 5 def exists @exists end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/changelog/changelog_file.rb', line 5 def filename @filename end |
Instance Method Details
#bad? ⇒ Boolean
26 27 28 |
# File 'lib/changelog/changelog_file.rb', line 26 def bad? bad_lines? || !(your_contribution_here? || !Danger::Changelog.config.placeholder_line?) end |
#bad_lines? ⇒ Boolean
Any bad_lines?
14 15 16 |
# File 'lib/changelog/changelog_file.rb', line 14 def bad_lines? !!bad_lines && bad_lines.any? end |
#exists? ⇒ Boolean
18 19 20 |
# File 'lib/changelog/changelog_file.rb', line 18 def exists? !!@exists end |
#good? ⇒ Boolean
30 31 32 |
# File 'lib/changelog/changelog_file.rb', line 30 def good? !bad? end |
#your_contribution_here? ⇒ Boolean
22 23 24 |
# File 'lib/changelog/changelog_file.rb', line 22 def your_contribution_here? !!@your_contribution_here end |