Class: TypeSpecFromSerializers::Changes
- Inherits:
-
Object
- Object
- TypeSpecFromSerializers::Changes
- Defined in:
- lib/typespec_from_serializers/generator.rb
Overview
Internal: Structure to keep track of changed files.
Instance Method Summary collapse
- #any_removed? ⇒ Boolean
- #clear ⇒ Object
-
#initialize(dirs) ⇒ Changes
constructor
A new instance of Changes.
- #modified_files ⇒ Object
- #only_modified? ⇒ Boolean
- #updated? ⇒ Boolean
Constructor Details
#initialize(dirs) ⇒ Changes
Returns a new instance of Changes.
567 568 569 570 571 572 |
# File 'lib/typespec_from_serializers/generator.rb', line 567 def initialize(dirs) @added = Set.new @removed = Set.new @modified = Set.new track_changes(dirs) end |
Instance Method Details
#any_removed? ⇒ Boolean
578 579 580 |
# File 'lib/typespec_from_serializers/generator.rb', line 578 def any_removed? @removed.any? end |
#clear ⇒ Object
590 591 592 593 594 |
# File 'lib/typespec_from_serializers/generator.rb', line 590 def clear @added.clear @removed.clear @modified.clear end |
#modified_files ⇒ Object
582 583 584 |
# File 'lib/typespec_from_serializers/generator.rb', line 582 def modified_files @modified end |
#only_modified? ⇒ Boolean
586 587 588 |
# File 'lib/typespec_from_serializers/generator.rb', line 586 def only_modified? @added.empty? && @removed.empty? end |
#updated? ⇒ Boolean
574 575 576 |
# File 'lib/typespec_from_serializers/generator.rb', line 574 def updated? @modified.any? || @added.any? || @removed.any? end |