Class: Omgcnb::BitOfBuildpack
- Inherits:
-
Object
- Object
- Omgcnb::BitOfBuildpack
- Defined in:
- lib/omgcnb/bit_of_buildpack.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #changed_list ⇒ Object
- #depends_on(show_optional: false) ⇒ Object
-
#initialize(toml_contents:, changelog_contents:) ⇒ BitOfBuildpack
constructor
A new instance of BitOfBuildpack.
- #needs_release? ⇒ Boolean
- #toml ⇒ Object
Constructor Details
#initialize(toml_contents:, changelog_contents:) ⇒ BitOfBuildpack
Returns a new instance of BitOfBuildpack.
6 7 8 9 10 11 |
# File 'lib/omgcnb/bit_of_buildpack.rb', line 6 def initialize(toml_contents: , changelog_contents: ) @toml = Tomlrb.parse(toml_contents, symbolize_keys: true) @name = toml.fetch(:buildpack).fetch(:id) @unreleased_markdown = UnreleasedMarkdown.new(changelog_contents) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/omgcnb/bit_of_buildpack.rb', line 5 def name @name end |
Instance Method Details
#changed_list ⇒ Object
17 18 19 |
# File 'lib/omgcnb/bit_of_buildpack.rb', line 17 def changed_list @unreleased_markdown.changed_list end |
#depends_on(show_optional: false) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/omgcnb/bit_of_buildpack.rb', line 25 def depends_on(show_optional: false) @depends_on = toml&.[](:order) &.map { |group_array| group_array[:group] } &.flatten &.map {|group| if show_optional || !group[:optional] group[:id] else nil end }&.compact || [] end |
#needs_release? ⇒ Boolean
13 14 15 |
# File 'lib/omgcnb/bit_of_buildpack.rb', line 13 def needs_release? @unreleased_markdown.needs_release? end |
#toml ⇒ Object
21 22 23 |
# File 'lib/omgcnb/bit_of_buildpack.rb', line 21 def toml @toml end |